@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Tajawal:wght@400;500;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --primary: #1D4ED8; /* أزرق داكن يدل على التعلم والاحترافية */
    --primary-light: #EFF6FF; /* أزرق فاتح جداً للخلفيات الفرعية */
    --white: #FFFFFF;
    --black: #111111;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --bg-main: #FFFFFF; /* اللون الأبيض كلون أساسي للخلفية */
}

body {
    /* دمج خط Tajawal لدعم اللغة العربية بشكل أنيق جداً */
    font-family: 'Tajawal', 'Nunito', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

/* شريط العلم الألماني الخفيف - 3 بكسل */
.german-flag-line {
    height: 3px;
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 1000;
    background: linear-gradient(to right, rgba(0,0,0,0.85) 33.33%, rgba(221,0,0,0.85) 33.33%, rgba(221,0,0,0.85) 66.66%, rgba(255,206,0,0.85) 66.66%);
}

/* شريط التنقل */
nav {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.04);
    position: sticky;
    top: 3px;
    z-index: 999;
}

.logo {
    font-size: 50px;
    font-weight: 1200;
    color: var(--text-main);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span { color: var(--primary); }

.nav-links { display: flex; align-items: center; gap: 20px; }

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--primary); }

.lang-switch {
    background: var(--primary-light);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--primary);
}
.lang-switch a { color: var(--primary); font-weight: 700; }

.btn-login { font-weight: 700; }
.btn-register {
    background: var(--primary);
    color: var(--white) !important;
    padding: 10px 25px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.4);
    background: #1e40af;
}

/* قسم الواجهة الترحيبية */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 80px 5%;
    min-height: 70vh;
    background: linear-gradient(180deg, var(--white) 0%, var(--primary-light) 100%);
}

.hero-content { flex: 1; padding-inline-end: 50px; }
.hero-content h1 { font-size: 3.5rem; font-weight: 800; line-height: 1.3; margin-bottom: 20px; color: var(--text-main); }
.hero-content p { font-size: 1.2rem; color: var(--text-muted); margin-bottom: 40px; line-height: 1.8; }

.hero-image { flex: 1; text-align: center; }
.hero-image img { 
    width: 100%; 
    max-width: 550px; 
    border-radius: 24px; 
    box-shadow: 0 20px 40px rgba(29, 78, 216, 0.15); 
    object-fit: cover;
}

.cta-btn {
    background: var(--primary);
    color: var(--white);
    padding: 16px 35px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 30px;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(29, 78, 216, 0.3);
}
.cta-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(29, 78, 216, 0.4); }

/* قسم المميزات */
.features {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 60px 5%;
    background: var(--white);
    text-align: center;
}
.feature-item i { font-size: 2.5rem; color: var(--primary); margin-bottom: 15px; }
.feature-item h4 { font-size: 1.2rem; margin-bottom: 10px; color: var(--text-main); font-weight: 700;}
.feature-item p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6;}

/* شبكة الكورسات */
.container { max-width: 1200px; margin: 80px auto; padding: 0 5%; }
.section-title { text-align: center; font-size: 2.5rem; font-weight: 800; margin-bottom: 50px; color: var(--text-main); }

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.course-card {
    background: var(--white);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid var(--primary-light);
}

.course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(29, 78, 216, 0.08);
    border-color: var(--primary);
}

.level-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.course-card h3 { margin-top: 0; font-size: 1.4rem; color: var(--text-main); }
.course-card p { color: var(--text-muted); line-height: 1.7; margin-bottom: 25px; }
.course-card .course-link {
    display: block;
    text-align: center;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    padding: 10px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    transition: all 0.2s;
}
.course-card .course-link:hover { background: var(--primary); color: var(--white); }
/* تنسيقات عارض الصور المتحرك (Slider) */
.slider-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin: auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(29, 78, 216, 0.15);
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out; /* تأثير التلاشي الناعم */
}

.slide.active {
    opacity: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* تنسيق اسم المدينة */
.slide-caption {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 8px;
}
/* =========================================
   حركات إضافية لكسر الجمود (Animations)
========================================= */

/* 1. حركة دخول النصوص في الواجهة */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-content h1 { animation: fadeInUp 0.8s ease-out forwards; }
.hero-content p { animation: fadeInUp 1s ease-out 0.2s forwards; opacity: 0; }
.hero-content .cta-btn { 
    animation: fadeInUp 1s ease-out 0.4s forwards, pulseGlow 2s infinite; 
    opacity: 0; 
}

/* 2. نبض مضيء لزر البداية لجذب الانتباه */
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 rgba(29, 78, 216, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(29, 78, 216, 0); }
    100% { box-shadow: 0 0 0 0 rgba(29, 78, 216, 0); }
}

/* 3. حركة التقريب البطيء (Ken Burns) لعارض الصور */
@keyframes kenBurns {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); } /* تكبير الصورة ببطء بنسبة 15% */
}

.slide.active img {
    animation: kenBurns 5s linear forwards;
}

/* 4. تفاعلات الأيقونات عند مرور الماوس (Hover) */
.feature-item {
    transition: transform 0.3s ease;
}
.feature-item:hover {
    transform: translateY(-10px);
}
.feature-item i {
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), color 0.3s;
}
.feature-item:hover i {
    transform: scale(1.3) rotate(15deg); /* تكبير وميلان لطيف */
    color: #ffce00; /* تغيير اللون للأصفر الألماني */
}

/* 5. تأثير الظهور التدريجي عند التمرير للأسفل (Scroll Reveal) */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* حركة الكروت الخاصة بالكورسات */
.course-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
.course-card:hover {
    transform: translateY(-15px) scale(1.02); /* رفع الكرت وتكبيره قليلاً */
}

/* ========== LIBRARY SECTION ========== */
.library-section {
    background: linear-gradient(135deg, #F8FAFC 0%, #EFF6FF 100%);
    padding: 60px 0;
    margin: 40px 0 0;
}
.library-desc {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 50px;
}
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}
.book-card {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid rgba(29,78,216,0.1);
}
.book-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 35px rgba(29,78,216,0.15);
    border-color: var(--primary);
}
.book-cover {
    background: var(--primary-light);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    color: var(--primary);
}
.book-card h3 {
    margin-bottom: 8px;
    color: var(--text-main);
}
.book-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
}
.book-link {
    display: inline-block;
    text-decoration: none;
    font-weight: 700;
    color: var(--primary);
    transition: 0.2s;
}
.book-link:hover {
    transform: translateX(5px);
    display: inline-block;
}
[dir="rtl"] .book-link:hover {
    transform: translateX(-5px);
}
.library-cta {
    background: white;
    color: var(--primary) !important;
    border: 2px solid var(--primary);
    box-shadow: none;
    margin-top: 20px;
}
.library-cta:hover {
    background: var(--primary);
    color: white !important;
}
.text-center {
    text-align: center;
}
/* ========== FOOTER ========== */
.main-footer {
    background: #0F172A;
    color: #CBD5E1;
    position: relative;
    margin-top: 80px;
}
.footer-wave {
    position: absolute;
    top: -50px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}
.footer-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 50px;
}
.wave-fill {
    fill: #0F172A;
}
.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    padding: 60px 5% 40px;
    max-width: 1300px;
    margin: 0 auto;
}
.footer-column {
    flex: 1;
    min-width: 180px;
}
.footer-logo {
    font-size: 26px;
    font-weight: 800;
    color: white;
    margin-bottom: 15px;
}
.footer-logo span { color: var(--primary); }
.footer-column p {
    line-height: 1.6;
    margin-bottom: 20px;
}
.social-links {
    display: flex;
    gap: 15px;
}
.social-links a {
    background: rgba(255,255,255,0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: white;
    text-decoration: none;
}
.social-links a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}
.footer-column h4 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
}
.footer-column ul {
    list-style: none;
    padding: 0;
}
.footer-column ul li {
    margin-bottom: 12px;
}
.footer-column ul li a {
    color: #CBD5E1;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.95rem;
}
.footer-column ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
}
/* RTL support */
[dir="rtl"] .footer-column ul li a:hover {
    padding-left: 0;
    padding-right: 5px;
}
.newsletter input {
    background: #1E293B;
    border: none;
    padding: 12px 15px;
    border-radius: 40px;
    width: 100%;
    color: white;
    margin-bottom: 10px;
}
.newsletter button {
    background: var(--primary);
    border: none;
    padding: 10px 20px;
    border-radius: 40px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}
.newsletter button:hover {
    background: #1e40af;
}
.footer-bottom {
    text-align: center;
    border-top: 1px solid #1E293B;
    padding: 20px;
    font-size: 0.85rem;
    color: #94A3B8;
}