/* ==========================================
   1. المتغيرات والتنسيقات الأساسية (CSS Variables)
   ========================================== */
:root {
    --navy-deep: #081C2D;      /* النيلي العميق للسطح والخلفيات الرئيسية */
    --navy-card: #0D263B;      /* النيلي المتوسط للبطاقات والقوائم */
    --navy-light: #163652;     /* النيلي الفاتح للتفاصيل والحدود */
    --emerald: #1F7A63;        /* الأخضر الزمردي الأساسي */
    --emerald-glow: #289E80;   /* الأخضر الزمردي للتوهج والـ Hover */
    --soft-white: #F5F7FA;     /* الأبيض الناعم للنصوص الرئيسية */
    --cool-gray: #9AA3A8;      /* الرمادي الناعم للنصوص الفرعية */
    --gold-accent: #E6C687;    /* لون ذهبي خفيف للتنبيهات والشارات */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body.dark-theme {
    background-color: var(--navy-deep);
    color: var(--soft-white);
    overflow-x: hidden;
    padding-bottom: 70px; /* مساحة لشريط الموبايل السفلي */
}

@media (min-width: 992px) {
    body.dark-theme {
        padding-bottom: 0;
    }
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================
   2. شاشة الأسئلة التفاعلية (Onboarding Gate)
   ========================================== */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(8, 28, 45, 0.96);
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.onboarding-card {
    background: var(--navy-card);
    border: 1px solid rgba(31, 122, 99, 0.4);
    padding: 35px 25px;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(31, 122, 99, 0.2);
    position: relative;
    animation: popupScale 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 25px;
    overflow: hidden;
}

.progress-fill {
    width: 20%;
    height: 100%;
    background: linear-gradient(90deg, var(--emerald), var(--emerald-glow));
    transition: width 0.4s ease;
}

.quiz-option-btn {
    display: block;
    width: 100%;
    padding: 14px 18px;
    margin: 12px 0;
    background: var(--navy-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--soft-white);
    border-radius: 14px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.quiz-option-btn:active, .quiz-option-btn:hover {
    background: var(--emerald);
    border-color: var(--emerald-glow);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(31, 122, 99, 0.4);
}

/* ==========================================
   3. الأزرار العامة وعناصر التفاعل
   ========================================== */
.btn-emerald, .btn-primary-glow {
    background: linear-gradient(135deg, var(--emerald), #175F4D);
    color: var(--soft-white);
    padding: 12px 26px;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(31, 122, 99, 0.4);
    transition: all 0.3s ease;
}

.btn-emerald i, .btn-primary-glow i, .btn-outline i {
    flex: 0 0 auto;
}

.btn-emerald, .btn-primary-glow, .btn-outline {
    min-width: 0;
    text-align: center;
    line-height: 1.5;
}

.btn-emerald:hover, .btn-primary-glow:hover {
    background: linear-gradient(135deg, var(--emerald-glow), var(--emerald));
    box-shadow: 0 6px 28px rgba(40, 158, 128, 0.7);
    transform: translateY(-3px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--emerald);
    color: var(--soft-white);
    padding: 12px 26px;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: rgba(31, 122, 99, 0.15);
    border-color: var(--emerald-glow);
}

.sound-control-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    background: var(--navy-card);
    border: 1px solid var(--emerald);
    color: var(--emerald-glow);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

.sound-control-btn.hidden { display: none; }

/* ==========================================
   4. الهيدر والتنقل (Desktop Navigation)
   ========================================== */
.main-header {
    background: rgba(8, 28, 45, 0.9);
    backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo img {
    height: 42px;
}

.nav-links {
    display: none;
}

@media (min-width: 992px) {
    .nav-links {
        display: flex;
        gap: 25px;
    }
}

.nav-links a {
    color: var(--cool-gray);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--emerald-glow);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-actions .btn-emerald {
    white-space: nowrap;
}

.lang-btn {
    background: var(--navy-light);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--soft-white);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* ==========================================
   5. البانر الرئيسي (Hero Section)
   ========================================== */
.hero-section {
    position: relative;
    padding: 60px 0 80px 0;
}

.hero-glow {
    position: absolute;
    top: -10%;
    right: 5%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(31, 122, 99, 0.25) 0%, rgba(8, 28, 45, 0) 70%);
    pointer-events: none;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}

@media (min-width: 992px) {
    .hero-content {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

.badge-tag {
    background: rgba(31, 122, 99, 0.15);
    border: 1px solid var(--emerald);
    color: var(--emerald-glow);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 18px;
}

.hero-text h1 {
    font-size: 2.2rem;
    line-height: 1.3;
    margin-bottom: 20px;
}

@media (min-width: 992px) {
    .hero-text h1 { font-size: 3rem; }
}

.hero-text p {
    color: var(--cool-gray);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.hero-image-wrapper {
    position: relative;
}

.image-glass-card {
    background: var(--navy-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    position: relative;
}

.hero-img {
    width: 100%;
    border-radius: 12px;
    display: block;
    object-fit: cover;
}

.floating-badge {
    position: absolute;
    background: rgba(13, 38, 59, 0.9);
    border: 1px solid var(--emerald);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    line-height: 1.4;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.floating-badge i { color: var(--emerald-glow); font-size: 1.2rem; }
.floating-badge span { min-width: 0; }
.badge-1 { top: -15px; right: 10px; }
.badge-2 { bottom: -15px; left: 10px; }

/* ==========================================
   6. الخريطة التفاعلية (Interactive SVG Map)
   ========================================== */
.destinations-section {
    padding: 80px 0;
    background: var(--navy-card);
    position: relative;
}

.section-header, .section-title-center {
    margin-bottom: 40px;
    text-align: center;
}

.section-header h2, .section-title-center h2 { font-size: 2rem; margin-bottom: 10px; }
.section-header p, .section-title-center p { color: var(--cool-gray); }

.map-container {
    position: relative;
    background: var(--navy-deep);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 20px;
    overflow: hidden;
}

.world-svg-map {
    width: 100%;
    height: auto;
    min-height: 300px;
}

.map-bg-path {
    fill: var(--navy-light);
    opacity: 0.5;
}

.map-pin {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.map-pin:hover {
    transform: scale(1.3);
}

.active-pin .pin-dot { fill: var(--emerald-glow); }
.active-pin .pulse-ring {
    fill: none;
    stroke: var(--emerald);
    stroke-width: 2;
    animation: pulse 2s infinite;
}

.pin-label {
    fill: var(--soft-white);
    font-size: 12px;
    font-weight: bold;
}

.pin-dot-disabled { fill: var(--cool-gray); opacity: 0.4; }
.pin-label-disabled { fill: var(--cool-gray); font-size: 10px; opacity: 0.5; }

.country-info-card {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(8, 28, 45, 0.95);
    border: 1px solid var(--emerald);
    backdrop-filter: blur(15px);
    padding: 20px;
    border-radius: 16px;
    max-width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    z-index: 10;
    animation: fadeIn 0.4s ease;
}

.country-info-card.hidden { display: none; }

.close-card {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    color: var(--cool-gray);
    font-size: 1.4rem;
    cursor: pointer;
}

.country-info-card h3 { color: var(--emerald-glow); margin-bottom: 8px; }
.country-info-card p { font-size: 0.9rem; color: var(--cool-gray); margin-bottom: 12px; }
.country-info-card ul { list-style: none; margin-bottom: 15px; }
.country-info-card ul li { font-size: 0.85rem; margin: 6px 0; display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.country-info-card ul li i { color: var(--emerald); }

/* ==========================================
   7. مسار الطالب الآمن (Roadmap Timeline)
   ========================================== */
.roadmap-section {
    padding: 80px 0;
}

.timeline-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 50px;
    position: relative;
}

@media (min-width: 768px) {
    .timeline-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .timeline-wrapper {
        grid-template-columns: repeat(4, 1fr);
    }
}

.timeline-line {
    position: relative;
    padding-right: 30px; 
    border-right: 3px solid var(--emerald); 
    margin-right: 20px;
}

.step-content {
    background: var(--navy-card);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.timeline-step {
    background: var(--navy-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px 20px;
    border-radius: 18px;
    position: relative;
    transition: all 0.3s ease;
}

.timeline-step:hover {
    border-color: var(--emerald);
    transform: translateY(-5px);
}

.step-icon {
    width: 50px;
    height: 50px;
    background: rgba(31, 122, 99, 0.15);
    color: var(--emerald-glow);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.step-num {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.5rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.05);
}

.timeline-step h3 { font-size: 1.2rem; margin-bottom: 10px; }
.timeline-step p { color: var(--cool-gray); font-size: 0.95rem; line-height: 1.6; }

/* ==========================================
   8. شركاء النجاح (Success Partners)
   ========================================== */
.partners-section {
    padding: 60px 0;
    background: var(--navy-card);
    text-align: center;
}

.partners-slider-track {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.partner-card {
    background: var(--navy-deep);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 28px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    color: var(--soft-white);
    transition: transform 0.3s ease;
}

.partner-card:hover {
    transform: scale(1.05);
    border-color: var(--emerald);
}

.partner-icon { color: var(--emerald-glow); font-size: 1.2rem; }

/* ==========================================
   9. الفوتر (Footer)
   ========================================== */
.main-footer {
    background: #040F18;
    padding: 60px 0 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
    }
}

.footer-logo { height: 40px; margin-bottom: 15px; }
.footer-about p { color: var(--cool-gray); line-height: 1.6; max-width: 350px; }

.footer-links h4, .footer-contact h4 { margin-bottom: 20px; color: var(--emerald-glow); }
.footer-links ul { list-style: none; }
.footer-links ul li { margin-bottom: 10px; }
.footer-links ul li a { color: var(--cool-gray); text-decoration: none; transition: color 0.3s; }
.footer-links ul li a:hover { color: var(--soft-white); }

.footer-contact p { color: var(--cool-gray); margin-bottom: 10px; display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; }
.footer-contact p i { flex: 0 0 1.1rem; text-align: center; margin-top: 0.2rem; }
.footer-bottom { text-align: center; border-top: 1px solid rgba(255, 255, 255, 0.05); padding-top: 20px; color: var(--cool-gray); font-size: 0.9rem; }

/* ==========================================
   10. شريط التنقل السفلي للموبايل (Mobile Bottom Nav)
   ========================================== */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: rgba(13, 38, 59, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    z-index: 999;
}

@media (min-width: 992px) {
    .mobile-bottom-nav { display: none; }
}

.nav-item {
    color: var(--cool-gray);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    line-height: 1.2;
}

.nav-item i { font-size: 1.2rem; }
.nav-item span { max-width: 100%; overflow-wrap: anywhere; }
.nav-item.active { color: var(--emerald-glow); }

.nav-item-center {
    position: relative;
    top: -15px;
}

.center-icon-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--emerald), var(--emerald-glow));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px rgba(31, 122, 99, 0.6);
}

.center-icon-btn i { font-size: 1.4rem; }

/* ==========================================
   11. الأنيميشن والـ Keyframes
   ========================================== */
@keyframes pulse {
    0% { r: 5px; opacity: 1; }
    100% { r: 15px; opacity: 0; }
}

@keyframes popupScale {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   12. فئات مساعدة مضافة (Utility Classes & Fixes)
   ========================================== */

/* بديل التنسيقات المضمنة للشبكات */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* تجهيز حالة الحركات لتعمل مع الجافاسكريبت */
[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-animate="fade-up"].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* رسالة نجاح النماذج */
.success-msg {
    padding: 1.5rem;
    background: rgba(31, 122, 99, 0.15);
    border: 1px solid var(--emerald);
    color: var(--emerald-glow);
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}

/* ==========================================
   قسم التقييمات ورسالة الطمأنينة (اللمسة الوجدانية)
   ========================================== */
.reassurance-box {
    background: linear-gradient(135deg, var(--navy-card), var(--navy-light));
    border-right: 4px solid var(--emerald);
    padding: 30px;
    border-radius: 16px;
    margin-top: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.reassurance-box h3 { 
    color: var(--emerald-glow); 
    margin-bottom: 15px; 
    font-size: 1.3rem; 
}

.reassurance-box p { 
    color: var(--soft-white); 
    line-height: 1.8; 
    font-size: 1.05rem; 
}

.testimonials-section {
    padding: 60px 0;
    background: var(--navy-card);
}

.testimonial-card {
    background: var(--navy-deep);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 30px;
    border-radius: 16px;
    text-align: right;
    transition: all 0.3s ease;
}

.testimonial-card:hover { 
    border-color: var(--emerald); 
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(31, 122, 99, 0.2);
}

.testimonial-card .stars { 
    color: #FFD700; 
    margin-bottom: 15px; 
    font-size: 1.1rem; 
}

.testimonial-card p { 
    font-style: italic; 
    color: var(--cool-gray); 
    line-height: 1.7; 
    margin-bottom: 20px; 
}

.testimonial-card h4 { 
    color: var(--soft-white); 
    margin-bottom: 5px; 
}

.testimonial-card span { 
    color: var(--emerald-glow); 
    font-size: 0.85rem; 
    font-weight: bold; 
}

@media (max-width: 575px) {
    .hero-glow {
        width: 240px;
        height: 240px;
        right: -70px;
    }

    .destinations-section [style*="grid-template-columns"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #externalMap {
        height: min(550px, 125vw);
        min-height: 360px;
    }

    .sound-control-btn {
        top: 104px;
        left: 16px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons > a {
        width: 100%;
    }

    .floating-badge {
        max-width: calc(100% - 20px);
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .hero-image-wrapper {
        padding-bottom: 38px;
    }

    .badge-1 { top: -12px; right: 5px; }
    .badge-2 { bottom: -42px; left: 5px; }

    .country-info-card {
        right: 10px;
        bottom: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        padding: 18px 16px;
    }

    .mobile-bottom-nav {
        padding-inline: 4px;
    }
}