/* ============================================
   طموح - منصة الطالب الذكي
   ملف CSS احترافي وعصري - نسخة محسنة ومستقرة للاستضافة
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@400;700;800&family=Tajawal:wght@400;500;700;800;900&display=swap');

/* ===== المتغيرات والألوان ===== */
:root {
    --primary: #3B82F6;
    --primary-dark: #1E40AF;
    --primary-light: #60A5FA;
    --secondary: #A78BFA;
    --secondary-dark: #7C3AED;
    --success: #10B981;
    --success-dark: #059669;
    --warning: #F59E0B;
    --danger: #EF4444;
    --danger-dark: #DC2626;
    --dark: #1F2937;
    --light: #F3F4F6;
    --white: #FFFFFF;
    --text-dark: #111827;
    --text-light: #6B7280;
    --border: #E5E7EB;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 30px 60px rgba(0, 0, 0, 0.2);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --header-height: 64px; /* تقليل الارتفاع قليلاً ليكون أكثر رشاقة */
}

/* ===== الوضع الليلي ===== */
body.dark-mode {
    --primary: #60A5FA;
    --primary-dark: #3B82F6;
    --secondary: #C4B5FD;
    --dark: #F3F4F6;
    --light: #1F2937;
    --text-dark: #F3F4F6;
    --text-light: #D1D5DB;
    --border: #374151;
    --white: #111827;
}

/* ===== إعادة تعيين عام ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* منع المتصفحات من تغيير حجم النص تلقائياً */
}

body {
    font-family: "Tajawal", "Almarai", sans-serif;
    background-color: var(--white);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    padding-top: var(--header-height);
    -webkit-font-smoothing: antialiased;
}

/* ===== الحاوية ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ===== شريط التنقل ===== */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
}

.logo {
    font-size: 1.3em;
    font-weight: 900;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "Almarai", sans-serif;
    transition: var(--transition);
    flex-shrink: 0;
}

.logo:hover {
    transform: scale(1.02);
}

.logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 5px;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    position: relative;
    padding: 8px 12px;
    font-size: 0.95rem;
    white-space: nowrap;
    border-radius: 8px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
}

/* أزرار التحكم في الهيدر */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* زر الوضع الليلي المطور */
.theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.1em;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* زر القائمة للجوال */
.menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

/* ===== الاستجابة للجوال ===== */
@media (max-width: 992px) {
    :root {
        --header-height: 60px;
    }

    .nav-links {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .logo-text {
        font-size: 1.1em;
    }

    /* قائمة الجوال المنسدلة */
    .nav-links.mobile-open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--white);
        padding: 20px;
        box-shadow: var(--shadow-lg);
        z-index: 999;
        animation: slideDown 0.3s ease;
        overflow-y: auto;
    }
    
    .nav-links.mobile-open .nav-link {
        color: var(--text-dark);
        padding: 15px;
        border-bottom: 1px solid var(--border);
        width: 100%;
        text-align: right;
        font-size: 1.1em;
        border-radius: 0;
    }
    
    .nav-links.mobile-open .nav-link:hover {
        background: var(--light);
    }

    .nav-links.mobile-open .nav-link.active {
        background: var(--primary);
        color: white;
        border-radius: var(--radius);
    }
}

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

/* ===== القسم الرئيسي (Hero) ===== */
.hero {
    padding: 40px 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(167, 139, 250, 0.05) 100%);
    position: relative;
    overflow: hidden;
}

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

.hero-title {
    font-size: 2.8em;
    font-weight: 900;
    margin-bottom: 15px;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 25px;
}

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

.hero-image img {
    width: 100%;
    max-width: 450px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .hero {
        padding: 30px 0;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.2em;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        order: -1;
        margin-bottom: 20px;
    }

    .hero-image img {
        max-width: 300px;
    }
}

/* ===== الأزرار ===== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ===== قسم المميزات ===== */
.features {
    padding: 60px 0;
    background: var(--light);
}

.section-title {
    font-size: 2.2em;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 900;
}

.section-subtitle {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-light);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
    border: 1px solid transparent;
}

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

.feature-icon img {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
}

/* ===== قسم المنصات ===== */
.platforms {
    padding: 60px 0;
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.platform-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.platform-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

/* ===== الفوتر ===== */
.footer {
    background: var(--light);
    color: var(--text-dark);
    padding: 40px 0 20px;
    border-top: 1px solid var(--border);
}

body.dark-mode .footer {
    background: #0f172a;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    margin-bottom: 15px;
    color: var(--primary);
    font-weight: 800;
}

.footer-section p, .footer-section a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.85em;
    color: var(--text-light);
}

/* إضافات للتحسين العام */
img {
    max-width: 100%;
    height: auto;
}

.cta {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
    color: white;
    text-align: center;
}

.cta h2 {
    font-size: 2.2em;
    margin-bottom: 15px;
}

.cta p {
    margin-bottom: 25px;
    font-size: 1.1em;
    opacity: 0.9;
}

/* إصلاحات خاصة للدردشة والعناصر العائمة */
.chat-container {
    height: calc(100vh - var(--header-height) - 40px);
    margin-top: 20px;
}

/* ضمان عدم تداخل الشريط مع المحتوى في الجوال */
@media (max-width: 480px) {
    .logo-text {
        display: none; /* إخفاء النص والاكتفاء بالأيقونة في الشاشات الصغيرة جداً لتوفير مساحة */
    }
    
    .logo {
        gap: 0;
    }
}
