/**
 * أدوات عربية - Purple Modern Design
 * Complete design system with purple gradient theme
 */

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ensure Arabic font is used everywhere */
* {
    font-family: 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif !important;
}

html {
    scroll-behavior: smooth;
    direction: rtl;
}

body {
    font-family: 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Cairo', 'Tajawal', system-ui, sans-serif;
    background-color: hsl(var(--color-background));
    color: hsl(var(--color-text-secondary));
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Force Arabic font on all interactive elements */
button,
input,
textarea,
select,
.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-ghost,
.btn-success,
.btn-warning,
.btn-danger {
    font-family: 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Cairo', 'Tajawal', system-ui, sans-serif !important;
    font-size: 0.9375rem;
}

/* ==========================================================================
   CSS VARIABLES - PURPLE GRADIENT DESIGN SYSTEM
   ========================================================================== */

:root {
    /* Purple gradient - modern tech look */
    --color-primary: 260 80% 55%;
    --color-primary-light: 260 80% 65%;
    --color-primary-dark: 260 80% 45%;
    --color-gradient-start: 270 70% 50%;
    --color-gradient-end: 250 90% 60%;

    /* Accent purple - for highlights */
    --color-secondary: 280 70% 50%;
    --color-secondary-light: 280 70% 60%;
    --color-secondary-dark: 280 70% 40%;

    /* Text colors - softer and more readable */
    --color-text-primary: 222 47% 11%;
    --color-text-secondary: 215 20% 45%;
    --color-text-muted: 215 16% 65%;

    /* Surface colors - lighter background with subtle purple tint */
    --color-background: 260 25% 98%;
    --color-surface: 0 0% 100%;
    --color-surface-elevated: 260 15% 97%;
    --color-card-tinted: 260 40% 97%;
    --color-border: 260 20% 90%;

    /* Neutral color */
    --color-neutral: 0 0% 64%;

    /* Status colors */
    --color-success: 142 71% 45%;
    --color-warning: 38 92% 50%;
    --color-danger: 0 72% 51%;
    --color-info: 199 89% 48%;

    --color-success-bg: 138 76% 97%;
    --color-warning-bg: 48 100% 96%;
    --color-danger-bg: 0 93% 97%;
    --color-info-bg: 204 100% 97%;

    /* Border radius - more rounded */
    --border-radius-sm: 0.375rem;
    --border-radius: 0.5rem;
    --border-radius-md: 0.75rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;

    /* Shadows - softer and more subtle */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.03);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.06);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -1px rgb(0 0 0 / 0.04);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.07), 0 4px 6px -2px rgb(0 0 0 / 0.03);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.08), 0 10px 10px -5px rgb(0 0 0 / 0.04);
}

/* Dark mode */
.dark {
    --color-primary: 260 80% 65%;
    --color-primary-light: 260 80% 75%;
    --color-primary-dark: 260 80% 55%;
    --color-gradient-start: 270 70% 60%;
    --color-gradient-end: 250 90% 70%;

    --color-secondary: 280 70% 60%;
    --color-secondary-light: 280 70% 70%;
    --color-secondary-dark: 280 70% 50%;

    --color-text-primary: 0 0% 95%;
    --color-text-secondary: 0 0% 80%;
    --color-text-muted: 0 0% 60%;

    --color-background: 0 0% 6%;
    --color-surface: 0 0% 10%;
    --color-surface-elevated: 0 0% 14%;
    --color-border: 0 0% 20%;

    --color-success: 142 71% 50%;
    --color-warning: 45 95% 60%;
    --color-danger: 0 72% 60%;
    --color-info: 199 89% 55%;

    --color-success-bg: 142 71% 50% / 0.15;
    --color-warning-bg: 45 95% 60% / 0.15;
    --color-danger-bg: 0 72% 60% / 0.15;
    --color-info-bg: 199 89% 55% / 0.15;

    --color-neutral: 0 0% 70%;
}

/* ==========================================================================
   HERO SECTION - PURPLE GRADIENT WITH OVERLAY
   ========================================================================== */

.hero-section {
    background: linear-gradient(135deg, hsl(var(--color-gradient-start)) 0%, hsl(var(--color-gradient-end)) 100%);
    position: relative;
    overflow: hidden;
    padding: 5rem 0;
    min-height: 600px;
    display: flex;
    align-items: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M0 0h60v60H0z" fill="none"/%3E%3Cpath d="M30 0L60 30L30 60L0 30z" fill="%23ffffff" fill-opacity="0.03"/%3E%3C/svg%3E');
    background-size: 60px 60px;
    opacity: 0.5;
}

.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
}

.hero-title {
    font-size: 3.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.hero-description {
    font-size: 1.25rem;
    line-height: 1.8;
    margin-bottom: 2.5rem;
    color: rgba(255,255,255,0.95);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-btn {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: var(--border-radius-lg);
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.hero-btn-primary {
    background: white;
    color: hsl(var(--color-primary));
    border: 2px solid white;
}

.hero-btn-primary:hover {
    background: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.hero-btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.hero-btn-secondary:hover {
    background: white;
    color: hsl(var(--color-primary));
    transform: translateY(-2px);
}

/* Stats section in hero */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
    position: relative;
    z-index: 10;
}

.stat-card {
    text-align: center;
    padding: 2rem 1.5rem;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius-xl);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
}

.stat-card:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-5px);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

/* ==========================================================================
   CATEGORY & TOOL CARDS - PURPLE TINTED
   ========================================================================== */

.category-card,
.tool-card {
    background: hsl(var(--color-surface));
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    border: 1px solid hsl(var(--color-border));
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.category-card:hover,
.tool-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-color: hsl(var(--color-primary) / 0.3);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, hsl(var(--color-primary)) 0%, hsl(var(--color-secondary)) 100%);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.75rem;
}

.card-title-custom {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--color-text-primary));
    margin-bottom: 0.75rem;
}

.card-description {
    font-size: 0.9375rem;
    color: hsl(var(--color-text-secondary));
    line-height: 1.6;
    flex-grow: 1;
}

.card-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: hsl(var(--color-primary) / 0.1);
    color: hsl(var(--color-primary));
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 1rem;
}

/* ==========================================================================
   SECTION STYLES
   ========================================================================== */

.section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: hsl(var(--color-text-primary));
    text-align: center;
    margin-bottom: 1rem;
}

.section-description {
    font-size: 1.125rem;
    color: hsl(var(--color-text-secondary));
    text-align: center;
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   CTA SECTION
   ========================================================================== */

.cta-section {
    background: hsl(var(--color-surface-elevated));
    padding: 5rem 0;
    text-align: center;
    border-top: 1px solid hsl(var(--color-border));
    border-bottom: 1px solid hsl(var(--color-border));
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: hsl(var(--color-text-primary));
    margin-bottom: 1rem;
}

.cta-description {
    font-size: 1.125rem;
    color: hsl(var(--color-text-secondary));
    margin-bottom: 2rem;
}

/* ==========================================================================
   HEADER STYLES
   ========================================================================== */

.header {
    background: hsl(var(--color-surface));
    border-bottom: 1px solid hsl(var(--color-border));
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

/* Main content padding to prevent header overlap */
main {
    padding-top: 1.5rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: hsl(var(--color-primary));
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.header-link {
    color: hsl(var(--color-text-secondary));
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.header-link:hover {
    color: hsl(var(--color-primary));
}

/* ==========================================================================
   FOOTER STYLES
   ========================================================================== */

.footer {
    background: linear-gradient(135deg, hsl(240 30% 15%) 0%, hsl(250 35% 10%) 100%);
    color: rgba(255,255,255,0.9);
    padding: 4rem 0 2rem;
    margin-top: 5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    align-items: start;
}

.footer-section h3 {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.75rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 0.875rem;
    padding-right: 0.5rem;
}

.footer-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9375rem;
    display: inline-block;
}

.footer-link:hover {
    color: white;
    transform: translateX(-3px);
}

.footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.footer-social-link {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s;
    text-decoration: none;
}

.footer-social-link:hover {
    background: hsl(var(--color-primary));
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.9375rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all 0.2s;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    border: none;
    outline: none;
    padding: 0.625rem 1.25rem;
    position: relative;
    z-index: 1;
}

.btn > * {
    position: relative;
    z-index: 2;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(135deg, hsl(var(--color-primary)) 0%, hsl(var(--color-primary-dark)) 100%);
    color: white;
    border: 2px solid hsl(var(--color-primary));
    font-family: inherit;
    font-size: 0.9375rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(156, 81, 255, 0.2);
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, hsl(var(--color-primary-light)) 0%, hsl(var(--color-primary)) 100%);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-primary span,
.btn-primary i,
.btn-primary svg {
    position: relative;
    z-index: 2;
}

.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(156, 81, 255, 0.35);
    border-color: hsl(var(--color-primary-light));
    transform: translateY(-3px);
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary-custom {
    background-color: hsl(var(--color-primary));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-lg);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary-custom:hover {
    background-color: hsl(var(--color-primary-dark));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: linear-gradient(135deg, hsl(var(--color-secondary)) 0%, hsl(var(--color-secondary-dark)) 100%);
    color: white;
    border: 2px solid hsl(var(--color-secondary));
    font-family: inherit;
    font-size: 0.9375rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(156, 81, 255, 0.2);
    z-index: 1;
}

.btn-secondary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    z-index: -1;
}

.btn-secondary span,
.btn-secondary i,
.btn-secondary svg {
    position: relative;
    z-index: 2;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, hsl(var(--color-secondary-dark)) 0%, hsl(var(--color-secondary)) 100%);
    box-shadow: 0 8px 24px rgba(156, 81, 255, 0.3);
    border-color: hsl(var(--color-secondary-light));
    transform: translateY(-3px);
}

.btn-secondary:hover::after {
    width: 300px;
    height: 300px;
}

.btn-success {
    background-color: hsl(var(--color-success));
    color: white;
}

.btn-success:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-sm);
}

.btn-warning {
    background-color: hsl(var(--color-warning));
    color: white;
}

.btn-warning:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background-color: hsl(var(--color-danger));
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
    box-shadow: var(--shadow-sm);
}

.btn-ghost {
    background-color: transparent;
    border: 2px solid hsl(var(--color-border));
    color: hsl(var(--color-text-secondary));
    font-family: inherit;
    font-size: 0.9375rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1;
}

.btn-ghost::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, hsl(var(--color-primary) / 0.1) 0%, hsl(var(--color-secondary) / 0.1) 100%);
    transition: width 0.3s ease;
    z-index: -1;
}

.btn-ghost span,
.btn-ghost i,
.btn-ghost svg {
    position: relative;
    z-index: 2;
}

.btn-ghost:hover {
    background-color: hsl(var(--color-surface-elevated));
    border-color: hsl(var(--color-primary));
    color: hsl(var(--color-primary));
    box-shadow: 0 4px 12px rgba(156, 81, 255, 0.15);
    transform: translateY(-2px);
}

.btn-ghost:hover::before {
    width: 100%;
}

.btn-outline {
    background-color: hsl(var(--color-surface));
    border: 2px solid hsl(var(--color-primary) / 0.3);
    color: hsl(var(--color-text-primary));
    font-family: inherit;
    font-size: 0.9375rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, hsl(var(--color-primary)) 0%, hsl(var(--color-secondary)) 100%);
    transition: left 0.3s ease;
    z-index: -1;
}

.btn-outline span,
.btn-outline i,
.btn-outline svg {
    position: relative;
    z-index: 2;
}

.btn-outline:hover {
    background-color: transparent;
    border-color: hsl(var(--color-primary));
    color: white;
    box-shadow: 0 6px 20px rgba(156, 81, 255, 0.25);
    transform: translateY(-2px);
}

.btn-outline:hover::before {
    left: 0;
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
}

.btn-lg {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
}

.btn-xl {
    font-size: 1.125rem;
    padding: 1rem 2rem;
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.card {
    background-color: hsl(var(--color-surface));
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid hsl(var(--color-border));
    padding: 1.5rem;
    margin: 1rem 0;
}

.card-elevated {
    background-color: hsl(var(--color-surface));
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid hsl(var(--color-border));
    transition: all 0.3s;
    padding: 1.5rem;
}

.card-elevated:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-custom {
    background-color: hsl(var(--color-surface));
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid hsl(var(--color-border));
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid hsl(var(--color-border));
    background-color: hsl(var(--color-surface-elevated));
}

.card-header-custom {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid hsl(var(--color-border));
    background-color: hsl(var(--color-surface-elevated));
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--color-text-primary));
    margin: 0;
}

.card-body {
    padding: 1.5rem;
    color: hsl(var(--color-text-secondary));
}

.card-body-custom {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid hsl(var(--color-border));
    background-color: hsl(var(--color-surface-elevated));
}

/* ==========================================================================
   ALERTS
   ========================================================================== */

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 1rem;
    border-right: 4px solid;
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.alert-success {
    background-color: hsl(var(--color-success-bg));
    border-color: hsl(var(--color-success));
    color: hsl(142 76% 30%);
}

.alert-warning {
    background-color: hsl(var(--color-warning-bg));
    border-color: hsl(var(--color-warning));
    color: hsl(38 92% 30%);
}

.alert-danger {
    background-color: hsl(var(--color-danger-bg));
    border-color: hsl(var(--color-danger));
    color: hsl(0 72% 40%);
}

.alert-info {
    background-color: hsl(var(--color-info-bg));
    border-color: hsl(var(--color-info));
    color: hsl(199 89% 35%);
}

/* ==========================================================================
   BADGES
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
}

.badge-primary {
    background-color: hsl(var(--color-primary) / 0.1);
    color: hsl(var(--color-primary));
}

.badge-secondary {
    background-color: hsl(var(--color-secondary) / 0.1);
    color: hsl(var(--color-secondary));
}

.badge-success {
    background-color: hsl(var(--color-success-bg));
    color: hsl(var(--color-success));
}

.badge-warning {
    background-color: hsl(var(--color-warning-bg));
    color: hsl(38 92% 30%);
}

.badge-danger {
    background-color: hsl(var(--color-danger-bg));
    color: hsl(var(--color-danger));
}

.badge-info {
    background-color: hsl(var(--color-info-bg));
    color: hsl(var(--color-info));
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: hsl(var(--color-text-primary));
}

.form-label-custom {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: hsl(var(--color-text-primary));
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: hsl(var(--color-text-primary));
    background-color: hsl(var(--color-surface));
    border: 1.5px solid hsl(var(--color-border));
    border-radius: var(--border-radius-md);
    transition: all 0.2s;
    font-family: inherit;
}

/* Fix date input display in RTL - force LTR for date fields */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
    direction: ltr !important;
    text-align: left !important;
}

/* Right align text in RTL context (Arabic) */
[dir="rtl"] input[type="date"],
[dir="rtl"] input[type="datetime-local"],
[dir="rtl"] input[type="time"] {
    text-align: right !important;
}

/* Ensure internal date picker elements also use LTR - comprehensive fix */
input[type="date"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-text,
input[type="datetime-local"]::-webkit-datetime-edit-text,
input[type="time"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field,
input[type="datetime-local"]::-webkit-datetime-edit-month-field,
input[type="datetime-local"]::-webkit-datetime-edit-day-field,
input[type="datetime-local"]::-webkit-datetime-edit-year-field,
input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
input[type="datetime-local"]::-webkit-datetime-edit-second-field,
input[type="datetime-local"]::-webkit-datetime-edit-millisecond-field,
input[type="datetime-local"]::-webkit-datetime-edit-meridiem-field,
input[type="time"]::-webkit-datetime-edit-hour-field,
input[type="time"]::-webkit-datetime-edit-minute-field,
input[type="time"]::-webkit-datetime-edit-second-field,
input[type="time"]::-webkit-datetime-edit-millisecond-field,
input[type="time"]::-webkit-datetime-edit-meridiem-field {
    direction: ltr !important;
    unicode-bidi: normal !important;
}

.form-input-custom {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: hsl(var(--color-text-primary));
    background-color: hsl(var(--color-surface));
    border: 1.5px solid hsl(var(--color-border));
    border-radius: var(--border-radius-md);
    transition: all 0.2s;
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus,
.form-input-custom:focus {
    outline: none;
    border-color: hsl(var(--color-primary));
    box-shadow: 0 0 0 4px hsl(var(--color-primary) / 0.08);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-checkbox,
.form-radio {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: hsl(var(--color-text-muted));
}

.form-error {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: hsl(var(--color-danger));
}

/* ==========================================================================
   STAT CARDS (for tool results)
   ========================================================================== */

.stat-card-custom {
    background: linear-gradient(135deg, hsl(var(--color-card-tinted)) 0%, white 100%);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid hsl(var(--color-border));
    box-shadow: var(--shadow-sm);
}

.stat-value-custom {
    font-size: 2.5rem;
    font-weight: 700;
    color: hsl(var(--color-primary));
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label-custom {
    font-size: 0.9375rem;
    color: hsl(var(--color-text-secondary));
    font-weight: 500;
}

/* ==========================================================================
   CONTAINERS & LAYOUT
   ========================================================================== */

.container-custom {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-sm {
    width: 100%;
    max-width: 672px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-md {
    width: 100%;
    max-width: 896px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-lg {
    width: 100%;
    max-width: 1152px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-xl {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.loading-spinner {
    border: 2px solid hsl(var(--color-border));
    border-top-color: hsl(var(--color-primary));
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Text utilities */
.text-primary { color: hsl(var(--color-text-primary)); }
.text-secondary { color: hsl(var(--color-text-secondary)); }
.text-muted { color: hsl(var(--color-text-muted)); }
.text-white { color: white; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.line-through { text-decoration: line-through; }

/* Color utilities */
.text-success { color: hsl(var(--color-success)); }
.text-warning { color: hsl(var(--color-warning)); }
.text-danger { color: hsl(var(--color-danger)); }
.text-info { color: hsl(var(--color-info)); }

/* Flex utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

/* Space-y utilities */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* Spacing utilities */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-3 { margin: 0.75rem; }
.m-4 { margin: 1rem; }
.m-6 { margin: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pt-4 { padding-top: 1rem; }
.pb-4 { padding-bottom: 1rem; }

/* Display utilities */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

/* Position utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

/* Grid utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-7 { grid-template-columns: repeat(7, 1fr); }

/* Width & Height utilities */
.w-3 { width: 0.75rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.w-32 { width: 8rem; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.h-3 { height: 0.75rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }
.h-auto { height: auto; }
.min-h-screen { min-height: 100vh; }
.max-w-xl { max-width: 576px; }
.max-w-2xl { max-width: 672px; }
.max-w-4xl { max-width: 896px; }
.max-w-5xl { max-width: 1024px; }
.max-w-6xl { max-width: 1152px; }
.max-w-full { max-width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Border utilities */
.border { border: 1px solid hsl(var(--color-border)); }
.border-t { border-top: 1px solid hsl(var(--color-border)); }
.border-b { border-bottom: 1px solid hsl(var(--color-border)); }
.border-y { border-top: 1px solid hsl(var(--color-border)); border-bottom: 1px solid hsl(var(--color-border)); }
.border-2 { border-width: 2px; }
.border-border { border-color: hsl(var(--color-border)); }
.border-primary { border-color: hsl(var(--color-primary)); }
.border-success { border-color: hsl(var(--color-success)); }
.border-danger { border-color: hsl(var(--color-danger)); }
.rounded { border-radius: var(--border-radius); }
.rounded-md { border-radius: var(--border-radius-md); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.rounded-xl { border-radius: var(--border-radius-xl); }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Background utilities */
.bg-background { background-color: hsl(var(--color-background)); }
.bg-surface { background-color: hsl(var(--color-surface)); }
.bg-surface-elevated { background-color: hsl(var(--color-surface-elevated)); }
.bg-primary { background-color: hsl(var(--color-primary)); }
.bg-secondary { background-color: hsl(var(--color-secondary)); }
.bg-success { background-color: hsl(var(--color-success)); }
.bg-warning { background-color: hsl(var(--color-warning)); }
.bg-danger { background-color: hsl(var(--color-danger)); }
.bg-white { background-color: white; }
.bg-opacity-10 { background-color: hsl(var(--color-danger) / 0.1); }

/* Shadow utilities */
.shadow-none { box-shadow: none; }
.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* Overflow utilities */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Transition utilities */
.transition { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    /* Header responsive */
    .header {
        padding: 0.75rem 0;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .header-logo {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
    
    .header-logo > div {
        width: 44px !important;
        height: 44px !important;
    }
    
    .header-logo > div i {
        width: 24px !important;
        height: 24px !important;
    }
    
    .header-logo span {
        font-size: 1.25rem !important;
    }
    
    .header-nav {
        gap: 0.5rem;
        font-size: 0.875rem;
    }
    
    .header-link {
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
    }
    
    .lang-switcher {
        padding: 0.375rem 0.625rem !important;
        font-size: 0.8125rem !important;
    }
    
    #themeToggle {
        padding: 0.375rem !important;
    }
    
    #themeToggle i {
        width: 18px !important;
        height: 18px !important;
    }
}

/* للشاشات الصغيرة جداً (الهواتف الصغيرة) */
@media (max-width: 480px) {
    .header-content {
        padding: 0 0.5rem;
    }
    
    .header-logo {
        gap: 0.4rem;
    }
    
    .header-logo span {
        font-size: 1.125rem !important;
    }
    
    .header-logo > div {
        width: 40px !important;
        height: 40px !important;
    }
    
    .header-logo > div i {
        width: 22px !important;
        height: 22px !important;
    }
    
    .header-nav {
        gap: 0.375rem;
    }
    
    .header-link {
        font-size: 0.8125rem;
        padding: 0.25rem;
    }
    
    .lang-switcher {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.75rem !important;
    }
    
    .lang-switcher i {
        width: 14px !important;
        height: 14px !important;
    }
    
    #themeToggle {
        padding: 0.3rem !important;
    }
    
    #themeToggle i {
        width: 16px !important;
        height: 16px !important;
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ==========================================================================
   ADVERTISEMENT SLOTS
   ========================================================================== */

/* Tool page layout with sidebar */
.tool-layout {
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    .tool-layout {
        grid-template-columns: 1fr 300px;
    }
}

/* Hide sidebar on small screens */
.tool-sidebar {
    display: none !important;
}

@media (min-width: 1024px) {
    .tool-sidebar {
        display: flex !important;
    }
}

/* إعلان الفوتر - مسافات قبل وبعد، عرض كامل */
.advertisement-slot[data-position="footer"] {
    margin: 3rem 0;
    width: 100%;
    text-align: center;
}

/* إعلانات القائمة الجانبية - توسيط كامل */
.advertisement-slot[data-position^="sidebar"] {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
}

/* إعلانات أخرى - عرض كامل */
.advertisement-slot[data-position="header"],
.advertisement-slot[data-position="content_top"],
.advertisement-slot[data-position="content_bottom"] {
    margin: 2rem 0;
    width: 100%;
    text-align: center;
}

/* Shortcode ads */
.advertisement-shortcode {
    margin: 1.5rem 0;
    width: 100%;
    text-align: center;
}

/* ==========================================================================
   SOCIAL SHARE BUTTONS
   ========================================================================== */

.share-buttons-container {
    background: hsl(var(--color-surface));
    border: 1px solid hsl(var(--color-border));
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.share-buttons-container:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.share-buttons-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.share-text {
    color: hsl(var(--color-text-secondary));
    font-weight: 600;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--border-radius-md);
    border: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
    text-decoration: none;
    background: hsl(var(--color-surface-elevated));
    color: hsl(var(--color-text-secondary));
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.share-btn i,
.share-btn svg {
    width: 20px;
    height: 20px;
}

/* Facebook */
.share-btn-facebook {
    background: hsl(221, 44%, 41%);
    color: white;
}

.share-btn-facebook:hover {
    background: hsl(221, 44%, 35%);
    border-color: hsl(221, 44%, 41%);
}

/* Twitter */
.share-btn-twitter {
    background: hsl(203, 89%, 53%);
    color: white;
}

.share-btn-twitter:hover {
    background: hsl(203, 89%, 45%);
    border-color: hsl(203, 89%, 53%);
}

/* LinkedIn */
.share-btn-linkedin {
    background: hsl(201, 100%, 35%);
    color: white;
}

.share-btn-linkedin:hover {
    background: hsl(201, 100%, 30%);
    border-color: hsl(201, 100%, 35%);
}

/* WhatsApp */
.share-btn-whatsapp {
    background: hsl(142, 70%, 49%);
    color: white;
}

.share-btn-whatsapp:hover {
    background: hsl(142, 70%, 42%);
    border-color: hsl(142, 70%, 49%);
}

/* Telegram */
.share-btn-telegram {
    background: hsl(200, 100%, 42%);
    color: white;
}

.share-btn-telegram:hover {
    background: hsl(200, 100%, 36%);
    border-color: hsl(200, 100%, 42%);
}

/* Copy Link */
.share-btn-copy {
    background: hsl(var(--color-primary));
    color: white;
}

.share-btn-copy:hover {
    background: hsl(var(--color-primary-dark));
    border-color: hsl(var(--color-primary));
}

/* Toast Notification */
.share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: hsl(var(--color-success));
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 600;
    z-index: 9999;
    transition: transform 0.3s ease-in-out, opacity 0.3s;
    opacity: 0;
}

.share-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.share-toast i,
.share-toast svg {
    width: 20px;
    height: 20px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .share-buttons-wrapper {
        flex-direction: column;
    }
    
    .share-buttons {
        width: 100%;
    }
    
    .share-btn {
        width: 40px;
        height: 40px;
    }
}