/**
 * EduTech Header Styles
 * منفصل من header.php لتحسين الأداء
 */

/* ========================================
   Creative Glass Header
   ======================================== */
.smart-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                background 0.3s ease,
                box-shadow 0.3s ease;
}

.smart-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.03) 0%, 
        rgba(139, 92, 246, 0.02) 50%,
        rgba(236, 72, 153, 0.02) 100%);
    pointer-events: none;
}

.smart-header.header-hidden {
    transform: translateY(-100%);
}

.smart-header.header-scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.header-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    position: relative;
    z-index: 1;
}

/* Logo */
.header-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    position: relative;
}

.header-logo::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease;
}

.header-logo:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.header-logo img {
    height: 48px;
    width: auto;
    min-width: 48px;
    object-fit: contain;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.header-logo:hover img {
    transform: scale(1.05);
}

/* Desktop Nav */
.header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu > li {
    position: relative;
}

.nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #374151;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.nav-menu > li > a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-radius: 12px;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.nav-menu > li > a:hover::before,
.nav-menu > li.current-menu-item > a::before {
    opacity: 1;
    transform: scale(1);
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a {
    color: #3b82f6;
}

.nav-menu > li > a span {
    position: relative;
    z-index: 1;
}

/* Active Indicator */
.nav-menu > li.current-menu-item > a::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
}

/* Submenu */
.nav-menu .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 220px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    list-style: none;
}

.nav-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-menu .sub-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: rgba(255, 255, 255, 0.95);
}

.nav-menu .sub-menu li a {
    display: block;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #4b5563;
    border-radius: 10px;
    transition: all 0.2s;
}

.nav-menu .sub-menu li a:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
    color: #3b82f6;
    padding-left: 20px;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Cart Button */
.header-cart {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    color: #374151;
    background: rgba(243, 244, 246, 0.8);
    border-radius: 14px;
    transition: all 0.3s ease;
    overflow: visible;
}

.header-cart::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.15));
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 14px;
}

.header-cart:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

.header-cart:hover::before {
    opacity: 1;
}

.header-cart svg {
    position: relative;
    z-index: 1;
    transition: transform 0.3s;
}

.header-cart:hover svg {
    transform: scale(1.1);
    color: #3b82f6;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, #ef4444, #f43f5e);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
    z-index: 2;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* CTA Button */
.header-cta {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.header-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #f43f5e 0%, #ef4444 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.header-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.35);
}

.header-cta:hover::before {
    opacity: 1;
}

.header-cta span {
    position: relative;
    z-index: 1;
}

.header-cta .cta-icon {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.header-cta:hover .cta-icon {
    transform: translateX(4px);
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 46px;
    height: 46px;
    background: rgba(243, 244, 246, 0.8);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    gap: 6px;
    padding: 12px;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(59, 130, 246, 0.1);
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: linear-gradient(90deg, #374151, #6b7280);
    border-radius: 3px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.menu-toggle.active {
    background: rgba(239, 68, 68, 0.1);
}

.menu-toggle.active span {
    background: linear-gradient(90deg, #ef4444, #f43f5e);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========================================
   Mobile Menu
   ======================================== */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 998;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        rgba(59, 130, 246, 0.03) 0%, 
        rgba(139, 92, 246, 0.02) 50%,
        rgba(236, 72, 153, 0.02) 100%);
    pointer-events: none;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    position: relative;
    z-index: 1;
}

.mobile-logo {
    height: 40px;
    width: auto;
    min-width: 40px;
    object-fit: contain;
}

.mobile-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(243, 244, 246, 0.8);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: #374151;
    transition: all 0.3s ease;
}

.mobile-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: rotate(90deg);
}

.mobile-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    position: relative;
    z-index: 1;
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0 16px;
}

.mobile-nav-menu > li {
    margin-bottom: 4px;
}

.mobile-nav-menu > li > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    border-radius: 14px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mobile-nav-menu > li > a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.05));
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-nav-menu > li > a:hover::before,
.mobile-nav-menu > li.current-menu-item > a::before {
    opacity: 1;
}

.mobile-nav-menu > li > a:hover,
.mobile-nav-menu > li.current-menu-item > a {
    color: #3b82f6;
}

.mobile-nav-menu > li > a span {
    position: relative;
    z-index: 1;
}

/* Mobile Submenu */
.mobile-nav-menu .sub-menu {
    list-style: none;
    padding: 8px 0 8px 20px;
    margin: 0;
}

.mobile-nav-menu .sub-menu li a {
    display: block;
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #6b7280;
    border-radius: 10px;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.mobile-nav-menu .sub-menu li a:hover {
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
    border-left-color: #3b82f6;
    padding-left: 20px;
}

.mobile-menu-footer {
    padding: 20px;
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    position: relative;
    z-index: 1;
}

.mobile-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-radius: 14px;
    transition: all 0.3s ease;
}

.mobile-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.35);
}

/* ========================================
   Responsive
   ======================================== */

/* Large Desktop */
@media (min-width: 1400px) {
    .header-cta {
        padding: 10px 22px;
        font-size: 0.88rem;
    }
}

/* Desktop */
@media (min-width: 1200px) and (max-width: 1399px) {
    .header-cta {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
}

/* Laptop */
@media (min-width: 993px) and (max-width: 1199px) {
    .header-cta {
        padding: 9px 16px;
        font-size: 0.82rem;
    }
    
    .nav-menu > li > a {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

@media (max-width: 992px) {
    .header-nav {
        display: none;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .header-cta {
        padding: 9px 16px;
        font-size: 0.82rem;
        border-radius: 10px;
    }
    
    .header-cta .cta-icon {
        display: none;
    }
}

@media (max-width: 576px) {
    .header-inner {
        height: 64px;
        padding: 0 16px;
        gap: 10px;
    }
    
    .header-logo img {
        height: 40px;
        min-width: 40px;
    }
    
    .header-cart {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    
    .header-cart svg {
        width: 20px;
        height: 20px;
    }
    
    .header-cta {
        padding: 8px 14px;
        font-size: 0.8rem;
        border-radius: 10px;
        gap: 0;
    }
    
    .menu-toggle {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    
    .mobile-menu {
        width: 300px;
        right: -300px;
    }
    
    .mobile-nav-menu > li > a {
        padding: 14px 16px;
    }
}

@media (max-width: 420px) {
    .header-inner {
        gap: 8px;
    }
    
    .header-cta {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .header-cart {
        width: 38px;
        height: 38px;
    }
    
    .menu-toggle {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 360px) {
    .header-inner {
        height: 56px;
        padding: 0 10px;
        gap: 6px;
    }
    
    .header-logo img {
        height: 34px;
        min-width: 34px;
    }
    
    .header-cta .cta-text {
        display: none;
    }
    
    .header-cta {
        width: 38px;
        height: 38px;
        padding: 0;
        justify-content: center;
        border-radius: 10px;
    }
    
    .header-cta .cta-icon {
        display: flex;
    }
    
    .header-cart,
    .menu-toggle {
        width: 36px;
        height: 36px;
    }
    
    .header-cart svg {
        width: 18px;
        height: 18px;
    }
}
