/* ========================================
   Header CSS Variables (uses same theme)
   ======================================== */
:root {
    --header-dark-1: #0d1b2a;
    --header-dark-2: #1b263b;
    --header-dark-3: #415a77;
    --header-yellow: #ffed00;
    --header-yellow-dark: #ffc300;
    --header-glass: rgba(255, 255, 255, 0.03);
    --header-glass-border: rgba(255, 255, 255, 0.1);
    --header-text: rgba(255, 255, 255, 0.85);
    --header-text-muted: rgba(255, 255, 255, 0.6);
}

/* Override Bootstrap variables for header areas */
.topbar-modern,
.header-modern,
.mobile-menu-modern {
    --bs-link-color-rgb: 255, 237, 0;
    --bs-link-hover-color-rgb: 255, 255, 255;
    --bs-dropdown-link-hover-bg: rgba(255, 237, 0, 0.1);
    --bs-dropdown-link-hover-color: #fff;
    --bs-nav-link-hover-color: #fff;
    --bs-body-bg: transparent;
}

/* ========================================
   Force header wrapper (not children) to have no background
   ======================================== */
body > header {
    background: transparent !important;
    background-color: transparent !important;
}

/* ========================================
   General Link Reset for Header Areas
   ======================================== */
.topbar-modern a,
.header-modern a,
.mobile-menu-modern a {
    text-decoration: none !important;
    background-color: transparent !important;
}

.topbar-modern a:hover,
.topbar-modern a:focus,
.header-modern a:hover,
.header-modern a:focus,
.mobile-menu-modern a:hover,
.mobile-menu-modern a:focus {
    text-decoration: none !important;
    background-color: transparent !important;
}

/* Override Bootstrap dropdown hover bg for header */
.header-modern .dropdown-menu a:hover,
.header-modern .dropdown-menu a:focus,
.header-modern .navbar-nav a:hover,
.header-modern .navbar-nav a:focus {
    background-color: transparent !important;
}

/* Override Bootstrap nav-link hover for header */
.header-modern .navbar .nav-link:hover,
.header-modern .navbar .nav-link:focus {
    background: var(--header-glass) !important;
    background-color: var(--header-glass) !important;
}

/* Force override any Bootstrap/theme link background on hover */
header .topbar-modern a:hover,
header .topbar-modern a:focus,
header .header-modern a:hover,
header .header-modern a:focus,
header .header-modern .navbar-nav .nav-item a:hover,
header .header-modern .navbar-nav .nav-item a:focus,
header .header-modern .navbar-nav .nav-link:hover,
header .header-modern .navbar-nav .nav-link:focus,
.header-modern.navbar-expand-lg .navbar-nav .nav-link:hover,
.header-modern.navbar-expand-lg .navbar-nav .nav-link:focus,
.header-modern .navbar-collapse .navbar-nav .nav-link:hover,
.header-modern .navbar-collapse .navbar-nav .nav-link:focus {
    background: var(--header-glass) !important;
    background-color: var(--header-glass) !important;
    color: #fff !important;
}

/* ========================================
   Top Bar Styles
   ======================================== */
.topbar-modern {
    background: linear-gradient(90deg, #0d1b2a 0%, #1b263b 100%) !important;
    background-color: #0d1b2a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0;
    position: relative;
}

/* Override any Bootstrap/theme background styles */
div.topbar-modern,
.topbar-modern[class],
header .topbar-modern,
body .topbar-modern {
    background: linear-gradient(90deg, #0d1b2a 0%, #1b263b 100%) !important;
    background-color: #0d1b2a !important;
}

.topbar-modern::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 22L10 17V7l10-5 10 5v10l-10 5z' fill='%23ffed00' fill-opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
}

.topbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.topbar-alert {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
}

.alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 20px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

.alert-badge i {
    font-size: 1rem;
}

.hotline-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.hotline-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--header-text-muted);
}

.hotline-number {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--header-glass);
    border: 1px solid var(--header-glass-border);
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--header-yellow) !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.hotline-number:hover,
.hotline-number:focus {
    background: rgba(255, 237, 0, 0.1) !important;
    border-color: rgba(255, 237, 0, 0.3) !important;
    color: var(--header-yellow) !important;
    transform: translateY(-1px);
}

.hotline-number i {
    font-size: 1rem;
}

.hotline-number.whatsapp {
    color: #25d366 !important;
}

.hotline-number.whatsapp:hover,
.hotline-number.whatsapp:focus {
    background: rgba(37, 211, 102, 0.1) !important;
    border-color: rgba(37, 211, 102, 0.3) !important;
    color: #25d366 !important;
}

.hotline-divider {
    width: 1px;
    height: 20px;
    background: var(--header-glass-border);
}

.topbar-close {
    background: var(--header-glass);
    border: 1px solid var(--header-glass-border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--header-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.topbar-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ========================================
   Header Styles
   ======================================== */
.header-modern {
    background: linear-gradient(180deg, rgba(13, 27, 42, 0.98) 0%, rgba(27, 38, 59, 0.95) 100%) !important;
    background-color: #0d1b2a !important;
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Override any Bootstrap/theme background styles */
header.header-modern,
.header-modern[class],
header .header-modern,
body .header-modern,
body header.header-modern {
    background: linear-gradient(180deg, rgba(13, 27, 42, 0.98) 0%, rgba(27, 38, 59, 0.95) 100%) !important;
    background-color: #0d1b2a !important;
}

.header-modern .navbar,
header.header-modern .navbar,
body .header-modern .navbar {
    padding: 12px 0;
    background: transparent !important;
    background-color: transparent !important;
}

.header-modern .navbar-brand {
    padding: 0;
}

.header-modern .logo-light {
    height: 42px;
    transition: all 0.3s ease;
}

.header-modern .navbar-brand:hover .logo-light {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* Navigation Links */
.header-modern .navbar-nav {
    gap: 4px;
}

.header-modern .nav-link {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--header-text) !important;
    padding: 10px 18px;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-modern .nav-link:hover,
.header-modern .nav-link:focus {
    color: #fff !important;
    background: var(--header-glass) !important;
}

.header-modern .nav-link.active {
    color: var(--header-yellow) !important;
    background: rgba(255, 237, 0, 0.1) !important;
}

.header-modern .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--header-yellow);
    border-radius: 3px;
}

.nav-badge {
    padding: 2px 8px;
    background: linear-gradient(135deg, var(--header-yellow) 0%, var(--header-yellow-dark) 100%);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--header-dark-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dropdown Styles */
.header-modern .dropdown-toggle::after {
    border: none;
    content: '\ea5f';
    font-family: 'tabler-icons';
    font-size: 1rem;
    margin-left: 4px;
    transition: transform 0.3s ease;
    vertical-align: middle;
}

.header-modern .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.dropdown-menu-modern {
    background: rgba(13, 27, 42, 0.98) !important;
    backdrop-filter: blur(20px);
    border: 1px solid var(--header-glass-border);
    border-radius: 16px;
    padding: 8px;
    margin-top: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    min-width: 220px;
    --bs-dropdown-link-hover-bg: rgba(255, 237, 0, 0.1);
    --bs-dropdown-link-hover-color: #fff;
}

.dropdown-menu-modern .dropdown-item {
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--header-text) !important;
    padding: 12px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.dropdown-menu-modern .dropdown-item i {
    font-size: 1.1rem;
    color: var(--header-text-muted) !important;
    transition: color 0.3s ease;
}

.dropdown-menu-modern .dropdown-item:hover,
.dropdown-menu-modern .dropdown-item:focus,
.header-modern .dropdown-menu-modern .dropdown-item:hover,
.header-modern .dropdown-menu-modern .dropdown-item:focus,
header .dropdown-menu-modern .dropdown-item:hover,
header .dropdown-menu-modern .dropdown-item:focus {
    background: rgba(255, 237, 0, 0.1) !important;
    background-color: rgba(255, 237, 0, 0.1) !important;
    color: #fff !important;
}

.dropdown-menu-modern .dropdown-item:hover i,
.dropdown-menu-modern .dropdown-item:focus i {
    color: var(--header-yellow) !important;
}

.dropdown-menu-modern .dropdown-item.active {
    background: rgba(255, 237, 0, 0.15) !important;
    color: var(--header-yellow) !important;
}

.dropdown-menu-modern .dropdown-item.active i {
    color: var(--header-yellow) !important;
}

/* Navbar Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-login-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--header-yellow) 0%, var(--header-yellow-dark) 100%);
    border: none;
    border-radius: 10px;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--header-dark-2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login-header::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-login-header:hover::before {
    left: 100%;
}

.btn-login-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 237, 0, 0.3);
}

.btn-login-header i {
    font-size: 1.1rem;
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--header-glass);
    border: 1px solid var(--header-glass-border);
    border-radius: 10px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--header-text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Mobile Toggler */
.header-modern .navbar-toggler {
    border: none;
    padding: 8px;
    background: var(--header-glass);
    border-radius: 10px;
}

.toggler-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
}

.toggler-icon span {
    display: block;
    height: 2px;
    background: var(--header-yellow);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.toggler-icon span:nth-child(2) {
    width: 70%;
}

.navbar-toggler:hover .toggler-icon span:nth-child(2) {
    width: 100%;
}

/* ========================================
   Mobile Menu Styles
   ======================================== */
.mobile-menu-modern {
    background: linear-gradient(180deg, var(--header-dark-1) 0%, var(--header-dark-2) 100%) !important;
    border-left: 1px solid var(--header-glass-border);
    max-width: 320px;
    width: 100%;
}

.mobile-menu-modern .offcanvas-header {
    padding: 20px;
    border-bottom: 1px solid var(--header-glass-border);
}

.mobile-logo img {
    height: 40px;
}

.btn-close-mobile {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--header-glass);
    border: 1px solid var(--header-glass-border);
    border-radius: 10px;
    color: var(--header-text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close-mobile:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-close-mobile i {
    font-size: 1.25rem;
}

.mobile-menu-modern .offcanvas-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.mobile-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-item {
    margin-bottom: 4px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--header-text) !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.mobile-nav-link i {
    font-size: 1.25rem;
    color: var(--header-text-muted) !important;
    width: 24px;
    text-align: center;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
    background: var(--header-glass) !important;
    color: #fff !important;
}

.mobile-nav-link:hover i,
.mobile-nav-link:focus i {
    color: var(--header-yellow) !important;
}

.mobile-nav-link.active {
    background: rgba(255, 237, 0, 0.1) !important;
    color: var(--header-yellow) !important;
}

.mobile-nav-link.active i {
    color: var(--header-yellow) !important;
}

.mobile-badge {
    margin-left: auto;
    padding: 3px 10px;
    background: linear-gradient(135deg, var(--header-yellow) 0%, var(--header-yellow-dark) 100%);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--header-dark-2);
    text-transform: uppercase;
}

.submenu-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.mobile-nav-link[aria-expanded="true"] .submenu-arrow {
    transform: rotate(180deg);
}

.mobile-submenu {
    padding-left: 52px;
    margin-top: 4px;
}

.mobile-submenu-link {
    display: block;
    padding: 10px 16px;
    border-radius: 8px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--header-text-muted) !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
    border-left: 2px solid var(--header-glass-border);
}

.mobile-submenu-link:hover,
.mobile-submenu-link:focus {
    color: #fff !important;
    border-left-color: var(--header-yellow) !important;
    background: var(--header-glass) !important;
}

.mobile-submenu-link.active {
    color: var(--header-yellow) !important;
    border-left-color: var(--header-yellow) !important;
}

.mobile-actions {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--header-glass-border);
}

.btn-mobile-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: var(--header-glass);
    border: 1px solid var(--header-glass-border);
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--header-text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-mobile-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.mobile-login-section {
    background: var(--header-glass);
    border: 1px solid var(--header-glass-border);
    border-radius: 16px;
    padding: 20px;
}

.mobile-login-label {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--header-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
    text-align: center;
}

.mobile-login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mobile-login-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    background: rgba(255, 237, 0, 0.05);
    border: 1px solid rgba(255, 237, 0, 0.2);
    border-radius: 12px;
    font-family: 'Nunito', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--header-text) !important;
    text-decoration: none !important;
    text-align: center;
    transition: all 0.3s ease;
}

.mobile-login-btn i {
    font-size: 1.5rem;
    color: var(--header-yellow) !important;
}

.mobile-login-btn:hover,
.mobile-login-btn:focus {
    background: rgba(255, 237, 0, 0.15) !important;
    border-color: var(--header-yellow) !important;
    color: #fff !important;
    transform: translateY(-2px);
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 991.98px) {
    .header-modern .navbar-collapse {
        display: none !important;
    }
    
    .topbar-alert {
        flex-direction: column;
        gap: 10px;
    }
    
    .hotline-divider {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .topbar-modern {
        padding: 12px 0;
    }
    
    .alert-badge {
        font-size: 0.7rem;
        padding: 5px 10px;
    }
    
    .hotline-number {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}
