/* assets/css/header.css - Premium Solid Full-Width Header styling */

.kt-wrapper-header-offset {
    padding-top: 20px !important;
}

/* Chuẩn hóa khoảng cách đỉnh trang cho các view con (trừ trang chủ có hero full banner) */
.page-wrapper:not(.home-page-wrapper),
.profile-wrapper,
.getkey-page-wrapper {
    padding-top: 16px !important;
}
@media (min-width: 768px) {
    .page-wrapper:not(.home-page-wrapper),
    .profile-wrapper,
    .getkey-page-wrapper {
        padding-top: 20px !important;
    }
}

#header {
    position: fixed;
    top: 0;
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid #E5E7EB;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    z-index: 1000 !important;
    transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, background-color;
}

/* Dark mode compatibility */
.dark #header {
    background: #121214;
    border-bottom: 1px solid #27272a;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Sticky state */
#header.header-sticky {
    height: 64px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.dark #header.header-sticky {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Centered Header Content Container */
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 48px; /* Equivalent to px-12 */
}

@media (max-width: 1024px) {
    .header-container {
        padding: 0 24px; /* Equivalent to px-6 */
    }
}

/* Centered Navigation Menu */
.header-nav-menu {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 32px; /* Set layout spacing to 32px */
    margin: 0 auto;
    font-weight: 700;
    font-size: 0.8125rem; /* Equivalent to text-sm */
    letter-spacing: 0.05em;
}

@media (min-width: 1024px) {
    .header-nav-menu {
        display: flex;
    }
}

/* Logo styling */
.header-logo {
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
}
.header-logo img {
    height: 34px !important; /* Proper logo scale */
}
.header-logo:hover {
    transform: scale(1.02);
    opacity: 0.95;
}

/* Premium Navigation Links */
.nav-menu-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 70px;
    color: var(--foreground, #334155);
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    padding: 0 4px;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s ease;
}

.dark .nav-menu-link {
    color: #cbd5e1;
}

.nav-menu-link:hover {
    color: var(--primary, #22c55e) !important;
}

/* Bottom border active indicator - Anchored flush to header bottom */
.nav-menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary, #22c55e);
    border-radius: 3px 3px 0 0;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-menu-link:hover::after {
    transform: scaleX(1);
}

/* Active navigation link */
.nav-menu-link.active-link {
    color: var(--primary, #22c55e) !important;
}
.nav-menu-link.active-link::after {
    transform: scaleX(1);
}

/* Dropdown styling */
.nav-dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px) scale(0.98);
    transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, opacity;
}

.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
}

.group:hover > .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* User profile triggers & dropdowns */
.user-balance-badge {
    background: rgba(34, 197, 94, 0.1);
    color: var(--primary, #22c55e);
    border: 1px solid rgba(34, 197, 94, 0.25);
    padding: 0.4rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.775rem;
    font-weight: 700;
    transition: background-color 0.2s ease, transform 0.2s ease;
    will-change: transform;
}

.user-balance-badge:hover {
    background: rgba(34, 197, 94, 0.18);
    transform: translateY(-1px);
}

/* Login button redesign */
.btn-login-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: 1.5px solid rgba(229, 231, 235, 0.8);
    color: var(--foreground, #0f172a);
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 12px;
    text-decoration: none;
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
    will-change: transform;
}

.dark .btn-login-modern {
    border-color: rgba(63, 63, 70, 0.6);
}

@media (hover: hover) {
    .btn-login-modern:hover {
        background-color: color-mix(in srgb, var(--primary, #22c55e) 12%, transparent) !important;
        border-color: color-mix(in srgb, var(--primary, #22c55e) 30%, transparent) !important;
        color: var(--primary, #22c55e) !important;
        box-shadow: none !important;
        transform: translateY(-1px);
    }
}

/* Avatar Border and Glow */
.user-avatar-container {
    position: relative;
    padding: 1.5px;
    border-radius: 50%;
    background: #E2E8F0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}

.user-avatar-container:hover {
    transform: scale(1.05);
}

/* Premium Search Box */
.header-search-input {
    border: 1px solid rgba(229, 231, 235, 0.8);
    background: rgba(243, 244, 246, 0.8);
    transition: background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: width, background-color, border-color, box-shadow;
}

.dark .header-search-input {
    border-color: rgba(63, 63, 70, 0.6);
    background: rgba(39, 39, 42, 0.8);
}

.header-search-input:focus {
    background: #ffffff;
    border-color: var(--primary, #22c55e);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
    width: 220px !important;
}

.dark .header-search-input:focus {
    background: rgba(24, 24, 27, 0.9);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
}

/* Mobile Sidebar enhancements */
.mobile-sidebar-drawer {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Premium User Profile Dropdown Card */
.profile-dropdown-card {
    background-color: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    width: 250px;
    padding: 16px;
    animation: dropdownFadeIn 0.2s ease-out;
}

.dark .profile-dropdown-card {
    background-color: #151521;
    border: 1px solid #27272a;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* User Balance Box inside Profile Dropdown */
.profile-balance-box {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 10px 14px;
    text-align: left;
}

.dark .profile-balance-box {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Menu Items inside Profile Dropdown - Compact & Sleek */
#profile-dropdown-menu .profile-menu-item {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 6px 10px !important;
    margin: 0 !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #475569 !important;
    text-decoration: none !important;
    transition: all 0.15s ease-in-out !important;
    line-height: 1.25 !important;
    height: auto !important;
    min-height: auto !important;
    box-sizing: border-box !important;
}

#profile-dropdown-menu .profile-menu-item:hover {
    background-color: #f0fdf4 !important;
    color: #16a34a !important;
}

.dark #profile-dropdown-menu .profile-menu-item {
    color: #a1a1aa !important;
}

.dark #profile-dropdown-menu .profile-menu-item:hover {
    background-color: rgba(34, 197, 94, 0.12) !important;
    color: #22c55e !important;
}

#profile-dropdown-menu .profile-menu-item i {
    font-size: 16px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

/* Danger (Logout) override */
#profile-dropdown-menu .profile-menu-item.profile-menu-item-danger {
    color: #ef4444 !important;
}

#profile-dropdown-menu .profile-menu-item.profile-menu-item-danger:hover {
    background-color: #fef2f2 !important;
    color: #dc2626 !important;
}

.dark #profile-dropdown-menu .profile-menu-item.profile-menu-item-danger:hover {
    background-color: rgba(239, 68, 68, 0.12) !important;
    color: #f87171 !important;
}

:root {
    --page-header-title-color: #0f172a;
    --page-header-subtitle-color: #64748b;
    --page-header-icon-bg: #ecfdf5;
    --page-header-icon-border: #bbf7d0;
    --page-header-icon-color: #16a34a;
}

.dark {
    --page-header-title-color: #f8fafc;
    --page-header-subtitle-color: #94a3b8;
    --page-header-icon-bg: rgba(34, 197, 94, 0.16);
    --page-header-icon-border: rgba(34, 197, 94, 0.35);
    --page-header-icon-color: #4ade80;
}

/* ==========================================================================
   MODERN UNIFIED USER PAGE HEADER (Chuẩn mẫu PageHeader từ htdocs_devstore3)
   ========================================================================== */
.page-header-widget {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 14px !important;
    margin-bottom: 0 !important;
}

.page-header-icon-box {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 14px !important;
    background: var(--page-header-icon-bg, #ecfdf5) !important;
    border: 1.5px solid var(--page-header-icon-border, #bbf7d0) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--page-header-icon-color, #16a34a) !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.12) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.page-header-icon-box svg {
    width: 24px !important;
    height: 24px !important;
    display: block !important;
}

.page-header-icon-box:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2) !important;
}

.dark .page-header-icon-box {
    background: var(--page-header-icon-bg, rgba(34, 197, 94, 0.16)) !important;
    border-color: var(--page-header-icon-border, rgba(34, 197, 94, 0.35)) !important;
    color: var(--page-header-icon-color, #4ade80) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.page-header-title {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: var(--page-header-title-color, #0f172a) !important;
    line-height: 1.25 !important;
    margin: 0 0 2px 0 !important;
    letter-spacing: -0.02em !important;
}

.dark .page-header-title {
    color: var(--page-header-title-color, #f8fafc) !important;
}

.page-header-subtitle {
    font-size: 13.5px !important;
    color: var(--page-header-subtitle-color, #64748b) !important;
    margin: 0 !important;
    line-height: 1.4 !important;
    font-weight: 450 !important;
    max-width: 580px !important;
}

.dark .page-header-subtitle {
    color: var(--page-header-subtitle-color, #94a3b8) !important;
}

@media (max-width: 576px) {
    .page-header-widget {
        gap: 12px !important;
    }
    .page-header-icon-box {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        border-radius: 12px !important;
    }
    .page-header-icon-box svg {
        width: 21px !important;
        height: 21px !important;
    }
    .page-header-title {
        font-size: 18px !important;
    }
    .page-header-subtitle {
        font-size: 12.5px !important;
    }
}
