/**
 * Modern Minimal Header Design - 2025
 * Clean, spacious, and professional header with icon-first approach
 */

/* ================================
   HEADER BASE STYLES
   ================================ */

.header {
    position: relative;
    background-color: var(--background-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.header .headerWrapper {
    padding: 1rem 24px !important;
    display: flex !important;
    align-items: center !important;
}

@media (max-width: 991px) {
    .header .headerWrapper {
        padding: 15px 20px !important;
    }

    .header .mobileMenu-toggle {
        padding-right: 4px;
    }
}

.header .headerWrapper .row {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    width: 100%;
    height: 100%;
}

.header .headerWrapper .row .header-right {
    height: auto !important;
}

.header .headerWrapper .row > [class*="col"] {
    display: flex !important;
    align-items: center !important;
}

/* Logo column - left aligned, vertically centered */
.header .headerWrapper .row > .col-xxl-2,
.header .headerWrapper .row > .col-md-1,
.header .headerWrapper .row > .col-6:first-child {
    justify-content: flex-start !important;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    flex-shrink: 0 !important;
    min-width: 120px;
}

/* Content column - right aligned */
.header .headerWrapper .row > .col-xxl-10,
.header .headerWrapper .row > .col-md-11,
.header .headerWrapper .row > .col-6:last-child {
    justify-content: flex-end !important;
}

/* Logo */
.header__logo {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start;
    height: 100%;
}

.header__logo a {
    display: flex !important;
    align-items: center !important;
    text-decoration: none;
    transition: opacity 0.2s ease;
    height: 100%;
}

.header__logo a:hover {
    opacity: 0.85;
}

.header__logo img {
    max-height: 40px;
    width: auto;
}

/* ================================
   NAVIGATION
   ================================ */

.header__nav {
    margin-right: auto;
    padding-left: 1.5rem;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

.header__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.header__nav ul li {
    position: relative;
    padding: 0 !important;
    display: flex;
    align-items: center;
}

.header__nav ul li a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header__nav ul li a:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--primary-color);
}

/* Active/Current page indicator */
.header__nav ul li.active a,
.header__nav ul li a.active {
    color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb, 0, 7, 105), 0.08);
}

/* Dropdown support */
.header__nav ul li .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 0.5rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.header__nav ul li:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header__nav ul li .dropdown-menu li {
    width: 100%;
}

.header__nav ul li .dropdown-menu li a {
    width: 100%;
    max-width: none;
}

/* Smart Nav "More" Dropdown - Positioned outside nav */
.nav-more-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
}

.nav-more-wrapper .more-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-dark);
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: inherit;
}

.nav-more-wrapper .more-toggle:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--primary-color);
}

.nav-more-wrapper .more-toggle svg {
    transition: transform 0.2s ease;
    margin-left: 2px;
}

.nav-more-wrapper:hover .more-toggle svg {
    transform: rotate(180deg);
}

.nav-more-wrapper .more-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 9999;
    list-style: none;
    border: 1px solid rgba(0,0,0,0.08);
}

.nav-more-wrapper:hover .more-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-more-wrapper .more-dropdown-menu > li {
    padding: 0;
    width: 100%;
    list-style: none;
}

.nav-more-wrapper .more-dropdown-menu > li > a {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
    white-space: nowrap;
    border-radius: 0.375rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-more-wrapper .more-dropdown-menu > li > a:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--primary-color);
}

/* Hide on mobile */
@media (max-width: 991px) {
    .nav-more-wrapper {
        display: none;
    }
}

/* Hide collapsed items */
.collapsed-nav-item {
    display: none !important;
}

/* ================================
   HEADER ACTIONS (Right Side)
   ================================ */

.header__user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header__action-item {
    display: flex;
    align-items: center;
}

/* Icon Button - Base Style */
.header__icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.header__icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--primary-color);
}

.header__icon-btn:active {
    transform: scale(0.95);
}

.header__icon-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--text-dark, #1a2128);
    stroke: var(--text-dark, #1a2128);
}

.header__icon-btn svg path {
    stroke: currentColor;
}

/* Icon button with text variant */
.header__icon-btn--with-text {
    width: auto;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
}

.header__icon-text {
    font-size: 0.9375rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Icon badge (small text beside icon) */
.header__icon-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background-color: var(--primary-color);
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    border-radius: 9px;
    border: 2px solid var(--background-primary);
}

/* Link Button (Sign In) */
.header__link-btn {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.header__link-btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--primary-color);
}

/* CTA Button (Sign Up) */
.header__cta-btn {
    padding: 0.5rem 1.25rem !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    border-radius: 0.5rem !important;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.2s ease !important;
}

.header__cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
}

/* User Button (Logged in user) */
.header__user-btn {
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.9375rem !important;
    font-weight: 500 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    white-space: nowrap;
}

.header__user-btn svg {
    stroke: white;
}

.header__user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ================================
   SEARCH
   ================================ */

.header__action-item .search {
    position: relative;
}

.header__action-item .search .header__icon-btn .second {
    display: none;
}

.header__action-item .search.active .header__icon-btn .first {
    display: none;
}

.header__action-item .search.active .header__icon-btn .second {
    display: block;
}

.header__action-item .search .search_input {
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%);
    margin-right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.header__action-item .search.active .search_input {
    width: 320px;
    opacity: 1;
    visibility: visible;
}

.header__action-item .search .search_input .s-btn {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.header__action-item .search .search_input input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9375rem;
    color: var(--text-dark);
    min-width: 0;
}

.header__action-item .search .search_input input::placeholder {
    color: var(--text-light);
}

/* Search dropdown */
.header__action-item .search .dropdown_menu.search__alt-item {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: 360px;
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1001;
}

/* ================================
   LANGUAGE & CURRENCY SELECTOR
   ================================ */

.language-currency-selector .header__icon-btn {
    position: relative;
}

/* Modern Language/Currency Modal Styles */
.language-currency-modal {
    max-width: 500px;
}

.language-currency-content {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.language-currency-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.language-currency-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
}

.language-currency-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-currency-close:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-dark);
}

.language-currency-nav {
    position: relative;
    display: flex;
    padding: 0 1.5rem;
    background-color: rgba(0, 0, 0, 0.02);
}

.language-currency-nav .nav-container {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.language-currency-nav .nav-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.language-currency-nav .nav-tab:hover {
    color: var(--text-dark);
}

.language-currency-nav .nav-tab.active {
    color: var(--primary-color);
}

.language-currency-nav .nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

.language-currency-body {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.2s ease;
}

.tab-panel.active {
    display: block;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}

.option-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

.option-item.active {
    background-color: rgba(var(--primary-color-rgb, 0, 7, 105), 0.04);
    border-color: var(--primary-color);
}

.option-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
}

.option-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.currency-symbol {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
}

.option-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.option-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-dark);
}

.option-sublabel {
    font-size: 0.8125rem;
    color: var(--text-gray);
}

.option-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    opacity: 0;
    color: var(--primary-color);
    transition: opacity 0.2s ease;
}

.option-item.active .option-check {
    opacity: 1;
}

/* ================================
   USER DROPDOWN
   ================================ */

.dropdown_box {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 280px;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    list-style: none;
}

.dropdown_toggle.active + .dropdown_box,
.dropdown_toggle:hover + .dropdown_box,
.dropdown_box:hover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown_box .user-box {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dropdown_box .user-box .top {
    text-decoration: none;
    color: var(--text-dark);
}

.dropdown_box .user-box .top:hover .name {
    color: var(--primary-color);
}

.dropdown_box .user-balance {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--primary-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #fff;
}

.dropdown_box .user-balance .count {
    font-weight: 600;
    color: #fff;
}

/* Mobile menu user balance - white text on primary background */
.mobileMenu .user-balance {
    background: var(--primary-color) !important;
    color: #fff !important;
}

.mobileMenu .user-balance .count {
    color: #fff !important;
}

.dropdown_box li {
    list-style: none;
}

.dropdown_box li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.dropdown_box li a:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--primary-color);
}

.dropdown_box li a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ================================
   MOBILE MENU TOGGLE
   ================================ */

.mobileMenu-toggle {
    display: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.mobileMenu-toggle:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* ================================
   RESPONSIVE BREAKPOINTS
   ================================ */

/* Tablet and below - Hide navigation, show hamburger */
@media (max-width: 1199px) {
    .header__nav {
        display: none !important;
    }

    .mobileMenu-toggle {
        display: block;
    }

    .header__action-item .search.active .search_input {
        width: 260px;
    }

    .header__icon-text,
    .header__user-name {
        display: none;
    }

    .header__icon-btn--with-text {
        width: 40px;
        padding: 0;
    }

    .header__user-btn {
        padding: 0.5rem !important;
        min-width: 40px;
    }
}

/* Mobile - Compact everything */
@media (max-width: 767px) {
    .header .headerWrapper {
        padding: 0.75rem 0;
    }

    .header__logo img {
        max-height: 32px;
    }

    .header__user {
        gap: 0.25rem;
    }

    .header__action-item .search.active .search_input {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        margin: 0;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        transform: none;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

    .header__action-item .search .dropdown_menu.search__alt-item {
        position: fixed;
        top: 57px;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0;
    }

    .header__link-btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.625rem;
    }

    .header__cta-btn {
        font-size: 0.875rem !important;
        padding: 0.5rem 1rem !important;
    }
}

/* Small mobile */
@media (max-width: 575px) {
    .header__icon-badge {
        display: none;
    }

    .header__link-btn {
        padding: 0.375rem 0.5rem;
    }

    .header__cta-btn {
        padding: 0.375rem 0.75rem !important;
    }
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   UTILITY CLASSES
   ================================ */

.header-right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.5rem;
    flex-wrap: nowrap !important;
}

.header-right .header__nav {
    flex: 1;
    min-width: 0;
}

.header-right .header__user {
    flex-shrink: 0;
}

/* Prevent text selection on interactive elements */
/* Mobile Menu Search Dropdown */
.mobileMenu .item-search .dropdown_menu.search__alt-item {
    position: absolute !important;
    top: 100%;
    left: 0;
    right: 0;
    width: 100% !important;
    margin-top: 0.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
    background: #fff;
}

.mobileMenu .item-search .dropdown_menu.search__alt-item.first-alt-item {
    display: none;
}

.mobileMenu .item-search .dropdown_menu.search__alt-item[style*="display: block"] {
    display: block !important;
}

/* Prevent text selection on interactive elements */
.header__icon-btn,
.header__user-btn,
.header__cta-btn,
.header__link-btn,
.mobileMenu-toggle {
    user-select: none;
    -webkit-user-select: none;
}

/* Focus styles for accessibility */
.header__icon-btn:focus-visible,
.header__user-btn:focus-visible,
.header__cta-btn:focus-visible,
.header__link-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth scrolling when header is sticky */
.header.sticky {
    position: sticky;
    top: 0;
    background-color: rgba(var(--background-primary-rgb, 253, 253, 253), 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
