/**
 * GameShare88 Header - Stylesheet
 * Cyberpunk / Gaming Dark Theme Aesthetic
 */

:root {
    --gs-bg-main: #080d1a;
    --gs-bg-header: rgba(8, 13, 26, 0.88);
    --gs-bg-surface: #10192d;
    --gs-bg-card: #15223a;
    --gs-border-subtle: rgba(255, 255, 255, 0.08);
    --gs-border-hover: rgba(0, 210, 255, 0.4);
    --gs-cyan: #00d2ff;
    --gs-blue-active: #2563eb;
    --gs-purple: #a855f7;
    --gs-text-title: #ffffff;
    --gs-text-body: #e2e8f0;
    --gs-text-muted: #94a3b8;
    --gs-glow-cyan: 0 0 16px rgba(0, 210, 255, 0.35);
    --gs-glow-blue: 0 0 18px rgba(37, 99, 235, 0.45);
    --gs-font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   Base Header Container
   ========================================================================== */
.gs-header {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
    align-self: stretch;
    background: var(--gs-bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--gs-border-subtle);
    font-family: var(--gs-font-main);
    box-sizing: border-box;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    z-index: 1000;
}

/* Đảm bảo khi nhúng trong Elementor Flexbox / Widget Container thì tự bung 100% chiều rộng */
.elementor-widget-html:has(.gs-header),
.elementor-widget-shortcode:has(.gs-header),
.elementor-widget:has(.gs-header),
.elementor-widget-container:has(.gs-header) {
    width: 100% !important;
    max-width: 100% !important;
    flex-grow: 1 !important;
    align-self: stretch !important;
}

.gs-header *,
.gs-header *::before,
.gs-header *::after {
    box-sizing: border-box;
}

.gs-header--sticky {
    position: sticky;
    top: 0;
}

.gs-header--scrolled {
    background: rgba(6, 10, 22, 0.96);
    border-bottom-color: rgba(0, 210, 255, 0.15);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7), 0 0 15px -3px rgba(0, 210, 255, 0.1);
}

.gs-header-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-sizing: border-box;
}

/* ==========================================================================
   1. Brand Logo
   ========================================================================== */
.gs-header-col--logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.gs-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gs-logo-link:hover {
    transform: scale(1.03);
}

.gs-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.5));
}

.gs-logo-brand {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: var(--gs-text-title);
    text-transform: uppercase;
}

.gs-logo-highlight {
    background: linear-gradient(135deg, #00d2ff 0%, #3b82f6 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-left: 1px;
}

/* ==========================================================================
   2. Desktop Navigation Menu
   ========================================================================== */
.gs-header-col--nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.gs-nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.gs-menu-item {
    margin: 0;
    padding: 0;
}

.gs-nav-link,
.gs-nav-menu a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--gs-text-muted);
    text-decoration: none;
    border-radius: 999px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.gs-link-icon {
    display: flex;
    align-items: center;
}

.gs-nav-link:hover,
.gs-nav-menu a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.gs-menu-item--active .gs-nav-link,
.gs-nav-menu .current-menu-item > a,
.gs-nav-menu .current_page_item > a,
.gs-nav-menu .current-menu-ancestor > a {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: var(--gs-glow-blue);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   3. Search & Actions (Right Column)
   ========================================================================== */
.gs-header-col--actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* Search Wrapper */
.gs-header-search {
    position: relative;
    width: 250px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gs-header-search:focus-within {
    width: 290px;
}

.gs-search-form {
    margin: 0;
    padding: 0;
    position: relative;
    width: 100%;
}

.gs-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.gs-search-input {
    width: 100%;
    height: 40px;
    padding: 0 42px 0 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    font-family: var(--gs-font-main);
    font-size: 13.5px;
    color: var(--gs-text-body);
    outline: none;
    transition: all 0.25s ease;
}

.gs-search-input::placeholder {
    color: #64748b;
    font-weight: 400;
}

.gs-search-input:focus {
    background: rgba(18, 27, 48, 0.95);
    border-color: var(--gs-cyan);
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.25);
    color: #ffffff;
}

.gs-search-submit {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: var(--gs-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s ease, transform 0.2s ease;
}

.gs-search-submit:hover {
    color: var(--gs-cyan);
    transform: translateY(-50%) scale(1.1);
}

/* User Profile Avatar Button */
.gs-profile-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gs-text-muted);
    text-decoration: none;
    transition: all 0.25s ease;
}

.gs-profile-btn:hover {
    color: var(--gs-cyan);
    border-color: var(--gs-cyan);
    background: rgba(0, 210, 255, 0.08);
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.3);
    transform: translateY(-1px);
}

/* ==========================================================================
   Live Search Dropdown
   ========================================================================== */
.gs-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    min-width: 300px;
    background: #0d1527;
    border: 1px solid rgba(0, 210, 255, 0.25);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 210, 255, 0.1);
    z-index: 1100;
    overflow: hidden;
    animation: gsFadeDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.gs-search-loading,
.gs-search-empty {
    padding: 16px;
    text-align: center;
    font-size: 13.5px;
    color: var(--gs-text-muted);
}

.gs-search-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 210, 255, 0.2);
    border-top-color: var(--gs-cyan);
    border-radius: 50%;
    animation: gsSpin 0.7s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes gsSpin {
    to { transform: rotate(360deg); }
}

.gs-search-results-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.gs-search-result-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s ease;
}

.gs-search-result-item a:hover {
    background: rgba(0, 210, 255, 0.08);
}

.gs-search-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--gs-border-subtle);
}

.gs-search-meta {
    flex: 1;
    min-width: 0;
}

.gs-search-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-search-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--gs-text-muted);
}

.gs-search-cat {
    background: rgba(255, 255, 255, 0.07);
    padding: 1px 6px;
    border-radius: 4px;
}

.gs-search-rating {
    color: #f59e0b;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.gs-search-footer-link {
    display: block;
    padding: 10px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--gs-border-subtle);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gs-cyan);
    text-decoration: none;
    transition: background 0.2s ease;
}

.gs-search-footer-link:hover {
    background: rgba(0, 210, 255, 0.12);
}

/* ==========================================================================
   4. Mobile Hamburger Button
   ========================================================================== */
.gs-desktop-only {
    display: flex;
}

.gs-mobile-only {
    display: none;
}

.gs-hamburger-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    cursor: pointer;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0;
    transition: all 0.25s ease;
}

.gs-hamburger-btn:hover {
    background: rgba(0, 210, 255, 0.1);
    border-color: var(--gs-cyan);
}

.gs-hamburger-bar {
    width: 20px;
    height: 2px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active State for Hamburger (X animation) */
.gs-hamburger-btn.is-active .gs-hamburger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.gs-hamburger-btn.is-active .gs-hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.gs-hamburger-btn.is-active .gs-hamburger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   5. Mobile Drawer & Backdrop
   ========================================================================== */
.gs-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 15, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gs-drawer-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

.gs-mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 86%;
    max-width: 360px;
    height: 100vh;
    background: #080d1a;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.85);
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    font-family: var(--gs-font-main);
    box-sizing: border-box;
}

.gs-mobile-drawer.is-open {
    transform: translateX(0);
}

.gs-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--gs-border-subtle);
}

.gs-drawer-close-btn {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.gs-drawer-close-btn:hover {
    color: var(--gs-cyan);
    border-color: var(--gs-cyan);
    background: rgba(0, 210, 255, 0.15);
    transform: scale(1.05);
}

.gs-drawer-search {
    padding: 16px 20px;
    position: relative;
}

.gs-drawer-search .gs-search-wrapper .gs-search-input {
    height: 44px;
    background: #111a2e;
}

.gs-drawer-nav {
    flex: 1;
    padding: 10px 20px;
}

.gs-drawer-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gs-drawer-menu-list .menu-item {
    margin-bottom: 6px;
}

.gs-drawer-menu-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--gs-text-body);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.gs-menu-item-icon {
    display: flex;
    align-items: center;
    color: var(--gs-cyan);
}

.gs-drawer-menu-list a:hover,
.gs-drawer-menu-list .current-menu-item > a,
.gs-drawer-menu-list .current_page_item > a {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(0, 210, 255, 0.15) 100%);
    color: #ffffff;
    border: 1px solid rgba(0, 210, 255, 0.25);
}

/* Thể loại thịnh hành trong Drawer */
.gs-drawer-quick-categories {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gs-border-subtle);
}

.gs-drawer-section-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--gs-text-muted);
    margin-bottom: 12px;
}

.gs-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gs-chip {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--gs-border-subtle);
    border-radius: 999px;
    font-size: 13px;
    color: var(--gs-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.gs-chip:hover {
    color: #ffffff;
    background: rgba(0, 210, 255, 0.12);
    border-color: var(--gs-cyan);
}

/* Drawer Footer */
.gs-drawer-footer {
    padding: 18px 20px;
    border-top: 1px solid var(--gs-border-subtle);
    background: #060a14;
}

.gs-drawer-profile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    border-radius: 12px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 600;
    box-shadow: var(--gs-glow-blue);
    transition: transform 0.2s ease;
}

.gs-drawer-profile-btn:hover {
    transform: translateY(-2px);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
    .gs-desktop-only,
    .gs-header-col--nav,
    .gs-header-search,
    .gs-profile-btn.gs-desktop-only {
        display: none !important;
    }

    .gs-mobile-only,
    .gs-hamburger-btn {
        display: flex !important;
    }

    .gs-header-container {
        padding: 10px 16px;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .gs-header-col--logo {
        flex: 1 1 auto !important;
    }

    .gs-header-col--actions {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        margin-left: auto !important;
    }

    .gs-logo-brand {
        font-size: 18px;
    }

    .gs-logo-icon svg {
        width: 32px;
        height: 32px;
    }
}
