/* ========================================
   Youth Development Association - Design System
   Bilingual Theme (Arabic RTL / English LTR)
   ======================================== */

/* ===== COLOR VARIABLES ===== */
:root {
    /* Primary Colors - Olive Green (Growth, Sustainability, Palestine) */
    --yda-primary: #6CB44D;
    --yda-primary-light: #7EC45E;
    --yda-primary-dark: #5A9D3D;
    --yda-primary-hover: #7EC45E;
    
    /* Secondary Colors - Golden Yellow (Hope, Youth Energy, Optimism) */
    --yda-secondary: #F5C300;
    --yda-secondary-light: #FFD633;
    --yda-secondary-dark: #D4A700;
    --yda-secondary-hover: #FFD633;
    
    /* Text Colors - Deep Gray (Professionalism) */
    --yda-text-primary: #222222;
    --yda-text-secondary: #555555;
    --yda-text-light: #777777;
    --yda-text-white: #FFFFFF;
    
    /* Accent Colors - Warm Beige/Brown (Warmth, Human Touch) */
    --yda-accent: #A67C52;
    --yda-accent-light: #C09670;
    --yda-accent-dark: #8A6442;
    
    /* Background Colors */
    --yda-bg-white: #FFFFFF;
    --yda-bg-light: #F2F2F2;
    --yda-bg-lighter: #F8F9FA;
    --yda-bg-cream: #FFF9F0;
    
    /* Gradients - Olive to Golden */
    --yda-gradient-primary: linear-gradient(135deg, #6CB44D 0%, #7EC45E 100%);
    --yda-gradient-secondary: linear-gradient(135deg, #F5C300 0%, #FFD633 100%);
    --yda-gradient-hero: linear-gradient(135deg, rgba(108, 180, 77, 0.95) 0%, rgba(245, 195, 0, 0.85) 100%);
    --yda-gradient-overlay: linear-gradient(to right, rgba(108, 180, 77, 0.9), rgba(245, 195, 0, 0.8));
    --yda-gradient-subtle: linear-gradient(to bottom, rgba(108, 180, 77, 0.05), rgba(245, 195, 0, 0.05));
    
    /* Shadows */
    --yda-shadow-sm: 0 2px 8px rgba(108, 180, 77, 0.1);
    --yda-shadow-md: 0 4px 16px rgba(108, 180, 77, 0.15);
    --yda-shadow-lg: 0 8px 24px rgba(108, 180, 77, 0.2);
    --yda-shadow-xl: 0 12px 32px rgba(108, 180, 77, 0.25);
    
    /* Border Radius */
    --yda-radius-sm: 8px;
    --yda-radius-md: 12px;
    --yda-radius-lg: 16px;
    --yda-radius-xl: 24px;
    --yda-radius-full: 50%;
    
    /* Transitions */
    --yda-transition-fast: all 0.2s ease;
    --yda-transition-normal: all 0.3s ease;
    --yda-transition-slow: all 0.5s ease;
    
    /* Spacing */
    --yda-spacing-xs: 0.5rem;
    --yda-spacing-sm: 1rem;
    --yda-spacing-md: 1.5rem;
    --yda-spacing-lg: 2rem;
    --yda-spacing-xl: 3rem;
    --yda-spacing-xxl: 4rem;
}

/* ===== DARK MODE PALETTE ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --yda-primary: #7EC45E;
        --yda-primary-light: #8FD46F;
        --yda-primary-dark: #6CB44D;
        
        --yda-secondary: #FFD633;
        --yda-secondary-light: #FFE066;
        --yda-secondary-dark: #F5C300;
        
        --yda-text-primary: #E8E8E8;
        --yda-text-secondary: #B8B8B8;
        --yda-text-light: #999999;
        
        --yda-bg-white: #1A1A1A;
        --yda-bg-light: #2A2A2A;
        --yda-bg-lighter: #333333;
        --yda-bg-cream: #2C2820;
    }
}

/* ===== TYPOGRAPHY SYSTEM ===== */

/* Arabic Typography (RTL) */
[dir="rtl"] * {
    font-family: 'Cairo', 'Noto Sans Arabic', 'Tajawal', sans-serif !important;
}

[dir="rtl"] body {
    font-size: 16px;
    line-height: 1.8;
    letter-spacing: 0;
}

[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, 
[dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-weight: 700;
    line-height: 1.4;
}

[dir="rtl"] h1 { font-size: 2.5rem; }
[dir="rtl"] h2 { font-size: 2rem; }
[dir="rtl"] h3 { font-size: 1.75rem; }
[dir="rtl"] h4 { font-size: 1.5rem; }
[dir="rtl"] h5 { font-size: 1.25rem; }
[dir="rtl"] h6 { font-size: 1rem; }

/* English Typography (LTR) */
[dir="ltr"] * {
    font-family: 'Poppins', 'Open Sans', 'Roboto', sans-serif !important;
}

[dir="ltr"] body {
    font-size: 16px;
    line-height: 1.7;
    letter-spacing: 0.3px;
}

[dir="ltr"] h1, [dir="ltr"] h2, [dir="ltr"] h3,
[dir="ltr"] h4, [dir="ltr"] h5, [dir="ltr"] h6 {
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

[dir="ltr"] h1 { font-size: 2.5rem; }
[dir="ltr"] h2 { font-size: 2rem; }
[dir="ltr"] h3 { font-size: 1.75rem; }
[dir="ltr"] h4 { font-size: 1.5rem; }
[dir="ltr"] h5 { font-size: 1.25rem; }
[dir="ltr"] h6 { font-size: 1rem; }

/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    color: var(--yda-text-primary);
    background-color: var(--yda-bg-white);
    overflow-x: hidden;
}

/* Text Colors */
.text-primary-yda { color: var(--yda-primary) !important; }
.text-secondary-yda { color: var(--yda-secondary) !important; }
.text-accent-yda { color: var(--yda-accent) !important; }

/* Background Colors */
.bg-primary-yda { background-color: var(--yda-primary) !important; }
.bg-secondary-yda { background-color: var(--yda-secondary) !important; }
.bg-accent-yda { background-color: var(--yda-accent) !important; }
.bg-light-yda { background-color: var(--yda-bg-light) !important; }
.bg-cream-yda { background-color: var(--yda-bg-cream) !important; }

/* Gradient Backgrounds */
.bg-gradient-primary-yda { background: var(--yda-gradient-primary) !important; }
.bg-gradient-secondary-yda { background: var(--yda-gradient-secondary) !important; }
.bg-gradient-hero-yda { background: var(--yda-gradient-hero) !important; }

/* ===== BUTTONS ===== */
.btn-yda-primary {
    background: var(--yda-gradient-primary);
    color: var(--yda-text-white);
    border: none;
    border-radius: var(--yda-radius-xl);
    padding: 0.875rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--yda-transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--yda-shadow-sm);
}

.btn-yda-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn-yda-primary:hover::before {
    left: 100%;
}

.btn-yda-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--yda-shadow-lg);
    color: var(--yda-text-white);
}

.btn-yda-primary:active {
    transform: translateY(-1px);
}

/* Secondary Button - Golden Yellow */
.btn-yda-secondary {
    background: var(--yda-gradient-secondary);
    color: var(--yda-text-primary);
    border: none;
    border-radius: var(--yda-radius-xl);
    padding: 0.875rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--yda-transition-normal);
    box-shadow: var(--yda-shadow-sm);
}

.btn-yda-secondary:hover {
    transform: translateY(-3px);
    box-shadow: var(--yda-shadow-lg);
    background: var(--yda-secondary-hover);
    color: var(--yda-text-primary);
}

/* Outline Buttons */
.btn-yda-outline-primary {
    background: transparent;
    color: var(--yda-primary);
    border: 2px solid var(--yda-primary);
    border-radius: var(--yda-radius-xl);
    padding: 0.875rem 2rem;
    font-weight: 600;
    transition: var(--yda-transition-normal);
}

.btn-yda-outline-primary:hover {
    background: var(--yda-gradient-primary);
    color: var(--yda-text-white);
    border-color: var(--yda-primary);
    transform: translateY(-3px);
    box-shadow: var(--yda-shadow-md);
}

.btn-yda-outline-secondary {
    background: transparent;
    color: var(--yda-secondary);
    border: 2px solid var(--yda-secondary);
    border-radius: var(--yda-radius-xl);
    padding: 0.875rem 2rem;
    font-weight: 600;
    transition: var(--yda-transition-normal);
}

.btn-yda-outline-secondary:hover {
    background: var(--yda-gradient-secondary);
    color: var(--yda-text-primary);
    border-color: var(--yda-secondary);
    transform: translateY(-3px);
    box-shadow: var(--yda-shadow-md);
}

/* Small Buttons */
.btn-yda-sm {
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
}

/* Large Buttons */
.btn-yda-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* ===== CARDS ===== */
.card-yda {
    border: none;
    border-radius: var(--yda-radius-lg);
    box-shadow: var(--yda-shadow-sm);
    transition: var(--yda-transition-normal);
    overflow: hidden;
    background: var(--yda-bg-white);
}

.card-yda:hover {
    transform: translateY(-8px);
    box-shadow: var(--yda-shadow-xl);
}

.card-yda .card-header {
    background: var(--yda-gradient-primary);
    color: var(--yda-text-white);
    border: none;
    padding: 1.5rem;
    font-weight: 600;
}

.card-yda .card-body {
    padding: 2rem;
}

.card-yda .card-img-top {
    transition: var(--yda-transition-slow);
    height: 220px;
    object-fit: cover;
}

.card-yda:hover .card-img-top {
    transform: scale(1.08);
}

/* Card with Accent Border */
.card-yda-accent {
    border-top: 4px solid var(--yda-secondary);
}

.card-yda-accent:hover {
    border-top-color: var(--yda-primary);
}

/* ===== HERO SECTION ===== */
.hero-yda {
    background: var(--yda-gradient-hero), 
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><defs><pattern id="olive-pattern" x="0" y="0" width="40" height="40" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1.5" fill="rgba(255,255,255,0.15)"/><ellipse cx="10" cy="10" rx="3" ry="1.5" fill="rgba(255,255,255,0.1)" transform="rotate(45 10 10)"/></pattern></defs><rect width="1200" height="600" fill="url(%23olive-pattern)"/></svg>');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 75vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-yda::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--yda-gradient-overlay);
    opacity: 0.95;
}

/* Olive Leaf Pattern Overlay */
.hero-yda::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><ellipse cx="100" cy="100" rx="80" ry="30" fill="rgba(245,195,0,0.1)" transform="rotate(45 100 100)"/><ellipse cx="100" cy="100" rx="60" ry="25" fill="rgba(245,195,0,0.15)" transform="rotate(45 100 100)"/></svg>');
    animation: float-olive 20s infinite ease-in-out;
    opacity: 0.3;
}

@keyframes float-olive {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-30px, -30px) rotate(180deg); }
}

.hero-yda .hero-content {
    position: relative;
    z-index: 2;
    color: var(--yda-text-white);
}

.hero-yda h1 {
    font-weight: 700;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
}

.hero-yda p {
    font-size: 1.25rem;
    font-weight: 400;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
}

/* ===== SECTION TITLES ===== */
.section-title-yda {
    position: relative;
    display: inline-block;
    font-weight: 700;
    color: var(--yda-primary);
    margin-bottom: 3rem;
}

.section-title-yda::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--yda-gradient-secondary);
    border-radius: 2px;
}

[dir="rtl"] .section-title-yda::after {
    right: 0;
    left: auto;
}

.text-center .section-title-yda::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Subtitle */
.section-subtitle-yda {
    color: var(--yda-text-secondary);
    font-size: 1.125rem;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
}

/* ===== STATISTICS SECTION ===== */
.statistics-yda {
    background: var(--yda-gradient-primary);
    color: var(--yda-text-white);
    position: relative;
    overflow: hidden;
    padding: 4rem 0;
}

.statistics-yda::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="25" cy="25" r="2" fill="rgba(245,195,0,0.2)"/><circle cx="75" cy="75" r="1.5" fill="rgba(245,195,0,0.15)"/><circle cx="50" cy="10" r="1" fill="rgba(245,195,0,0.1)"/></svg>');
    animation: float-pattern 30s infinite linear;
    opacity: 0.4;
}

@keyframes float-pattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 100px); }
}

.stat-item-yda {
    text-align: center;
    padding: 2rem 1rem;
    transition: var(--yda-transition-normal);
    position: relative;
    z-index: 1;
}

.stat-item-yda:hover {
    transform: translateY(-12px);
}

.stat-icon-yda {
    font-size: 3rem;
    color: var(--yda-secondary);
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.stat-number-yda {
    font-size: 3.5rem;
    font-weight: 700;
    display: block;
    color: var(--yda-text-white);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1;
}

.stat-label-yda {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--yda-secondary-light);
    margin-top: 0.75rem;
}

/* ===== FOOTER ===== */
.footer-yda {
    background: linear-gradient(135deg, var(--yda-primary-dark), var(--yda-primary));
    color: var(--yda-text-white);
    position: relative;
}

.footer-yda::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--yda-gradient-secondary);
}

.footer-yda h5 {
    color: var(--yda-secondary);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer-yda a {
    color: rgba(255, 255, 255, 0.85);
    transition: var(--yda-transition-fast);
}

.footer-yda a:hover {
    color: var(--yda-secondary);
    padding-left: 8px;
}

[dir="rtl"] .footer-yda a:hover {
    padding-left: 0;
    padding-right: 8px;
}

/* ===== CULTURAL PATTERNS ===== */

/* Olive Branch Decoration */
.olive-decoration {
    position: relative;
}

.olive-decoration::before {
    content: '🌿';
    position: absolute;
    font-size: 2rem;
    opacity: 0.2;
    top: -1rem;
    left: -2rem;
}

[dir="rtl"] .olive-decoration::before {
    left: auto;
    right: -2rem;
}

/* Sun Ray Pattern */
.sun-pattern {
    background: radial-gradient(circle at center, 
                rgba(245, 195, 0, 0.1) 0%, 
                transparent 70%);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 991px) {
    [dir="rtl"] h1 { font-size: 2rem; }
    [dir="rtl"] h2 { font-size: 1.75rem; }
    [dir="ltr"] h1 { font-size: 2rem; }
    [dir="ltr"] h2 { font-size: 1.75rem; }
    
    .hero-yda {
        min-height: 60vh;
        background-attachment: scroll;
    }
    
    .stat-number-yda {
        font-size: 2.5rem;
    }
    
    .stat-icon-yda {
        font-size: 2.5rem;
    }
}

@media (max-width: 767px) {
    [dir="rtl"] h1 { font-size: 1.75rem; }
    [dir="rtl"] h2 { font-size: 1.5rem; }
    [dir="ltr"] h1 { font-size: 1.75rem; }
    [dir="ltr"] h2 { font-size: 1.5rem; }
    
    .hero-yda {
        min-height: 50vh;
    }
    
    .btn-yda-primary,
    .btn-yda-secondary,
    .btn-yda-outline-primary,
    .btn-yda-outline-secondary {
        padding: 0.75rem 1.5rem;
        font-size: 0.9375rem;
    }
    
    .stat-number-yda {
        font-size: 2rem;
    }
    
    .section-title-yda {
        font-size: 1.5rem;
    }
}

@media (max-width: 575px) {
    .card-yda .card-body {
        padding: 1.5rem;
    }
    
    .stat-item-yda {
        padding: 1.5rem 0.5rem;
    }
}

/* ===== ACCESSIBILITY ===== */
.btn-yda-primary:focus,
.btn-yda-secondary:focus,
.btn-yda-outline-primary:focus,
.btn-yda-outline-secondary:focus {
    outline: 3px solid var(--yda-secondary);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --yda-primary: #5A9D3D;
        --yda-secondary: #D4A700;
        --yda-text-primary: #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
