/* ========================================
   إدولانجو - التنسيقات الرئيسية (النسخة النهائية الكاملة)
   ======================================== */

/* متغيرات الألوان */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --accent: #f59e0b;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --success: #10b981;
    --danger: #ef4444;
    --white: #ffffff;
    --gray: #6c757d;
    --saudi-green: #1a5a3a;
    --saudi-dark-green: #0a2f1f;
    --saudi-light-green: #2a8a5a;
    --saudi-gold: #FFD700;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    color: var(--dark);
    line-height: 1.6;
}

/* ===== الهيدر (تم تعديله لمنع التداخل مع header.php) ===== */
.navbar:not(.edu-navbar) {
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 15px 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 10px 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
}

/* ===== لوجو صورة ===== */
.logo-img {
    height: 60px;
    width: auto;
    transition: 0.3s;
}

.navbar.scrolled .logo-img {
    height: 50px;
}

/* ===== قسم البطل (Hero) ===== */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 500px;
    display: flex;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    color: white;
}

.hero::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 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    animation: fadeInUp 0.8s ease;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 1.2rem;
    margin: 20px 0;
    animation: fadeInUp 0.8s ease 0.2s both;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.2);
}

.hero .btn {
    animation: fadeInUp 0.8s ease 0.4s both;
}

.btn-warning {
    background: #f59e0b;
    border: none;
    padding: 12px 30px;
    font-weight: bold;
    border-radius: 50px;
    transition: 0.3s;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(245,158,11,0.4);
    color: white;
}

/* ===== البطاقات ===== */
.card {
    border: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 45px rgba(0,0,0,0.15);
}

.card-img-top {
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.card h5 {
    color: #667eea;
    font-weight: bold;
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    border-radius: 50px;
    padding: 8px 25px;
    transition: 0.3s;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* ===== بطاقات المعاهد (نتائج البحث) ===== */
.institute-card {
    transition: all 0.3s ease;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 25px;
}

.institute-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.institute-img {
    height: 100%;
    min-height: 200px;
    object-fit: cover;
}

.institute-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
}

.institute-location {
    font-size: 0.85rem;
}

.institute-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #475569;
}

.features .badge {
    font-size: 0.75rem;
    font-weight: 400;
}

.price-badge {
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== نموذج البحث ===== */
.search-card {
    border-radius: 25px;
    background: var(--white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.search-card select,
.search-card input {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 12px;
    transition: all 0.3s ease;
}

.search-card select:focus,
.search-card input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* ===== زر واتساب ===== */
.whatsapp-btn {
    background: #25D366;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 5px 15px rgba(37,211,102,0.3);
}

.whatsapp-btn:hover {
    background: #128C7E;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(37,211,102,0.4);
    color: white;
}

/* ===== الفوتر ===== */
footer {
    background: #1e293b;
    color: var(--white);
    padding: 50px 0 20px;
    border-top: 5px solid #f59e0b;
}

footer a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #f59e0b !important;
}

footer h4 {
    color: #f59e0b;
    margin-bottom: 10px;
}

/* ===== الحركات (Animations) ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== أيقونات وحركات البحث ===== */
.loader {
    display: none;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary, #667eea);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.result-card {
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
}

/* ===== التوافق مع الجوال ===== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .logo-img {
        height: 45px;
    }
    
    .navbar.scrolled .logo-img {
        height: 40px;
    }
    
    .card-img-top {
        height: 180px;
    }
    
    .search-card .row > div {
        margin-bottom: 10px;
    }
    
    .whatsapp-btn {
        padding: 8px 20px;
        font-size: 14px;
    }
    
    .institute-img {
        height: 180px;
        width: 100%;
        border-radius: 15px 15px 0 0 !important;
    }
    
    .institute-card .row {
        flex-direction: column;
    }
}

/* ===== تأثيرات إضافية ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50px;
    padding: 12px 25px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102,126,234,0.3);
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 40px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* تحسينات للموبايل والتابلت */
@media (max-width: 991px) {
    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .section-title {
        font-size: 1.5rem;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
}

/* ===== شريط علوي (تم تعديله لمنع التداخل) ===== */
.top-bar:not(.edu-top-bar) {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 8px 0;
    font-size: 13px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.top-bar-contact a,
.top-bar-social a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    transition: 0.3s;
}

.top-bar-contact a:hover,
.top-bar-social a:hover {
    color: #f59e0b;
    transform: translateY(-2px);
}

.top-bar-social a {
    margin-left: 12px;
    font-size: 14px;
}

/* ===== حل مشكلة الهيدر الثابت ===== */
body {
    padding-top: 90px;
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
}

/* =============================================
   تنسيقات صفحة الطالب السعودي (saudi.php)
   ============================================= */

/* الهيدر السعودي */
.saudi-header {
    background: linear-gradient(135deg, var(--saudi-dark-green) 0%, var(--saudi-green) 50%, var(--saudi-light-green) 100%);
    color: white;
    padding: 70px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* البادج العلوي */
.saudi-badge-top {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    margin-bottom: 30px;
    letter-spacing: 0.5px;
}

/* أيقونة العلم */
.saudi-flag-wrapper {
    margin-bottom: 25px;
}
.fi-sa {
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    border-radius: 8px;
}

/* العناوين */
.saudi-header h1 {
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.3;
}
.saudi-header .lead {
    font-size: 1.1rem;
    opacity: 0.92;
    max-width: 750px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

/* إحصائيات سريعة */
.saudi-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}
.stat-item {
    text-align: center;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(5px);
    padding: 12px 25px;
    border-radius: 60px;
    min-width: 140px;
}
.stat-item i {
    font-size: 22px;
    margin-left: 8px;
    color: var(--saudi-gold);
}
.stat-item span {
    font-size: 1.3rem;
    font-weight: 800;
    margin-left: 5px;
}
.stat-item small {
    display: block;
    font-size: 0.7rem;
    opacity: 0.8;
    margin-top: 4px;
}

/* الأزرار */
.saudi-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.btn-whatsapp-saudi {
    background: #25D366;
    color: white;
    padding: 12px 32px;
    border-radius: 60px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-whatsapp-saudi:hover {
    background: #128C7E;
    transform: translateY(-2px);
    color: white;
}
.btn-outline-saudi {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 12px 32px;
    border-radius: 60px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn-outline-saudi:hover {
    background: white;
    color: var(--saudi-green);
    transform: translateY(-2px);
}

/* البطاقات الداخلية لصفحة السعودية */
.saudi-content-card {
    background: white;
    border-radius: 28px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
    transition: 0.2s;
}
.saudi-content-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}
.saudi-content-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--saudi-green);
    margin-bottom: 20px;
    border-right: 4px solid var(--saudi-green);
    padding-right: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* التجاوب مع الجوال */
@media (max-width: 768px) {
    .saudi-header { padding: 50px 0 60px; }
    .saudi-header h1 { font-size: 1.5rem; }
    .stat-item { padding: 8px 18px; min-width: 100px; }
    .stat-item i { font-size: 18px; }
    .stat-item span { font-size: 1rem; }
    .btn-whatsapp-saudi, .btn-outline-saudi { padding: 8px 20px; font-size: 0.8rem; }
    .saudi-content-card { padding: 20px; }
    .saudi-content-card h2 { font-size: 1.2rem; }
}

/* ========================================
   حل درج الموبايل النهائي - قواعد إضافية
   ======================================== */

/* ضمان ظهور الدرج فوق كل شيء */
.edu-mobile-drawer {
    z-index: 999999 !important;
}

.edu-mobile-drawer.active {
    z-index: 999999 !important;
}

/* تحسين ظهور القوائم في الدرج */
.edu-main-menu {
    margin: 0 !important;
    padding: 0 !important;
}

.edu-menu-link {
    background: #f8fafc !important;
    border-radius: 12px !important;
    transition: 0.2s !important;
}

.edu-menu-link:hover {
    background: #eef2ff !important;
}

/* منع أي تداخل مع الـ top bar البنفسجي */
body.menu-open .edu-top-bar,
body.menu-open .edu-navbar {
    z-index: 99980 !important;
}