/* =============================================================================
   GLOBAL NAVIGATION COMPONENT (navbar.css)
   Contains: Topbar, Navbar, Mega Menu, Search Overlay, Language Toggle
   ============================================================================= */

:root {
    --primary-red: #e41f26;
    --text-dark: #1a1a1a;
    --text-muted: #555;
    --bg-light: #f9f9f9;
    --white: #ffffff;
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    /* Premium industry standard curve */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-soft: 0 15px 40px rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.05);
}

/* =========================
   GLOBAL RESET & BASE
   ========================= */
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--white);
    color: var(--text-dark);
    overflow-x: hidden;
}

/* --- TOP BAR --- */
/* =========================
   TOPBAR & LANGUAGE LOGIC
   ========================= */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 60px;
    height: 40px;
    background: var(--primary-red);
    /* Restored Signature Red */
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
}

.topbar a {
    color: var(--white);
    text-decoration: none;
    opacity: 0.9;
    transition: var(--transition-smooth);
}

.topbar a:hover {
    color: var(--white);
    opacity: 1;
}

.topbar-left,
.topbar-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

/* --- SIMPLE LANGUAGE DROPDOWN --- */
.lang-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 15px;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: 0.3s;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.lang-list {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    list-style: none;
    padding: 10px 0;
    margin: 5px 0 0 0;
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, 10px, 0);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
    z-index: 10002;
    will-change: transform, opacity;
}

.lang-list.show {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
}

.lang-list li {
    padding: 10px 20px;
    color: var(--text-dark);
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

.lang-list li:hover {
    background: #f5f5f5;
    color: var(--primary-red);
}

/* RTL Mode Support */
body.rtl-mode {
    direction: rtl;
    text-align: right;
}

/* --- NAVBAR --- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 60px;
    height: 80px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
}

.logo-img {
    height: 100px;
    width: auto;
    display: block;
}

/* --- NAVIGATION --- */
.menu {
    display: flex;
    align-items: center;
    padding: 0px 0px 0px 100px;
}

.nav-item {
    height: 100%;
    padding: 0 15px;
    display: flex;
    align-items: center;
    position: relative;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item span {
    position: relative;
    padding: 5px 0;
}

.nav-item .fa-chevron-down {
    font-size: 13px;
    margin-left: 5px;
    opacity: 0.8;
}

.lang-btn .fa-chevron-down {
    font-size: 13px;
}

/* Hover Underline */
.nav-item span::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--primary-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-smooth);
}

.nav-item:hover span::after {
    transform: scaleX(1);
}

/* --- MEGA MENU CONTAINER --- */
.mega-menu-wrapper {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate3d(-50%, 15px, 0);
    width: auto;
    max-width: 95vw;
    /* Safety constraint to prevent screen overflow */
    background: var(--white);
    border-radius: 0 0 20px 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    border-top: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-smooth), transform var(--transition-smooth);
    z-index: 1001;
    will-change: transform, opacity;
    backface-visibility: hidden;
    /* overflow: hidden; Removed to prevent highlight box clipping */
}

.mega-menu-wrapper.active {
    opacity: 1;
    transform: translate3d(-50%, 0, 0);
    pointer-events: auto;
}

/* Dynamic Content Containers */
.mega-content {
    display: none;
    padding: 40px;
    gap: 40px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    justify-content: flex-start;
    /* Grouped to the left with consistent gaps */
    max-height: 85vh;
    overflow-y: auto;
    animation: contentFadeIn 0.3s ease forwards;
}

.mega-content.active {
    display: flex;
}

/* Dynamic Widths based on content + 40px padding */
#content-services {
    width: max-content;
    max-width: 95vw;
}

#content-events {
    width: max-content;
    max-width: 95vw;
}

#content-insights {
    width: 800px;
    max-width: 95vw;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- SEARCH OVERLAY --- */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.search-close {
    position: absolute;
    top: 40px;
    right: 40px;
    font-size: 30px;
    color: var(--text-dark);
    cursor: pointer;
    transition: 0.3s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.search-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-red);
    transform: rotate(90deg);
}

.search-container {
    width: 100%;
    max-width: 800px;
    padding: 0 30px;
    text-align: center;
}

.search-box {
    position: relative;
    margin-bottom: 40px;
}

.search-box input {
    width: 100%;
    border: none;
    background: transparent;
    border-bottom: 3px solid var(--text-dark);
    padding: 15px 65px 15px 0;
    /* Increased padding to prevent icon overlap */
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    outline: none;
    transition: 0.3s;
}

.search-box input::placeholder {
    color: #ccc;
}

.search-box input:focus {
    border-bottom-color: var(--primary-red);
}

.search-icon-inner {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--text-dark);
}

.search-suggestions {
    text-align: left;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease 0.2s;
}

.search-overlay.active .search-suggestions {
    opacity: 1;
    transform: translateY(0);
}

.search-suggestions h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
    margin-bottom: 20px;
}

.highlight-content-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
    /* Supports JS animations */
    will-change: transform, opacity;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.suggestion-tags span {
    padding: 10px 20px;
    background: #f5f5f5;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: 0.3s;
}

.suggestion-tags span:hover {
    background: var(--primary-red);
    color: var(--white);
    transform: translateY(-3px);
}

/* Mobile Adjustments for Search */
@media screen and (max-width: 1024px) {

    /* Top Bar adjustments (Aggressive Fix from Git) */
    .topbar {
        padding: 0 10px;
        flex-direction: row !important;
        height: 35px;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .topbar-left {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 8.5px;
        /* Aggressive scaling to prevent wrap */
        white-space: nowrap;
        max-width: 75%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-right {
        display: flex !important;
        justify-content: flex-end;
        align-items: center;
        width: auto;
        max-width: 25%;
    }

    .lang-dropdown {
        margin-right: 0;
    }

    /* Hide one contact detail on very small screens if it still overflows */
    @media screen and (max-width: 360px) {
        .topbar-left span:nth-child(2) {
            display: none;
            /* Hide email on extremely narrow phones */
        }
    }

    .topbar-right a {
        display: none !important;
    }

    .navbar {
        padding: 0 15px;
        height: 70px;
        /* Reduced from 85px for a cleaner look */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        justify-content: center;
        position: sticky;
        /* Frozen/Sticky on scroll */
        top: 0;
        z-index: 1000;
    }

    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1001;
        top: 50%;
        /* Center vertically */
        transform: translate(-50%, -50%);
    }

    .logo-img {
        height: 100px;
        /* Prominent but fits inside 85px navbar */
        width: auto;
        display: block;
        filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.08));
        transition: transform 0.3s ease;
    }

    .nav-toggle {
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        display: flex !important;
    }
}

/* Bridge for hover stability */
.mega-menu-wrapper::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
}

/* Columns & Links */
.column {
    width: 220px;
    flex-shrink: 0;
}

.column h4 {
    margin-bottom: 15px;
    font-size: 15px;
    border-bottom: 2px solid #f5f5f5;
    /* Exact Git Divider */
    padding-bottom: 8px;
    color: var(--text-dark);
}

.column a {
    display: block;
    text-decoration: none;
    color: var(--text-muted);
    margin: 10px 0;
    font-size: 13px;
    transition: all 0.2s;
}

.column a:hover {
    color: var(--primary-red);
    padding-left: 5px;
    /* Exact Original Interactive Feel */
}

/* Bullet List Styling (Restored from Git) */
.bullet-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bullet-list li {
    margin: 0;
    padding: 0;
}

/* Highlights & Dynamic Content (Git Exact Match) */
.highlight {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 12px;
    width: 300px;
    flex-shrink: 0;
    /* margin-left: auto; Removed to prevent sticking to right border */
}

.highlight-content-box {
    transition: opacity 0.3s, transform 0.3s;
    will-change: transform, opacity;
}

.highlight img {
    width: 100%;
    height: 160px;
    border-radius: 8px;
    margin-bottom: 12px;
    object-fit: cover;
}

.highlight strong {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.highlight p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

.insight-card {
    flex: 1;
}

.insight-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 12px;
}

.nav-right-icons {
    display: flex;
    align-items: center;
    gap: 25px;
}

.search-trigger {
    font-size: 18px;
    /* Balanced icon size */
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 50px;
    /* Capsule look on hover */
}

.search-text {
    font-size: 15px;
    font-weight: 500;
}

.search-trigger:hover {
    color: var(--primary-red);
    background: rgba(0, 0, 0, 0.05);
    /* Subtle gray shade */
}

/* --- BUTTONS --- */
.actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 24px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: 0.3s;
}

.btn-dark {
    background: var(--text-dark);
    color: var(--white);
}

.btn-dark:hover {
    background: var(--primary-red);
}

.btn-light {
    background: #f1f1f1;
    color: #333;
}

.btn-light:hover {
    background: #ddd;
}

/* --- RESPONSIVE FIXES --- */
.nav-toggle,
.mobile-actions,
.mobile-submenu {
    display: none !important;
}

@media screen and (max-width: 1024px) {

    /* Top Bar adjustments (Aggressive Fix) */
    .topbar {
        padding: 0 10px;
        flex-direction: row !important;
        height: 35px;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
        width: 100%;
        max-width: 100%;
        overflow: visible;
        /* Changed from hidden to allow dropdown visibility */
        box-sizing: border-box;
    }

    .topbar-left {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 10.5px;
        /* Increased from 8px for clear readability */
        white-space: nowrap;
        max-width: 80%;
        /* Slightly more space */
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-right {
        display: flex !important;
        justify-content: flex-end;
        align-items: center;
        width: auto;
        max-width: 25%;
    }

    .lang-dropdown {
        margin-right: 0;
    }

    /* Hide one contact detail on very small screens if it still overflows */
    @media screen and (max-width: 360px) {
        .topbar-left span:nth-child(2) {
            display: none;
            /* Hide email on extremely narrow phones */
        }
    }

    .topbar-right a {
        display: none !important;
    }

    .navbar {
        padding: 0 15px;
        height: 70px;
        /* Reduced from 85px for a cleaner look */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        justify-content: center;
        position: sticky;
        /* Frozen/Sticky on scroll */
        top: 0;
        z-index: 1000;
    }

    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1001;
        top: 50%;
        /* Center vertically */
        transform: translate(-50%, -50%);
    }

    .logo-img {
        height: 100px;
        /* Prominent but fits inside 85px navbar */
        width: auto;
        display: block;
        filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.08));
        transition: transform 0.3s ease;
    }

    .nav-toggle {
        position: absolute;
        left: 20px;
        top: 50%;
        transform: translateY(-50%);
        display: flex !important;
        z-index: 2001;
        font-size: 20px;
        /* Reduced to match search icon weight */
        cursor: pointer;
        color: var(--text-dark);
    }

    .search-trigger {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 20px;
        /* Matched with hamburger icon */
        z-index: 2001;
        padding: 5px;
        color: var(--text-dark);
    }

    .search-text {
        display: none;
        /* Hide text on mobile */
    }

    .actions {
        display: none !important;
    }

    .mega-menu-wrapper {
        display: none !important;
    }

    .menu {
        position: fixed;
        top: 68.5px;
        left: 0;
        width: 100%;
        height: calc(100vh - 68.5px);
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        display: none;
        opacity: 0;
        z-index: 1999;
        border-top: 1px solid var(--border-light);
        overflow-y: auto;
        align-items: flex-start;
        box-sizing: border-box;
        transform: translate3d(0, -15px, 0);
        /* Pre-position for hardware acceleration */
        transition: opacity var(--transition-smooth), transform var(--transition-smooth);
        will-change: transform, opacity;
        backface-visibility: hidden;
    }

    .menu.mobile-active {
        display: flex;
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }

    .nav-item {
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 15px 0;
        border-bottom: 1px solid var(--border-light);
        flex-direction: column;
        align-items: flex-start;
        transition: background 0.3s;
        /* Removed overflow: hidden to prevent submenu clipping */
    }

    .nav-item span {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        font-size: 16px;
        padding-right: 10px;
    }

    /* Mobile Dropdown Indicator Rotation */
    .nav-item.dropdown span i {
        transition: transform 0.3s;
    }

    .nav-item.dropdown.mobile-open span i {
        transform: rotate(180deg);
        color: var(--primary-red);
    }

    /* Show hint of dropdown content when open */
    .nav-item.mobile-open {
        background: rgba(228, 31, 38, 0.02);
    }

    .mobile-submenu {
        display: none;
        list-style: none;
        padding: 5px 0 10px 25px;
        /* Indented for hierarchy */
        margin: 0;
        width: 100%;
        background: transparent;
        border-radius: 0;
        margin-top: 0;
    }

    .mobile-open .mobile-submenu {
        display: block !important;
        animation: slideInLeft 0.3s ease;
    }

    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translateX(-10px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .mobile-submenu li a {
        display: block;
        padding: 12px 0;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 14px;
        font-weight: 500;
        border-bottom: 1px solid rgba(0, 0, 0, 0.03);
        transition: 0.2s;
    }

    .mobile-submenu li a:hover {
        color: var(--primary-red);
        padding-left: 5px;
    }

    .mobile-submenu li:last-child a {
        border-bottom: none;
    }

    .mobile-actions {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        margin-top: 30px;
        width: 100%;
        box-sizing: border-box;
        align-items: center;
        /* Balanced center alignment */
    }

    .btn {
        width: 78% !important;
        /* Optimized width for mobile balance */
        max-width: 100%;
        box-sizing: border-box;
    }
}