/* ========================================
   الهيدر والقائمة - Header & Navigation
   الملف: public/web/css/header.css
======================================== */

/* ========================================
   المتغيرات
======================================== */
:root {
    --header-height: 80px;
    --header-height-scrolled: 70px;
    --primary-color: #ffd700;
    --secondary-color: #1a1a2e;
    --text-light: #ffffff;
    --text-dark: #1a1a2e;
    --transition-fast: 0.3s ease;
    --transition-medium: 0.4s ease;
    --shadow-light: 0 5px 30px rgba(0, 0, 0, 0.1);
    --shadow-dark: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* ========================================
   الهيدر الرئيسي
======================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transition: all var(--transition-medium);
}

.main-header .navbar {
    padding: 20px 0;
    transition: all var(--transition-medium);
}

.main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

/* ========================================
   حالة التمرير (Scrolled State)
======================================== */
.main-header.scrolled {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-dark);
}

.main-header.scrolled .navbar {
    padding: 15px 0;
}

.main-header.scrolled .navbar-brand .logo-light {
    display: block;
}

.main-header.scrolled .navbar-brand .logo-dark {
    display: none;
}

/* ========================================
   الشعار
======================================== */
.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img {
    height: 45px;
    width: auto;
    transition: all var(--transition-fast);
}

.navbar-brand .logo-light {
    display: block;
}

.navbar-brand .logo-dark {
    display: none;
}

/* ========================================
   القائمة الرئيسية
======================================== */
.navbar-collapse {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-radius: 12px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.nav-link i {
    font-size: 14px;
    opacity: 0;
    transform: translateX(10px);
    transition: all var(--transition-fast);
}

.nav-link:hover i,
.nav-link.active i {
    opacity: 1;
    transform: translateX(0);
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #ffab00);
    border-radius: 3px;
    transition: width var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(255, 215, 0, 0.1);
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 50%;
}

/* تأثير التوهج */
.nav-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::after {
    left: 100%;
}

/* ========================================
   أزرار الإجراء
======================================== */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #ffab00 100%);
    color: var(--text-dark);
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition-medium);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-contact:hover::before {
    left: 100%;
}

.btn-contact:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 215, 0, 0.4);
    color: var(--text-dark);
}

.btn-contact i {
    font-size: 16px;
    transition: transform var(--transition-fast);
}

.btn-contact:hover i {
    transform: translateX(-3px) rotate(-15deg);
}

/* ========================================
   زر القائمة (Hamburger)
======================================== */
.navbar-toggler {
    display: none;
    width: 45px;
    height: 45px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.navbar-toggler:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: var(--primary-color);
}

.toggler-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 5px;
}

.toggler-icon .bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* حالة الفتح */
.navbar-toggler.active .bar-1 {
    transform: translateY(7px) rotate(45deg);
}

.navbar-toggler.active .bar-2 {
    opacity: 0;
    transform: translateX(-10px);
}

.navbar-toggler.active .bar-3 {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   قائمة الجوال
======================================== */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    visibility: hidden;
    opacity: 0;
    transition: all var(--transition-medium);
}

.mobile-menu.active {
    visibility: visible;
    opacity: 1;
}

.mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.mobile-menu.active .mobile-menu-overlay {
    opacity: 1;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85%;
    height: 100%;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
    transition: right var(--transition-medium);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
}

.mobile-menu.active .mobile-menu-content {
    right: 0;
}

/* رأس قائمة الجوال */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-logo img {
    height: 40px;
    width: auto;
}

.mobile-close {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-close:hover {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    transform: rotate(90deg);
}

/* روابط قائمة الجوال */
.mobile-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav li {
    margin: 5px 15px;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-radius: 12px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.mobile-nav a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform var(--transition-fast);
    border-radius: 0 4px 4px 0;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    background: rgba(255, 215, 0, 0.1);
    color: var(--primary-color);
}

.mobile-nav a:hover::before,
.mobile-nav a.active::before {
    transform: scaleY(1);
}

.mobile-nav a i {
    width: 25px;
    text-align: center;
    font-size: 18px;
}

/* تذييل قائمة الجوال */
.mobile-menu-footer {
    padding: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.social-links a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.social-links a:hover {
    transform: translateY(-3px);
}

.social-links a:nth-child(1):hover {
    background: #25d366;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.social-links a:nth-child(2):hover {
    background: #1da1f2;
    box-shadow: 0 8px 25px rgba(29, 161, 242, 0.4);
}

.social-links a:nth-child(3):hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    box-shadow: 0 8px 25px rgba(225, 48, 108, 0.4);
}

.social-links a:nth-child(4):hover {
    background: #0077b5;
    box-shadow: 0 8px 25px rgba(0, 119, 181, 0.4);
}

.mobile-menu-footer .copyright {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* ========================================
   مؤشر التقدم
======================================== */
.scroll-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.main-header.scrolled .scroll-progress {
    opacity: 1;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), #00d4ff, var(--primary-color));
    background-size: 200% 100%;
    animation: progressGradient 2s linear infinite;
    border-radius: 0 3px 3px 0;
    transition: width 0.1s ease;
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}



@keyframes bounceUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ========================================
   التجاوب مع الشاشات
======================================== */
@media (max-width: 991px) {
    .navbar-collapse {
        display: none;
    }
    
    .navbar-toggler {
        display: flex;
    }
    
    .btn-contact span {
        display: none;
    }
    
    .btn-contact {
        width: 45px;
        height: 45px;
        padding: 0;
        justify-content: center;
    }
    
    .btn-contact i {
        margin: 0;
    }
}

@media (max-width: 767px) {
    .main-header .navbar {
        padding: 15px 0;
    }
    
    .navbar-brand img {
        height: 35px;
    }
    
    .back-to-top {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .mobile-menu-content {
        width: 280px;
    }
}

@media (max-width: 575px) {
    .navbar-brand img {
        height: 32px;
    }
    
    .navbar-toggler,
    .btn-contact {
        width: 42px;
        height: 42px;
    }
    
    .mobile-nav a {
        padding: 12px 18px;
        font-size: 15px;
    }
}

/* ========================================
   تأثيرات إضافية
======================================== */

/* تأثير عند التمرير للأسفل */
.main-header.hide-header {
    transform: translateY(-100%);
}

/* خلفية متدرجة شفافة */
.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, transparent 100%);
    opacity: 1;
    transition: opacity var(--transition-medium);
    pointer-events: none;
}

.main-header.scrolled::before {
    opacity: 0;
}

/* تأثير النقطة النشطة */
.nav-item.active .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary-color);
}