/* ===== VARIABLES ===== */
:root {
    --primary-color: #4a81f9;
    --primary-dark: #284aba;
    --primary-light: #dbeafe;
    --secondary-color: #f5f10b;
    --secondary-light: #fef3c7;
    --secondary-red: #ec0000;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --border-color: var(--gray-200);
    
    --font-primary: "yekan", "Vazirmatn", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --font-fallback: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-3x05: 4.5rem;
    --section-padding: 6.25rem 5%;
    --container-max-width: 1200px;
    --header-height: 5rem;
    --header-height-scrolled: 4.375rem;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 20px 40px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.2);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 50%;
    
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    
    --z-under: -1;
    --z-base: 1;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-modal: 1030;
    --z-popover: 1040;
    --z-tooltip: 1050;
    --z-toast: 1060;
}

/* ===== FONTS ===== */
@font-face {
    font-family: "yekan";
    src: url('../yekan/woff/iranyekanwebextrablackfanum.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "yekan";
    src: url('../yekan/woff/iranyekanwebboldfanum.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "yekan";
    src: url('../yekan/woff/iranyekanwebmediumfanum.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "yekan";
    src: url('../yekan/woff/iranyekanwebregularfanum.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ===== RESET & BASE STYLES ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary), var(--font-fallback);
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--white);
    direction: rtl;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--gray-800);
    letter-spacing: -0.02em;
}

h1 { 
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    line-height: 1.1;
}
h2 { 
    font-size: clamp(2rem, 4vw, 2.5rem);
}
h3 { 
    font-size: clamp(1.5rem, 3vw, 1.875rem);
}
h4 { 
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}
h5 { 
    font-size: clamp(1.125rem, 2vw, 1.25rem);
}
h6 { 
    font-size: clamp(1rem, 1.5vw, 1.125rem);
}

p {
    margin-bottom: var(--space-md);
    color: var(--gray-600);
    line-height: 1.7;
    max-width: 65ch;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
}

a:hover,
a:focus {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== LAYOUT & UTILITY CLASSES ===== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    width: 100%;
}

.container--fluid {
    max-width: 100%;
}

.section-padding {
    padding: var(--section-padding);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    z-index: var(--z-tooltip);
    transition: var(--transition-fast);
}

.skip-link:focus {
    top: 6px;
}

/* ===== FOCUS STYLES ===== */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
    outline: none;
}

/* ===== SELECTION ===== */
::selection {
    background-color: var(--primary-color);
    color: var(--white);
    text-shadow: none;
}

::-moz-selection {
    background-color: var(--primary-color);
    color: var(--white);
    text-shadow: none;
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a,
    a:visited {
        text-decoration: underline;
    }
    
    .no-print {
        display: none !important;
    }
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    .section-padding {
        padding: 4rem 5%;
    }
    
    h1 { 
        font-size: clamp(2rem, 6vw, 2.5rem);
    }
    h2 { 
        font-size: clamp(1.75rem, 5vw, 2rem);
    }
    h3 { 
        font-size: clamp(1.5rem, 4vw, 1.75rem);
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 var(--space-sm);
    }
    
    .section-padding {
        padding: 3rem 4%;
    }
    
    h1 { 
        font-size: clamp(1.75rem, 7vw, 2.25rem);
    }
    h2 { 
        font-size: clamp(1.5rem, 6vw, 1.75rem);
    }
    
    p {
        font-size: 0.9375rem;
        line-height: 1.6;
    }
}

@media (max-width: 375px) {
    :root {
        --space-xs: 0.2rem;
        --space-sm: 0.4rem;
        --space-md: 0.8rem;
        --space-lg: 1.2rem;
        --space-xl: 1.6rem;
        --space-2xl: 2.4rem;
    }
    
    .container {
        padding: 0 var(--space-xs);
    }
    
    h1 { 
        font-size: clamp(1.5rem, 8vw, 2rem);
    }
    
    p {
        font-size: 0.875rem;
    }
}