/* =========================================
   FragCity Header Component
   Loaded after css/style.css
   Manual-style redesign + sticky top header
========================================= */

:root {
    --header-bg: rgba(11, 18, 32, 0.86);
    --header-bg-2: rgba(15, 23, 42, 0.94);
    --header-border: rgba(96, 165, 250, 0.16);
    --header-border-soft: rgba(148, 163, 184, 0.14);
    --header-shadow: 0 18px 45px rgba(2, 6, 23, 0.28);
    --header-text: #f8fafc;
    --header-muted: #94a3b8;
    --header-blue: #60a5fa;
    --header-blue-2: #38bdf8;
    --header-blue-soft: rgba(59, 130, 246, 0.12);
    --header-blue-soft-2: rgba(14, 165, 233, 0.08);
    --header-red: #f87171;
}

body.mobile-menu-open {
    overflow: hidden;
}

/* =========================================
   User Area / Profile Dropdown
========================================= */

.frag-user-area {
    display: flex;
    align-items: center;
    min-width: 0;
}

.frag-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.frag-user-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0.35rem 0.45rem 0.35rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(11, 18, 32, 0.96));
    color: var(--header-text);
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.18);
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
    font: inherit;
}

.frag-user-trigger:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.32);
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 1), rgba(11, 18, 32, 1));
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.24);
}

.frag-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 32px;
    border: 2px solid rgba(96, 165, 250, 0.24);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}

.frag-username {
    color: var(--header-text);
    font-size: 0.88rem;
    font-weight: 700;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.frag-arrow {
    color: var(--header-muted);
    font-size: 0.75rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.frag-dropdown.open .frag-arrow {
    transform: rotate(180deg);
    color: var(--header-text);
}

.frag-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 275px;
    padding: 8px 0;
    border-radius: 18px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background:
        linear-gradient(180deg, rgba(11, 18, 32, 0.98), rgba(15, 23, 42, 0.98));
    box-shadow:
        0 18px 45px rgba(2, 6, 23, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transform-origin: top right;
    transition:
        opacity 0.18s ease,
        visibility 0.18s ease,
        transform 0.18s ease;
    z-index: 1200;
    overflow: hidden;
}

.frag-dropdown.open .frag-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.frag-drop-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
}

.frag-drop-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(96, 165, 250, 0.65);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.10);
}

.frag-drop-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
    min-width: 0;
}

.frag-drop-name {
    color: var(--header-text);
    font-weight: 800;
    font-size: 0.96rem;
    line-height: 1.4;
}

.frag-drop-steam {
    color: var(--header-muted);
    font-size: 0.75rem;
    direction: ltr;
    background: rgba(0, 0, 0, 0.28);
    padding: 3px 8px;
    border-radius: 999px;
    display: inline-block;
    text-align: center;
}

.frag-drop-divider {
    height: 1px;
    margin: 8px 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(148, 163, 184, 0.16),
        transparent
    );
}

.frag-drop-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition:
        background 0.18s ease,
        color 0.18s ease,
        padding-right 0.18s ease,
        transform 0.18s ease;
    direction: rtl;
}

.frag-drop-link i {
    width: 20px;
    text-align: center;
    color: var(--header-muted);
    transition: color 0.18s ease;
}

.frag-drop-link:hover {
    background:
        linear-gradient(90deg, rgba(59, 130, 246, 0.12), rgba(14, 165, 233, 0.04));
    color: var(--header-text);
    padding-right: 22px;
    transform: translateX(-1px);
}

.frag-drop-link:hover i {
    color: var(--header-blue);
}

.frag-drop-link.logout:hover {
    background: rgba(248, 113, 113, 0.10);
    color: #fecaca;
}

.frag-drop-link.logout:hover i {
    color: var(--header-red);
}

/* Admin panel dropdown (game logo entries, e.g. Counter Strike 2) */
.admin-panel-game-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    /* The mobile hamburger nav already has its own "پنل ادمینی سرور"
       entry, so hide the desktop dropdown trigger to avoid crowding
       the header at narrow widths. */
    #shockAdminPanelDropdown {
        display: none;
    }
}

@media (max-width: 1300px) {
    .admin-panel-label {
        display: none;
    }
}

.frag-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0.45rem 1.15rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.9rem;
    color: #0b1020;
    background: linear-gradient(135deg, var(--header-blue), var(--header-blue-2));
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease;
}

.frag-login-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.03);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.30);
}

.frag-login-btn i {
    color: inherit;
}

/* =========================================
   Main Desktop Header
========================================= */

.shock-header {
    position: sticky;
    top: 0;
    z-index: 1050;
    width: 100%;
    isolation: isolate;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(11, 18, 32, 0.96));
    border-bottom: 1px solid var(--header-border);
    box-shadow: var(--header-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.shock-header::before {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(96, 165, 250, 0.35),
        rgba(56, 189, 248, 0.25),
        transparent
    );
    pointer-events: none;
}

.shock-container {
    width: min(100%, 1600px);
    min-height: 72px;
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
    align-items: center;
    gap: 24px;
    direction: ltr;
}

.shock-brand {
    min-width: 0;
    justify-self: start;
    direction: rtl;
}

.shock-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--header-text);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.7px;
    white-space: nowrap;
}

.shock-logo-link:hover {
    text-decoration: none;
}

.shock-logo-img {
    display: block;
    width: auto;
    height: 38px;
    max-width: 160px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(59, 130, 246, 0.12));
}

.shock-nav {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 8px;
    direction: rtl;
}

.shock-nav-item {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--header-muted);
    text-decoration: none;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.shock-nav-item:hover,
.shock-nav-item.active,
.frag-dropdown.open > .shock-nav-item {
    color: var(--header-text);
    background:
        linear-gradient(180deg, rgba(59, 130, 246, 0.12), rgba(15, 23, 42, 0.76));
    border-color: rgba(96, 165, 250, 0.18);
    transform: translateY(-1px);
}

.shock-nav-item.active {
    box-shadow: inset 0 -2px 0 var(--header-blue);
}

.shock-nav-item i {
    color: var(--header-blue);
}

.shock-user-area-wrapper {
    min-width: 0;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 12px;
    direction: rtl;
}

.shock-user-area-wrapper .action-icon-btn {
    flex: 0 0 auto;
    text-decoration: none;
}

.action-icon-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(11, 18, 32, 0.96));
    color: var(--header-text);
    cursor: pointer;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.14);
}

.action-icon-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.30);
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 1), rgba(11, 18, 32, 1));
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.22);
}

.action-icon-btn i {
    font-size: 1rem;
}

.shock-mobile-toggle {
    display: none;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(11, 18, 32, 0.96));
    color: var(--header-text);
    font: inherit;
    cursor: pointer;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}

.shock-mobile-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.30);
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 1), rgba(11, 18, 32, 1));
}

/* Dropdown refinements for the site header */
.shock-header .frag-dropdown-menu {
    direction: rtl;
    z-index: 1070;
}

.shock-header .shock-nav .frag-dropdown-menu {
    right: 0;
    left: auto;
    min-width: 220px;
}

.shock-header .frag-user-trigger {
    min-height: 42px;
    font: inherit;
    color: var(--header-text);
}

.shock-header .frag-login-btn {
    min-height: 42px;
}

/* =========================================
   Mobile Navigation Drawer
========================================= */

.mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(2, 6, 23, 0.72);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.mobile-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1100;
    width: min(340px, 88vw);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background:
        linear-gradient(180deg, rgba(11, 18, 32, 0.98), rgba(15, 23, 42, 0.98));
    border-left: 1px solid rgba(148, 163, 184, 0.08);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
    direction: rtl;
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 0.24s ease, visibility 0.24s ease;
}

.mobile-nav.open {
    transform: translateX(0);
    visibility: visible;
}

.mobile-nav-header {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex: 0 0 auto;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.10);
    background: rgba(255, 255, 255, 0.02);
}

.mobile-nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--header-text);
    text-decoration: none;
    font-weight: 900;
    letter-spacing: 0.6px;
}

.mobile-nav-logo img {
    display: block;
    width: auto;
    height: 34px;
    max-width: 145px;
    object-fit: contain;
}

.mobile-nav-close {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(11, 18, 32, 0.96));
    color: var(--header-text);
    font: inherit;
    cursor: pointer;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
}

.mobile-nav-link {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 13px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.93rem;
    font-weight: 600;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.mobile-nav-link i {
    width: 22px;
    flex: 0 0 22px;
    text-align: center;
    color: var(--header-blue);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: var(--header-text);
    background: rgba(59, 130, 246, 0.10);
    border-color: rgba(96, 165, 250, 0.16);
    transform: translateX(-1px);
}

.mobile-nav-link.active {
    box-shadow: inset -3px 0 0 var(--header-blue);
}

.mobile-nav-link.logout-link:hover {
    color: #fecaca;
    background: rgba(248, 113, 113, 0.10);
    border-color: rgba(248, 113, 113, 0.14);
}

.mobile-nav-link.logout-link i {
    color: var(--header-red);
}

/* =========================================
   Responsive
========================================= */

@media (max-width: 1100px) {
    .shock-container {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 16px;
        padding: 0 20px;
    }

    .shock-nav {
        display: none;
    }

    .shock-user-area-wrapper {
        grid-column: 2;
    }

    .shock-mobile-toggle {
        display: inline-flex;
    }
}

@media (max-width: 700px) {
    .shock-container {
        min-height: 64px;
        padding: 0 14px;
    }

    .shock-logo-img {
        height: 32px;
    }

    .frag-username {
        display: none;
    }

    .shock-header .frag-user-trigger {
        padding-left: 0.35rem;
    }

    .shock-user-area-wrapper {
        gap: 8px;
    }

    .action-icon-btn {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .shock-mobile-toggle {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }
}

@media (max-width: 480px) {
    .shock-logo-link span {
        display: none;
    }

    .shock-user-area-wrapper {
        gap: 7px;
    }

    .shock-header .frag-login-btn {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .shock-header .frag-login-btn span {
        display: none;
    }

    .shock-header .action-icon-btn {
        width: 36px;
        height: 36px;
    }

    .shock-mobile-toggle {
        width: 36px;
        height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-overlay,
    .mobile-nav,
    .shock-nav-item,
    .mobile-nav-link,
    .frag-user-trigger,
    .frag-dropdown-menu,
    .frag-login-btn,
    .action-icon-btn,
    .shock-mobile-toggle {
        transition: none !important;
    }
}