/* =====================================
   MODERN HEADER OFFLINE - الهايدر الموحد للزوار غير المسجلين
   ===================================== */

/* المتغيرات - نفس ألوان الموقع */
:root {
    --primary-color: #1C9E97;
    --secondary-color: #2d3748;
    --accent-color: #4fd1c7;
    --text-primary: #2d3748;
    --text-secondary: #64748b;
    --background-light: #f8fafc;
    --background-white: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --error-color: #f56565;
    --primary-hover: linear-gradient(135deg, #1C9E97 0%, #009577 100%);
    --ai-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --ai-gradient-hover: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    --ai-gradient-light: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

/* الخطوط حسب اللغة */
.lang-ar {
    font-family: 'Cairo', 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
}

.lang-fr {
    font-family: 'Inter', 'Segoe UI', 'Arial', sans-serif;
}

/* Site Mode Alert Styles */
.site-mode-alert {
    margin: 0;
    text-align: center;
    padding: 18px 20px;
    font-weight: 600;
    position: fixed;
    left: 0;
    right: 0;
    z-index: 1001;
    border: none;
    border-radius: 0;
    width: 100%;
    top: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid;
    font-size: 0.95rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.site-mode-alert.demo {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #f59e0b 100%);
    color: #92400e;
    border-bottom-color: #f59e0b;
}

.site-mode-alert.maintenance {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 50%, #ef4444 100%);
    color: #991b1b;
    border-bottom-color: #ef4444;
}

.site-mode-alert.coming-soon {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 50%, #3b82f6 100%);
    color: #1e40af;
    border-bottom-color: #3b82f6;
}

/* تأثير نبضة للحالات المهمة */
.site-mode-alert.maintenance {
    animation: alertPulse 2s infinite;
}

@keyframes alertPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* تعديل موضع header عند وجود site-mode-alert */
body:has(.site-mode-alert) header {
    top: 60px; /* أسفل site-mode-alert */
}

.navbar {
    padding: 15px 0;
    transition: all 0.3s ease;
    max-width: 100%; /* التأكد من عدم تجاوز العرض */
}

.navbar .container {
    padding-left: 20px;
    padding-right: 20px;
    max-width: 100%;
}

.navbar.scrolled {
    padding: 10px 0;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand i {
    font-size: 2rem;
    background: linear-gradient(135deg, #1C9E97 0%, #009577 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 600;
    padding: 10px 15px !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: white !important;
    background: linear-gradient(135deg, #1C9E97 0%, #009577 100%);
}

/* ألوان وتنسيقات الهايدر الموحد */
@media (min-width: 992px) {
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
        border: 2px solid transparent;
        margin-bottom: 0;
        color: var(--text-secondary);
        border-radius: 8px;
        font-weight: 600;
        transition: all 0.3s ease;
    }
    
    .navbar-nav .nav-link:last-child:hover {
        background: var(--primary-hover) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 12px rgba(19, 130, 117, 0.3) !important;
        color: white !important;
    }
}

/* تصغير حجم الكتابة للغة الفرنسية في الهايدر */
.lang-fr .navbar-nav .nav-link {
    font-size: 0.85rem !important;
    padding: 0.4rem 0.8rem !important;
    white-space: nowrap !important;
}

.lang-fr .navbar-nav .nav-link i {
    font-size: 0.9rem !important;
    margin-right: 0.3rem !important;
    margin-left: 0 !important;
}

/* إلغاء تأثير me-auto لجعل القائمة أقرب للشعار */
.navbar-nav.me-auto {
    margin-right: 0 !important;
    margin-left: 2rem !important;
}

/* ضمان أن الأزرار تكون في آخر الهايدر */
.mobile-auth-container {
    margin-left: auto !important;
    order: 2 !important;
}

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

.navbar-nav {
    order: 1 !important;
    flex: 1 !important;
}

.nav-link.active {
    color: white !important;
    background: linear-gradient(135deg, #1C9E97 0%, #009577 100%) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* تأكيد تطبيق الألوان الصحيحة للهايدر */
.navbar-nav .nav-link.active {
    color: white !important;
    background: linear-gradient(135deg, #1C9E97 0%, #009577 100%) !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

.btn-auth {
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-outline-auth {
    color: var(--text-secondary);
    border-color: var(--border-color);
    background: var(--background-light);
}

.btn-outline-auth:hover {
    color: white;
    background: linear-gradient(135deg, #1C9E97 0%, #009577 100%);
    border-color: var(--primary-color);
}

.btn-primary-auth {
    color: white;
    background: linear-gradient(135deg, #1C9E97 0%, #009577 100%);
    border-color: var(--primary-color);
}

.btn-primary-auth:hover {
    background: linear-gradient(135deg, #009577 0%, #138275 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.language-switcher .form-select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    background: white;
}

/* Mobile Menu Styles */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1199;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(2px);
    will-change: opacity, visibility;
}

.mobile-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 1200;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transform: translateX(-100%);
    will-change: transform, left;
}

.mobile-menu.show {
    left: -10px !important;
    transform: translateX(0) !important;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.mobile-menu-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.mobile-menu-title i {
    margin-right: 0.5rem;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.guest-mobile-nav-links {
    padding: 1rem 0;
}

.guest-mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 1px solid var(--background-light);
    transition: all 0.2s;
}

.guest-mobile-nav-link:hover,
.guest-mobile-nav-link.active {
    background: var(--background-light);
    color: var(--primary-color);
}

.guest-mobile-nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
}

.mobile-language-switcher {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.language-switcher-mobile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.language-switcher-mobile i {
    color: var(--text-secondary);
}

.language-switcher-mobile span {
    color: var(--text-secondary);
    font-weight: 500;
}

.language-select-mobile {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    background: white;
    flex: 1;
}

.mobile-auth-buttons {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-auth-btn.login-btn {
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    background: var(--background-light);
}

.mobile-auth-btn.login-btn:hover {
    color: white;
    background: linear-gradient(135deg, #1C9E97 0%, #009577 100%);
    border-color: var(--primary-color);
}

.mobile-auth-btn.register-btn {
    color: white;
    background: linear-gradient(135deg, #1C9E97 0%, #009577 100%);
    border: 1px solid var(--primary-color);
}

.mobile-auth-btn.register-btn:hover {
    background: linear-gradient(135deg, #009577 0%, #138275 100%);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Hide mobile components on desktop */
@media (min-width: 992px) {
    .mobile-menu,
    .mobile-overlay {
        display: none !important;
    }
}

/* Show mobile toggle on mobile */
@media (max-width: 991.98px) {
    .navbar-collapse {
        display: none !important;
    }
    
    .navbar-toggler {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--primary-color);
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 4px;
        transition: all 0.2s ease;
        position: relative;
        z-index: 1001;
        max-width: 100%;
        overflow: visible;
    }

    .navbar-toggler:hover {
        background: rgba(28, 158, 151, 0.1);
    }

    .navbar-toggler-icon {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(19, 130, 117, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* ضمان عدم خروج العناصر من الشاشة */
    body {
        overflow-x: auto;
        width: 100%;
        max-width: 100vw;
    }
    
    .site-mode-alert {
        width: 100%;
        max-width: 100vw;
        left: 0;
        right: 0;
    }
    
    .navbar {
        width: 100%;
        max-width: 100vw;
        overflow: visible;
    }
}

@media (max-width: 576px) {
    .navbar .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* ضمان عدم خروج العناصر من الشاشة */
    body {
        overflow-x: auto;
        width: 100%;
        max-width: 100vw;
    }
} 

/* تم نقل الألوان الموحدة إلى الأعلى */

/* ضمان عدم خروج العناصر من الشاشة في جميع الصفحات */
body {
    overflow-x: auto;
    width: 100%;
    max-width: 100vw;
}

.site-mode-alert {
    width: 100%;
    max-width: 100vw;
    left: 0;
    right: 0;
    position: fixed;
    z-index: 1001;
}

.navbar {
    width: 100%;
    max-width: 100vw;
    overflow: visible;
    position: relative;
    z-index: 1000;
}

.navbar-toggler {
    position: relative;
    z-index: 1001;
    max-width: 100%;
    overflow: visible;
}

/* ضمان ظهور الهايدر الجوال بشكل صحيح */
@media (max-width: 991.98px) {
    .navbar-toggler {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .navbar-collapse {
        display: none !important;
    }
}

/* ضمان عدم خروج content-header من الشاشة */
.content-header {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    margin-top: 60px;
}

.content-header::before {
    max-width: 100%;
    overflow: hidden;
}

/* ضمان عدم خروج العناصر من الشاشة في الجوال */
@media (max-width: 768px) {
    .main-container {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .content-area {
        max-width: 100%;
        overflow-x: hidden;
    }
} 