/* ========================================
   HEADER MODERN - Sidebar Style
   ======================================== */

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

.header-modern {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    border-bottom: 2px solid rgba(255, 193, 7, 0.3);
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
}

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

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

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

.hamburger-btn {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: none;
}

.hamburger-btn:focus {
    outline: none;
    box-shadow: none;
}

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

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

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

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    padding: 0;
    margin: 0;
}

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

.logo-text {
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
}

/* ========================================
   PROFILE ICON (Mobile & Desktop)
   ======================================== */

.header-profile-icon {
    display: none;
}

/* Profile Button Group - Toggle Style */
.profile-button-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 30px;
    padding: 3px;
    gap: 0;
}

.btn-profile-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    font-weight: 700;
    font-size: 1.3rem;
    color: #fff;
    flex-shrink: 0;
}

.btn-profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.btn-profile-avatar i.fa-user-circle {
    font-size: 1.8rem;
    color: #fff;
}

.btn-profile-avatar span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.btn-profile-dropdown {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    transition: all 0.3s;
    margin-left: 2px;
    color: rgba(255, 255, 255, 0.8);
    flex-shrink: 0;
}

.btn-profile-dropdown:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-profile-dropdown:focus,
.btn-profile-avatar:focus {
    outline: none;
}

.btn-profile-dropdown i {
    font-size: 0.9rem;
}

/* Profile Dropdown - Sidebar Style */
.profile-dropdown {
    min-width: 240px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: none;
    margin-top: 0.5rem;
    background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
    position: absolute !important;
    right: 0 !important;
    left: auto !important;
    padding: 0.5rem 0;
    list-style: none !important;
}

.profile-dropdown li {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

.profile-dropdown .dropdown-item {
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.3s;
    text-decoration: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-dropdown .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    padding-left: 1.4rem;
}

.profile-dropdown .dropdown-item i {
    width: 22px;
    text-align: center;
    font-size: 1rem;
}

.profile-dropdown .dropdown-header {
    padding: 0.85rem 1.25rem;
    font-weight: 600;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.profile-dropdown .dropdown-header small {
    color: rgba(255, 255, 255, 0.7);
}

.profile-dropdown .dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-dropdown .text-danger {
    color: #ff6b6b !important;
}

.profile-dropdown .text-danger:hover {
    background: rgba(255, 107, 107, 0.15) !important;
}

/* ========================================
   SIDEBAR MENU (Mobile Offcanvas)
   ======================================== */

.sidebar-menu {
    background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
    width: 280px;
}

.sidebar-menu .offcanvas-header {
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    padding: 1rem 1.25rem;
}

.sidebar-menu .offcanvas-body {
    padding: 0;
}

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

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

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sidebar-nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

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

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

.desktop-menu {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.desktop-menu .navbar-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Main nav items - Center */
.desktop-menu .main-nav {
    flex: 1;
    justify-content: center;
    gap: 1.25rem;
}

/* Auth items - Right */
.desktop-menu .auth-items {
    flex-shrink: 0;
    margin-left: auto;
    gap: 0.75rem;
}

.desktop-menu .nav-item {
    position: relative;
}

.desktop-menu .nav-link {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.desktop-menu .nav-link:hover,
.desktop-menu .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.desktop-menu .nav-link i {
    font-size: 0.9rem;
}

/* Desktop Dropdown - Dark Style */
.desktop-menu .dropdown-menu {
    border: none;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    padding: 0;
    margin-top: 0.5rem;
    min-width: 240px;
    background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
    display: none !important;
    position: absolute !important;
    list-style: none !important;
    overflow: hidden;
}

.desktop-menu .dropdown-menu li {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

.desktop-menu .dropdown-menu.show {
    display: block !important;
}

.desktop-menu .dropdown-item {
    padding: 0.9rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    transition: all 0.25s;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.desktop-menu .dropdown-item i {
    width: 22px;
    text-align: center;
    font-size: 1rem;
}

.desktop-menu .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
    padding-left: 1.4rem;
}

.desktop-menu .dropdown-header {
    padding: 1rem 1.25rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.desktop-menu .dropdown-header small {
    color: rgba(255, 255, 255, 0.75);
}

.desktop-menu .dropdown-divider {
    margin: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
}

.desktop-menu .text-danger {
    color: #ff6b6b !important;
}

.desktop-menu .text-danger:hover {
    background: rgba(255, 107, 107, 0.18) !important;
    color: #ff8585 !important;
}

/* Desktop Auth Buttons */
.desktop-menu .btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.3s;
}

.desktop-menu .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.9);
}

.desktop-menu .btn-light {
    background: #fff;
    color: #1561ac;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    border-radius: 6px;
    border: none;
}

.desktop-menu .btn-light:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Desktop User Button */
.btn-user-desktop {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #fff;
}

.user-avatar-desktop {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

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

/* Desktop (≥992px) - Menu centered */
@media (min-width: 992px) {
    .header-container {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    .hamburger-btn {
        display: none !important;
    }
    
    .header-profile-icon {
        display: none !important;
    }
    
    .header-logo {
        flex-shrink: 0;
    }
    
    .desktop-menu {
        display: flex !important;
        flex: 1 !important;
        justify-content: space-between !important;
        gap: 2rem !important;
    }
    
    .desktop-menu .main-nav {
        flex: 1 !important;
        justify-content: center !important;
    }
    
    .desktop-menu .auth-items {
        margin-left: auto !important;
    }
}

/* Mobile (<992px) - Grid Layout */
@media (max-width: 991px) {
    .header-container {
        padding: 0.75rem 1rem;
        display: grid !important;
        grid-template-columns: 40px 1fr 50px !important;
        gap: 0.5rem !important;
        align-items: center !important;
    }
    
    /* Hamburger - Grid Column 1 */
    .hamburger-btn {
        display: block !important;
        grid-column: 1 !important;
    }
    
    /* Logo - Grid Column 2 (center) */
    .header-logo {
        grid-column: 2 !important;
        justify-self: center !important;
        position: relative !important;
        transform: none !important;
    }
    
    .logo-img {
        height: 38px;
    }
    
    /* Profile Icon - Grid Column 3 (right) - FORCE CLICKABLE */
    .header-profile-icon {
        display: block !important;
        grid-column: 3 !important;
        justify-self: end !important;
        position: relative !important;
        z-index: 99999 !important;
    }
    
    .header-profile-icon,
    .header-profile-icon *,
    .header-profile-icon .dropdown,
    .header-profile-icon .btn-profile-icon {
        pointer-events: auto !important;
    }
    
    .header-profile-icon .profile-button-group {
        display: flex !important;
        align-items: center !important;
        background: rgba(0, 0, 0, 0.4) !important;
        border-radius: 30px !important;
        padding: 3px !important;
        gap: 0 !important;
    }
    
    .header-profile-icon .btn-profile-avatar {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
    }
    
    .header-profile-icon .btn-profile-dropdown {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* Profile dropdown on mobile - FORCE SHOW */
    .header-profile-icon .profile-dropdown {
        position: fixed !important;
        right: 1rem !important;
        top: 65px !important;
        left: auto !important;
        z-index: 100000 !important;
    }
    
    .header-profile-icon .profile-dropdown.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Hide desktop menu */
    .desktop-menu {
        display: none !important;
    }
}

/* Small Mobile (<576px) */
@media (max-width: 575px) {
    .header-container {
        padding: 0.65rem 0.85rem;
    }
    
    .logo-img {
        height: 35px;
    }
    
    .btn-profile-icon {
        font-size: 1.6rem;
    }
    
    .user-avatar-icon {
        width: 36px;
        height: 36px;
    }
}

/* Large Desktop (≥1200px) */
@media (min-width: 1200px) {
    .header-container {
        max-width: 1320px;
        padding: 0.85rem 1.5rem;
    }
}
