/* ========================================
   MAIN HEADER STYLES
   website/assets/css/header.css
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    overflow-x: hidden;
    padding-top: var(--header-height);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========================================
   TOP ANNOUNCEMENT BAR
   ======================================== */
.top-announcement-bar {
    background: linear-gradient(135deg, var(--dark-navy) 0%, var(--primary-blue-dark) 100%);
    color: var(--white);
    padding: 0.75rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1002;
    font-size: 0.875rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* إخفاء شريط الإعلانات عند السكرول */
.top-announcement-bar.hidden {
    top: -50px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.announcement-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.announcement-text {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.announcement-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.top-social-links {
    display: flex;
    gap: 0.5rem;
}

.social-link {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.social-link:hover {
    background: var(--white);
    color: var(--primary-blue);
    transform: translateY(-2px);
}

/* ========================================
   MAIN HEADER
   ======================================== */
.main-header {
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.08);
    position: fixed;
    top: 46px;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--primary-blue) 0%, 
        var(--secondary-blue) 50%, 
        var(--electric-blue) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.main-header.scrolled {
    top: 0;
    box-shadow: 0 8px 32px rgba(0, 102, 255, 0.15);
}

.main-header.scrolled::before {
    opacity: 1;
}

.header-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
    height: var(--header-height);
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-header.scrolled .header-container {
    height: var(--header-scrolled-height);
}

/* ========================================
   LOGO
   ======================================== */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: var(--logo-padding) 0;
    position: relative;
    min-width: 180px;
}

.logo-image {
    max-height: var(--logo-max-height);
    width: auto;
    max-width: 200px;
    height: auto;
    object-fit: contain;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 8px rgba(0, 102, 255, 0.1));
}

.main-header.scrolled .logo-image {
    max-height: var(--logo-scrolled-height);
}

.logo-container:hover .logo-image {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 12px rgba(0, 102, 255, 0.2));
}

/* ========================================
   NAVIGATION
   ======================================== */
.main-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    position: relative;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    color: var(--gray-900);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.1) 0%, rgba(0, 184, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 12px;
}

.nav-link:hover::before,
.nav-item.active .nav-link::before {
    opacity: 1;
}

.nav-link:hover,
.nav-item.active .nav-link {
    color: var(--primary-blue);
    transform: translateY(-2px);
}

.nav-dropdown-icon {
    font-size: 0.75rem;
    transition: transform 0.3s;
}

.nav-item:hover .nav-dropdown-icon {
    transform: rotate(180deg);
}

/* ========================================
   MEGA MENU
   ======================================== */
.mega-menu {
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 700px;
    background: var(--white);
    box-shadow: 0 25px 70px rgba(0, 102, 255, 0.15);
    border-radius: 20px;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    border: 1px solid rgba(0, 102, 255, 0.1);
}

.mega-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 8px solid var(--white);
}

.nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    top: 100%;
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.mega-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.mega-menu-item:hover {
    background: var(--gray-50);
    border-color: rgba(0, 102, 255, 0.2);
    transform: translateX(5px);
}

.mega-menu-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.mega-menu-content h3 {
    font-size: 0.9375rem;
    margin: 0 0 0.25rem 0;
    color: var(--gray-900);
}

.mega-menu-content p {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin: 0;
}

/* ========================================
   HEADER ACTIONS
   ======================================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-btn {
    background: var(--gray-50);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

.contact-btn {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--white);
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.25);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    font-size: 0.9375rem;
}

.contact-btn::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;
}

.contact-btn:hover::before {
    left: 100%;
}

.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.35);
}

.mobile-menu-toggle {
    display: none;
    background: var(--gray-50);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-900);
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: var(--primary-blue);
    color: var(--white);
}

/* ========================================
   SEARCH MODAL
   ======================================== */
.search-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.search-modal.active {
    opacity: 1;
    visibility: visible;
}

.search-modal-content {
    background: white;
    padding: 3rem;
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 30px 80px rgba(0, 102, 255, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.search-modal.active .search-modal-content {
    transform: scale(1);
}

.search-modal h2 {
    margin-bottom: 2rem;
    color: var(--gray-900);
    font-size: 1.75rem;
}

.search-form {
    display: flex;
    gap: 1rem;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

.search-submit {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s;
}

.search-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.3);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1200px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 992px) {
    body {
        padding-top: 75px;
    }
    
    .top-announcement-bar {
        font-size: 0.8125rem;
        padding: 0.625rem 0;
    }
    
    .main-header {
        top: 40px;
    }
    
    .main-navigation {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header-container {
        gap: 1rem;
    }
    
    .logo-container {
        min-width: 120px;
    }
    
    .contact-btn {
        display: none;
    }
}

@media (max-width: 768px) {
    .announcement-text span {
        font-size: 0.75rem;
    }
    
    .social-link {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .search-modal-content {
        padding: 2rem;
    }
    
    .search-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .announcement-text {
        gap: 0.5rem;
    }
    
    .announcement-icon {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    .logo-container {
        min-width: 100px;
    }
    
    .search-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}