/* ===================================
   🎨 نظام التصميم الحديث والأنيق
   منصة تعليمية ذكية - حائل 🇸🇦
   =================================== */

:root {
    /* 🎨 الألوان الأساسية */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #8b9aff;
    --secondary: #764ba2;
    --accent: #f093fb;
    --accent-light: #f5c6ff;
    
    /* 🎨 ألوان السعودية */
    --saudi-green: #006c35;
    --saudi-white: #ffffff;
    --gold-accent: #ffd700;
    
    /* 🌟 ألوان إضافية */
    --success: #48bb78;
    --warning: #fbbf24;
    --danger: #f56565;
    --info: #4299e1;
    
    /* 🌈 التدرجات */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-warm: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-cool: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    --gradient-saudi: linear-gradient(135deg, var(--saudi-green) 0%, #004d2b 100%);
    
    /* 💎 الظلال */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.2);
    --shadow-colored: 0 8px 32px rgba(102, 126, 234, 0.3);
    
    /* 🔄 الزوايا */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
    
    /* 📏 المسافات */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* ⏱️ التوقيتات */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 🔄 Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Tajawal', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gradient-primary);
    background-size: 200% 200%;
    animation: gradient-shift 15s ease infinite;
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
    color: #2d3748;
    line-height: 1.6;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 🌟 تأثيرات الفقاعات الخلفية */
.bg-animation {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float-bubble 20s infinite ease-in-out;
}

@keyframes float-bubble {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* 📱 النافبار الرئيسي */
.navbar-main {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    padding: var(--space-sm) var(--space-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--gold-accent);
    transition: all var(--transition-normal);
}

.navbar-main.scrolled {
    padding: var(--space-xs) var(--space-lg);
    box-shadow: var(--shadow-lg);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary) !important;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.navbar-brand:hover {
    transform: translateY(-2px);
    color: var(--primary-dark) !important;
}

.navbar-brand img {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    border: 3px solid var(--gold-accent);
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(255, 215, 0, 0);
    }
}

/* 🍔 القائمة الجانبية */
.side-menu-button {
    position: fixed;
    top: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--gradient-warm);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1050;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    animation: bounce-subtle 2s infinite;
}

@keyframes bounce-subtle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.side-menu-button:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: var(--shadow-colored);
    animation: none;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100vh;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
    backdrop-filter: blur(20px);
    transition: right var(--transition-slow) cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1040;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    padding: var(--space-xl);
}

.side-menu.open {
    right: 0;
}

.side-menu .close-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: absolute;
    top: var(--space-lg);
    left: var(--space-lg);
}

.side-menu .close-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.side-menu ul {
    list-style: none;
    margin-top: var(--space-2xl);
}

.side-menu ul li {
    margin-bottom: var(--space-sm);
}

.side-menu ul li a {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: white;
    text-decoration: none;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    font-size: 1.1rem;
    font-weight: 600;
}

.side-menu ul li a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-10px);
    box-shadow: var(--shadow-sm);
}

.side-menu ul li a i {
    font-size: 1.3rem;
    color: var(--gold-accent);
}

/* 🎯 الهيدر الرئيسي */
.main-header {
    background: var(--gradient-saudi);
    color: white;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-2xl);
}

.main-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.03) 2px,
        rgba(255, 255, 255, 0.03) 4px
    );
    animation: pattern-shift 20s linear infinite;
}

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

.main-header h1 {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    animation: fade-in-up 1s ease;
}

.main-header p {
    font-size: 1.5rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    animation: fade-in-up 1s ease 0.2s both;
}

.saudi-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin: 0 auto var(--space-lg);
    filter: drop-shadow(0 8px 16px rgba(255, 215, 0, 0.5));
    animation: float 6s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* 🎴 البطاقات */
.challenge-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    animation: fade-in-up 0.6s ease both;
}

.challenge-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left var(--transition-slow);
}

.challenge-card:hover::before {
    left: 100%;
}

.challenge-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.challenge-card img {
    width: 100%;
    max-width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: var(--space-md);
    transition: all var(--transition-normal);
    filter: drop-shadow(var(--shadow-sm));
}

.challenge-card:hover img {
    transform: rotate(5deg) scale(1.1);
}

.challenge-card h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
    color: var(--primary-dark);
    position: relative;
    display: inline-block;
}

.challenge-card h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-warm);
    transition: width var(--transition-normal);
}

.challenge-card:hover h2::after {
    width: 100%;
}

/* 🎨 الأيقونات الدائرية */
.card-icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    color: white;
    font-size: 2.5rem;
    margin: 0 auto var(--space-md);
    box-shadow: var(--shadow-colored);
    transition: all var(--transition-normal);
}

.challenge-card:hover .card-icon {
    transform: rotate(15deg) scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* 🔘 الأزرار */
.btn-primary,
.action-btn,
.login-btn,
.start-student-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
}

.btn-primary::before,
.action-btn::before,
.login-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before,
.action-btn:hover::before,
.login-btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover,
.action-btn:hover,
.login-btn:hover,
.start-student-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: white;
}

/* 📊 قسم الإحصاءات */
.stats-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    margin: var(--space-2xl) 0;
    box-shadow: var(--shadow-lg);
}

.stat-item {
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    color: white;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate-glow 10s linear infinite;
}

@keyframes rotate-glow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.stat-item:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: var(--shadow-colored);
}

.stat-icon {
    font-size: 3rem;
    color: var(--gold-accent);
    margin-bottom: var(--space-md);
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: var(--space-sm);
}

/* 📝 حقول الإدخال */
.form-control,
.form-select {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

/* 🎯 حاوية الجنس */
.gender-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    margin: var(--space-2xl) auto;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    text-align: center;
    border: 2px solid var(--gold-accent);
}

.gender-container h3 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: var(--space-lg);
}

/* 🏷️ المعلومات */
.info-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    margin: var(--space-2xl) 0;
    box-shadow: var(--shadow-lg);
    border: 2px solid transparent;
    transition: all var(--transition-normal);
}

.info-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-5px);
}

.info-card h2 {
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: var(--space-lg);
    position: relative;
    padding-bottom: var(--space-sm);
}

.info-card h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100px;
    height: 4px;
    background: var(--gradient-warm);
    border-radius: var(--radius-full);
}

/* 🌟 النص المزخرف */
.arabic-decor {
    font-size: 1.5rem;
    line-height: 2;
    text-align: center;
    padding: var(--space-xl);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-radius: var(--radius-lg);
    border-right: 4px solid var(--gold-accent);
    position: relative;
}

.arabic-decor::before,
.arabic-decor::after {
    content: '"';
    font-size: 4rem;
    color: var(--gold-accent);
    opacity: 0.3;
    position: absolute;
}

.arabic-decor::before {
    top: 10px;
    right: 20px;
}

.arabic-decor::after {
    bottom: 10px;
    left: 20px;
}

/* 📸 الصور */
.leader-photo {
    width: 100%;
    max-width: 250px;
    border-radius: var(--radius-full);
    border: 5px solid var(--gold-accent);
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-normal);
    display: block;
    margin: 0 auto;
}

.leader-photo:hover {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 0 20px 60px rgba(255, 215, 0, 0.4);
}

/* 🎉 الكونفيتي */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
    animation: confetti-fall 5s linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* 🦶 الفوتر */
footer {
    background: var(--gradient-saudi);
    color: white;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
    margin-top: var(--space-2xl);
}

footer h5 {
    color: var(--gold-accent);
    margin-bottom: var(--space-lg);
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--transition-fast);
}

footer a:hover {
    color: var(--gold-accent);
}

/* 🎭 تأثيرات الظهور */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fade-in-up 0.8s ease both;
}

/* 📱 التجاوب */
@media (max-width: 768px) {
    :root {
        font-size: 14px;
    }
    
    .main-header h1 {
        font-size: 2rem;
    }
    
    .main-header p {
        font-size: 1.2rem;
    }
    
    .saudi-logo {
        width: 80px;
        height: 80px;
    }
    
    .challenge-card {
        padding: var(--space-lg);
    }
    
    .challenge-card h2 {
        font-size: 1.2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .side-menu {
        width: 100%;
        max-width: 300px;
    }
    
    .side-menu-button {
        top: 80px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .main-header h1 {
        font-size: 1.5rem;
    }
    
    .challenge-card img {
        max-width: 100px;
        height: 100px;
    }
    
    .btn-primary,
    .action-btn {
        padding: var(--space-sm) var(--space-lg);
        font-size: 1rem;
    }
}

/* 🎨 فئات مساعدة */
.text-center {
    text-align: center;
}

.mt-2 { margin-top: var(--space-xs); }
.mt-3 { margin-top: var(--space-sm); }
.mt-4 { margin-top: var(--space-md); }
.mt-5 { margin-top: var(--space-lg); }

.mb-2 { margin-bottom: var(--space-xs); }
.mb-3 { margin-bottom: var(--space-sm); }
.mb-4 { margin-bottom: var(--space-md); }
.mb-5 { margin-bottom: var(--space-lg); }

.p-2 { padding: var(--space-xs); }
.p-3 { padding: var(--space-sm); }
.p-4 { padding: var(--space-md); }
.p-5 { padding: var(--space-lg); }

/* ✨ تأثيرات إضافية */
.hero-glow {
    box-shadow: 0 0 50px rgba(102, 126, 234, 0.5);
}

.success-animation {
    animation: success-bounce 0.6s ease;
}

@keyframes success-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 🌈 تدرجات مخصصة */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

