/* FullMoon MMO - Navbar Component */

/* Top Header */
.header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    height: calc(var(--header-height) + var(--safe-area-top));
    padding: 0 var(--spacing-md);
    padding-top: var(--safe-area-top);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    z-index: var(--z-fixed);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    gap: var(--spacing-sm);
}

.header__left,
.header__right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

.header__left {
    justify-self: start;
}

.header__center {
    justify-self: center;
    text-align: center;
    min-width: 0;
}

.header__right {
    justify-self: end;
}

.header-player {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--color-text-highlight);
    text-decoration: none;
}

.header-player__avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.2);
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.45);
}

.header-player__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.1;
}

.header-player__name {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 94px;
}

.header-player__lvl {
    font-size: 10px;
    color: var(--color-text-muted);
}

.header-back-compact {
    min-width: 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
    line-height: 1;
}

.header-action-btn {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.4);
    color: var(--color-text-highlight);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.header-action-btn:hover {
    border-color: rgba(212, 175, 55, 0.45);
    box-shadow: 0 0 14px rgba(212, 175, 55, 0.2);
}

.header-action-btn__icon {
    font-size: 16px;
    line-height: 1;
}

.header-action-btn__badge {
    position: absolute;
    top: -6px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--theme-primary);
    color: var(--color-white);
    font-size: 10px;
    line-height: 16px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.chrome-modal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.header__logo {
    font-family: var(--font-family-display);
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text-highlight);
    background: linear-gradient(to bottom, #d4af37, #8a7008);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.header__title {
    font-family: var(--font-family-display);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text-highlight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header__stats {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: 700;
}

.header__stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: var(--border-radius-full);
}

.header__stat-icon {
    font-size: var(--font-size-base);
}

/* Bottom Navbar */
.navbar {
    position: fixed;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    height: calc(var(--navbar-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: rgba(10, 10, 12, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--theme-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: var(--z-fixed);
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
}

.navbar::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--theme-accent), transparent);
    opacity: 0.5;
}

.navbar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    min-width: var(--touch-target);
    height: 100%;
    position: relative;
}

.navbar__item:hover {
    color: var(--color-text);
}

.navbar__item--active {
    color: var(--theme-accent);
    border-radius: var(--border-radius-md);
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.22) inset,
        0 0 18px rgba(212, 175, 55, 0.18);
}

.navbar__item--active .navbar__icon {
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

.navbar__item--active::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.4) 0%, transparent 70%);
    opacity: 0.6;
}

.navbar__item--ready {
    color: #ffe79b;
    box-shadow:
        0 0 0 1px rgba(255, 231, 155, 0.3) inset,
        0 0 18px rgba(255, 231, 155, 0.28);
    animation: readyPulse 1.6s ease-in-out infinite;
}

.subnavbar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--navbar-height) + var(--safe-area-bottom));
    width: 100%;
    max-width: var(--max-width);
    height: var(--subnavbar-height, 56px);
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: var(--spacing-xs);
    padding: 0 var(--spacing-sm);
    background: rgba(10, 10, 12, 0.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    z-index: var(--z-fixed);
}

.subnavbar::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--theme-accent), transparent);
    opacity: 0.42;
}

.subnavbar__item {
    flex: 1;
    min-width: 0;
    height: 40px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subnavbar__item:hover {
    color: var(--color-text);
    border-color: rgba(255, 255, 255, 0.18);
}

.subnavbar__item--active {
    color: var(--theme-accent);
    border-color: rgba(212, 175, 55, 0.32);
    box-shadow:
        0 0 0 1px rgba(212, 175, 55, 0.18) inset,
        0 0 16px rgba(212, 175, 55, 0.2);
}

.subnavbar__item--ready {
    color: #ffe79b;
    border-color: rgba(255, 231, 155, 0.45);
    box-shadow:
        0 0 0 1px rgba(255, 231, 155, 0.22) inset,
        0 0 16px rgba(255, 231, 155, 0.22);
    animation: readyPulse 1.6s ease-in-out infinite;
}

.subnavbar__item:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(212, 175, 55, 0.32),
        0 0 16px rgba(212, 175, 55, 0.2);
}

.navbar__icon {
    font-size: 1.5rem;
    transition: transform var(--transition-bounce);
}

.navbar__label {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.navbar__item:focus-visible,
.header a:focus-visible,
.header button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--theme-accent);
    border-radius: var(--border-radius-md);
}

/* Badge (for notifications) */
.navbar__badge {
    position: absolute;
    top: 8px;
    right: calc(50% - 14px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--theme-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-full);
    font-size: 9px;
    font-weight: 700;
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.status-overlay {
    position: fixed;
    top: calc(var(--safe-area-top) + var(--header-height) - 8px);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - (var(--spacing-md) * 2));
    max-width: calc(var(--max-width) - (var(--spacing-md) * 2));
    z-index: calc(var(--z-fixed) + 1);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.status-overlay--visible {
    opacity: 1;
}

.status-overlay--has-action {
    pointer-events: auto;
}

.status-overlay__track-wrap {
    display: grid;
    gap: 6px;
}

.status-overlay__track {
    position: relative;
    height: 20px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.65);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.status-overlay__fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    transition: width 250ms linear;
}

.status-overlay--mana .status-overlay__fill {
    background: linear-gradient(90deg, #0d7bc9, #3da7e8);
}

.status-overlay--time .status-overlay__fill {
    background: linear-gradient(90deg, #b53737, #e9753e);
}

.status-overlay__label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

.status-overlay__action {
    min-height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(255, 231, 155, 0.42);
    background: rgba(14, 14, 18, 0.9);
    color: #ffe79b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0 10px;
}

.status-overlay__action:hover {
    border-color: rgba(255, 231, 155, 0.6);
    box-shadow: 0 0 12px rgba(255, 231, 155, 0.2);
}

.status-overlay__action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.status-overlay__ready {
    font-size: 11px;
    font-weight: 700;
    color: #ffe79b;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}

@keyframes readyPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.12); }
}

@media (max-width: 360px) {
    .header {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
        gap: 4px;
    }

    .header__title {
        font-size: 14px;
        max-width: 116px;
    }

    .header-player__name {
        max-width: 74px;
        font-size: 11px;
    }

    .header-player__lvl {
        font-size: 9px;
    }

    .header-player__avatar,
    .header-action-btn,
    .header-back-compact {
        width: 30px;
        height: 30px;
        min-width: 30px;
    }

    .header-action-btn__icon {
        font-size: 14px;
    }

    .subnavbar {
        height: 50px;
        padding: 0 6px;
    }

    .subnavbar__item {
        height: 36px;
        font-size: 10px;
        letter-spacing: 0.03em;
        padding: 0 4px;
    }

    .navbar {
        padding-left: 6px;
        padding-right: 6px;
    }

    .navbar__icon {
        font-size: 1.25rem;
    }

    .navbar__label {
        font-size: 9px;
        letter-spacing: 0.02em;
    }

    .status-overlay {
        width: calc(100% - 12px);
        max-width: calc(var(--max-width) - 12px);
        top: calc(var(--safe-area-top) + var(--header-height) - 10px);
    }

    .status-overlay__track {
        height: 18px;
    }

    .status-overlay__label {
        font-size: 10px;
    }

    .status-overlay__action {
        min-height: 24px;
        font-size: 10px;
        padding: 0 8px;
    }

    .status-overlay__action-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .status-overlay__ready {
        font-size: 10px;
        text-align: center;
    }
}

@media (min-width: 768px) {
    body.hud-layout-landscape .header {
        left: 0;
        transform: none;
        max-width: none;
        width: 100%;
        height: 56px;
        padding-left: calc(14px + 170px + 16px);
        padding-right: 20px;
    }

    body.hud-layout-landscape .navbar {
        top: 56px;
        left: 14px;
        bottom: 56px;
        transform: none;
        width: 170px;
        max-width: none;
        height: auto;
        padding: 12px 8px;
        border-right: 2px solid var(--gothic-border, #3d2f35);
        border-top: 0;
        flex-direction: column;
        justify-content: flex-start;
        gap: 0;
    }

    body.hud-layout-landscape .navbar::before {
        display: none;
    }

    body.hud-layout-landscape .navbar__item {
        width: 100%;
        min-height: 0;
        max-height: none;
    }

    body.hud-layout-landscape .navbar__label {
        font-size: 12px;
    }

    body.hud-layout-landscape .subnavbar {
        left: calc(14px + 170px);
        right: 14px;
        bottom: 56px;
        max-width: none;
        width: auto;
        transform: none;
        border-top: 2px solid var(--gothic-border, #3d2f35);
    }

    body.hud-layout-landscape .subnavbar::before {
        display: block;
    }

    body.hud-layout-landscape .subnavbar__item {
        width: auto;
        min-height: var(--touch-target);
        height: 40px;
        justify-content: center;
        padding: 0 8px;
        font-size: 10px;
        letter-spacing: 0.04em;
    }

    body.hud-layout-landscape .status-overlay {
        top: calc(var(--safe-area-top) + var(--header-height) - 8px);
        left: calc(14px + 170px + 50%);
        transform: translateX(-50%);
        width: calc(100% - ((14px + 170px + 14px) * 2));
        max-width: 960px;
    }
}
