/* ========================================
   HEADER MODERN V2 - Redesigned 2025
   Beautiful, Optimized for All Devices
   ======================================== */

/* ========================================
   NOTIFICATION BANNER
   ======================================== */

.header-notification-banner {
    background: linear-gradient(135deg, #1561ac 0%, #0d47a1 100%);
    color: #fff;
    padding: 0.65rem 0;
    text-align: center;
    position: relative;
    z-index: 1040;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
    font-size: 0.875rem;
}

.header-notification-banner span {
    font-weight: 500;
}

.header-notification-banner i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

/* ========================================
   BASE HEADER V2
   ======================================== */

.header-modern-v2 {
    background: linear-gradient(135deg, #1561ac 0%, #0d47a1 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
    transition: all 0.3s ease;
}

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

.header-container-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 64px;
    gap: 1rem;
}

/* ========================================
   HAMBURGER BUTTON (Mobile)
   ======================================== */

.hamburger-btn-v2 {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.hamburger-btn-v2:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.hamburger-btn-v2:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.hamburger-icon-v2 {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 22px;
}

.hamburger-icon-v2 span {
    display: block;
    height: 2.5px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn-v2[aria-expanded="true"] .hamburger-icon-v2 span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn-v2[aria-expanded="true"] .hamburger-icon-v2 span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn-v2[aria-expanded="true"] .hamburger-icon-v2 span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========================================
   LOGO
   ======================================== */

.header-logo-v2 {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 0;
    margin: 0;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.header-logo-v2:hover {
    transform: scale(1.05);
}

.logo-img-v2 {
    height: 40px;
    width: auto;
    display: block;
    object-fit: contain;
}

.logo-text-v2 {
    color: #fff;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 0.5px;
}

/* ========================================
   DESKTOP MENU
   ======================================== */

.desktop-menu-v2 {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-nav-v2 {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item-v2 {
    position: relative;
}

.nav-link-v2 {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500 !important;
    font-size: 0.9rem !important;
    padding: 0.6rem 1rem !important;
    border-radius: 8px !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    position: relative !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 1000 !important;
}

.nav-link-v2 i {
    font-size: 0.85rem;
}

.nav-link-v2:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-1px);
}

.nav-link-v2.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
}

.nav-link-v2.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

/* Dropdown Toggle - STRONG OVERRIDE */
.dropdown-toggle-v2 {
    position: relative !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 1000 !important;
}

.dropdown-toggle-v2 * {
    pointer-events: none !important;
}

.dropdown-toggle-v2 {
    pointer-events: auto !important;
}

.dropdown-toggle-v2 .fa-chevron-down {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    margin-left: 0.25rem;
}

.dropdown-toggle-v2[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

/* Desktop Dropdown Menu - STRONG OVERRIDE */
.dropdown-menu-v2 {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    padding: 0.5rem 0 !important;
    margin-top: 0.5rem !important;
    min-width: 220px !important;
    background: #fff !important;
    display: none !important;
    position: absolute !important;
    list-style: none !important;
    overflow: visible !important;
    z-index: 9999 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    pointer-events: auto !important;
    top: 100% !important;
    left: 0 !important;
}

.dropdown-menu-v2.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    animation: slideDown 0.3s ease !important;
    pointer-events: auto !important;
}

/* Bootstrap 5 dropdown show class - STRONG OVERRIDE */
.dropdown-menu-v2[data-bs-popper] {
    top: 100% !important;
    left: 0 !important;
    margin-top: 0.5rem !important;
    position: absolute !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
}

/* Ensure Bootstrap 5 show class works - STRONG OVERRIDE */
.dropdown-menu-v2.show[data-bs-popper] {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Override old CSS from style.css */
.header-modern-v2 .dropdown-menu-v2,
.header-modern-v2 .profile-menu-v2 {
    display: none !important;
}

.header-modern-v2 .dropdown-menu-v2.show,
.header-modern-v2 .profile-menu-v2.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
}

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

.dropdown-item-v2 {
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #374151;
    transition: all 0.2s ease;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
    border-bottom: 1px solid #e5e7eb;
}

.dropdown-item-v2:last-child {
    border-bottom: none;
}

.dropdown-item-v2 i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #1561ac;
}

.dropdown-item-v2:hover {
    background: linear-gradient(90deg, #e3f2fd 0%, #f5f5f5 100%);
    color: #1561ac;
    padding-left: 1.5rem;
}

.dropdown-item-v2.text-danger-v2 {
    color: #ef4444;
}

.dropdown-item-v2.text-danger-v2:hover {
    background: linear-gradient(90deg, #fee2e2 0%, #fef2f2 100%);
    color: #dc2626;
}

/* ========================================
   AUTH SECTION
   ======================================== */

.header-auth-v2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Auth Buttons (Guest) */
.auth-buttons-v2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-auth-v2 {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-login-v2 {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-login-v2:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-register-v2 {
    background: #fff;
    color: #1561ac;
    border: 1px solid #fff;
}

.btn-register-v2:hover {
    background: #f8f9fa;
    color: #0d47a1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Profile Section (Logged In) */
.profile-section-v2 {
    position: relative;
}

.profile-dropdown-trigger-v2 {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.4rem 0.75rem !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 50px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1000 !important;
}

.profile-dropdown-trigger-v2 * {
    pointer-events: none !important;
}

.profile-dropdown-trigger-v2 {
    pointer-events: auto !important;
}

.profile-dropdown-trigger-v2:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.profile-avatar-v2 {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #1561ac;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-info-v2 {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.profile-name-v2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.profile-balance-v2 {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

.profile-chevron-v2 {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.profile-dropdown-trigger-v2[aria-expanded="true"] .profile-chevron-v2 {
    transform: rotate(180deg);
}

/* Profile Dropdown Menu - STRONG OVERRIDE */
.profile-menu-v2 {
    right: 0 !important;
    left: auto !important;
    min-width: 280px !important;
    background: #fff !important;
    display: none !important;
    position: absolute !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    opacity: 0 !important;
    visibility: hidden !important;
    top: 100% !important;
    margin-top: 0.5rem !important;
}

.profile-menu-v2.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.profile-menu-v2[data-bs-popper] {
    right: 0 !important;
    left: auto !important;
    margin-top: 0.5rem !important;
    position: absolute !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
    padding: 0.375rem 0 !important;
}

.profile-menu-v2.show[data-bs-popper] {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.dropdown-header-v2 {
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, #1561ac 0%, #0d47a1 100%);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dropdown-avatar-v2 {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}

.dropdown-user-info-v2 {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.dropdown-user-info-v2 strong {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.dropdown-user-info-v2 small {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
}

.dropdown-divider-v2 {
    margin: 0.375rem 0;
    border-top: 1px solid #d1d5db;
    border-bottom: none;
    opacity: 1;
}

/* ========================================
   MOBILE SIDEBAR MENU
   ======================================== */

.sidebar-menu-v2 {
    background: linear-gradient(180deg, #1561ac 0%, #0d47a1 100%);
    width: 300px;
    max-width: 85vw;
}

.offcanvas-header-v2 {
    background: linear-gradient(135deg, #1561ac 0%, #0d47a1 100%);
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.offcanvas-title-v2 {
    margin: 0;
    display: flex;
    align-items: center;
}

.sidebar-logo-v2 {
    height: 38px;
    width: auto;
}

.sidebar-logo-text-v2 {
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.5px;
}

.btn-close-v2 {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.btn-close-v2:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.btn-close-v2 i {
    font-size: 1rem;
}

.offcanvas-body-v2 {
    padding: 0;
    overflow-y: auto;
}

.sidebar-nav-v2 {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.sidebar-nav-item-v2 {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav-link-v2 {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar-nav-link-v2 i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-nav-link-v2:hover,
.sidebar-nav-link-v2.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding-left: 1.5rem;
}

.sidebar-nav-link-v2.active {
    border-left: 3px solid #fff;
    font-weight: 600;
}

.sidebar-nav-link-v2.text-danger-v2 {
    color: #ff6b6b;
}

.sidebar-nav-link-v2.text-danger-v2:hover {
    background: rgba(255, 107, 107, 0.15);
    color: #ff8585;
}

.sidebar-divider-v2 {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.75rem 0;
}

/* ========================================
   OVERRIDE OLD CSS FROM style.css
   ======================================== */

/* Override old .btn-group .dropdown-menu from style.css */
.header-modern-v2 .btn-group .dropdown-menu,
.header-modern-v2 .dropdown-menu:not(.dropdown-menu-v2):not(.profile-menu-v2) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Ensure new dropdowns are not affected by old CSS */
.header-modern-v2 .dropdown-menu-v2,
.header-modern-v2 .profile-menu-v2 {
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
    padding: 0.375rem 0 !important;
    margin-top: 0.5rem !important;
    background: #fff !important;
    border: none !important;
    min-width: 220px !important;
}

/* Override any pointer-events: none from old CSS */
.header-modern-v2 .dropdown-toggle-v2,
.header-modern-v2 .profile-dropdown-trigger-v2,
.header-modern-v2 .nav-link-v2 {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.header-modern-v2 .dropdown-menu-v2.show,
.header-modern-v2 .profile-menu-v2.show {
    pointer-events: auto !important;
    z-index: 9999 !important;
}

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

/* Desktop (≥992px) */
@media (min-width: 992px) {
    .header-container-v2 {
        padding: 0.85rem 1.5rem;
    }
    
    .hamburger-btn-v2 {
        display: none !important;
    }
    
    .desktop-menu-v2 {
        display: flex !important;
    }
    
    .header-logo-v2 {
        margin-right: 2rem;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .header-container-v2 {
        padding: 0.75rem 1rem;
        display: grid;
        grid-template-columns: 45px 1fr auto;
        gap: 0.75rem;
        align-items: center;
    }
    
    .hamburger-btn-v2 {
        display: flex !important;
        grid-column: 1;
    }
    
    .header-logo-v2 {
        grid-column: 2;
        justify-self: center;
    }
    
    .header-auth-v2 {
        grid-column: 3;
        justify-self: end;
    }
    
    .desktop-menu-v2 {
        display: none !important;
    }
    
    .profile-info-v2 {
        display: none;
    }
    
    .profile-dropdown-trigger-v2 {
        padding: 0.4rem;
    }
    
    .auth-buttons-v2 .btn-auth-v2 span {
        display: none;
    }
    
    .auth-buttons-v2 .btn-auth-v2 {
        padding: 0.5rem;
        min-width: 40px;
        justify-content: center;
    }
}

/* Mobile (<768px) */
@media (max-width: 767px) {
    .header-container-v2 {
        padding: 0.65rem 0.85rem;
        min-height: 60px;
    }
    
    .logo-img-v2 {
        height: 36px;
    }
    
    .logo-text-v2 {
        font-size: 1.2rem;
    }
    
    .profile-avatar-v2 {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .header-notification-banner {
        padding: 0.5rem 0;
        font-size: 0.8rem;
    }
    
    .sidebar-menu-v2 {
        width: 280px;
        max-width: 80vw;
    }
}

/* Small Mobile (<576px) */
@media (max-width: 575px) {
    .header-container-v2 {
        padding: 0.6rem 0.75rem;
        gap: 0.5rem;
    }
    
    .logo-img-v2 {
        height: 32px;
    }
    
    .hamburger-btn-v2 {
        width: 36px;
        height: 36px;
    }
    
    .profile-avatar-v2 {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
}

/* Large Desktop (≥1200px) */
@media (min-width: 1200px) {
    .header-container-v2 {
        max-width: 1320px;
        padding: 0.9rem 2rem;
    }
    
    .main-nav-v2 {
        gap: 0.75rem;
    }
    
    .nav-link-v2 {
        padding: 0.65rem 1.25rem;
        font-size: 0.95rem;
    }
}
