/**
 * Header & Navigation
 * Styles for fixed header, title, controls, profile dropdown, and authentication buttons
 */

/* ===================================== */
/* FIXED HEADER                          */
/* ===================================== */

#game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--card-background);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    padding-top: max(15px, env(safe-area-inset-top));
    padding-left: max(25px, env(safe-area-inset-left));
    padding-right: max(25px, env(safe-area-inset-right));
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(13, 148, 136, 0.12);
}

.game-title {
    font-family: 'Fredoka One', 'Rounded Mplus 1c', sans-serif;
    font-size: clamp(24px, 5vw, 36px);
    color: var(--primary-color);
    margin: 0;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: rgba(13, 148, 136, 0.1);
    transition: transform 0.2s ease, opacity 0.2s ease;
    font-weight: 700;
}

#controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===================================== */
/* HEADER ICON BUTTONS                   */
/* ===================================== */

.header-icon-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    background: var(--primary-color);
    color: var(--button-text-color);
    border: none;
    margin: 0;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-color);
    flex-shrink: 0;
}

.header-icon-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px var(--shadow-color);
}

/* Notification Bell Badge */
#notifications-bell {
    position: relative;
}

.notification-bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Legacy sound-toggle (compatibility) */
#sound-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    background: var(--primary-color);
    color: var(--button-text-color);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-color);
}

#sound-toggle:hover {
    background: var(--primary-dark);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px var(--shadow-color);
}

/* ===================================== */
/* STREAK & COIN DISPLAYS                */
/* ===================================== */

.header-streak {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ffd700;
    color: #2c3e50;
    padding: 0 16px;
    margin: 0;
    height: 45px;
    min-width: 70px;
    border-radius: 22.5px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    cursor: default;
    flex-shrink: 0;
}

.header-streak i {
    font-size: 16px;
    color: #f39c12;
    animation: electric-pulse 1.5s infinite;
}

.header-streak:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.header-coins {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ffd700;
    color: #2c3e50;
    padding: 0 16px;
    margin: 0;
    height: 45px;
    min-width: 70px;
    border-radius: 22.5px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    cursor: default;
    flex-shrink: 0;
}

.header-coins i {
    font-size: 16px;
    color: #f39c12;
}

.header-coins:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

/* ===================================== */
/* GUEST & USER CONTROLS                 */
/* ===================================== */

#guest-controls,
#user-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    height: 45px;
}

#user-controls > * {
    flex-shrink: 0;
}

/* ===================================== */
/* PROFILE DROPDOWN                      */
/* ===================================== */

.profile-dropdown-container {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 280px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
    z-index: 1000;
    animation: dropdownFadeIn 0.2s ease;
    overflow: hidden;
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(var(--primary-color-rgb), 0.1);
}

.dropdown-avatar {
    font-size: 42px;
    color: var(--primary-color);
}

.dropdown-user-details {
    flex: 1;
    min-width: 0;
}

.dropdown-username {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-email {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-divider {
    height: 1px;
    background: rgba(var(--primary-color-rgb), 0.1);
    margin: 4px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: var(--text-color);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    border-radius: 8px;
    margin: 2px 0;
}

.dropdown-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(var(--primary-color-rgb), 0.12);
    border-left-color: var(--primary-color);
    transform: translateX(2px);
}

.dropdown-item:hover i {
    color: var(--secondary-color);
    transform: scale(1.1);
}

.dropdown-item:active {
    background: rgba(var(--primary-color-rgb), 0.2);
    transform: translateX(1px);
}

/* ===================================== */
/* BOTTOM NAVIGATION BAR (MOBILE)        */
/* ===================================== */

.bottom-nav {
    display: none !important; /* Hidden by default, shown on mobile via responsive.css */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 -2px 20px rgba(13, 148, 136, 0.1);
    border-top: 1px solid rgba(13, 148, 136, 0.1);
    z-index: 999;
    padding: 6px 10px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 6px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    max-width: 80px;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #888;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 4px 8px;
}

.bottom-nav-item i {
    font-size: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav-item span {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: all 0.3s ease;
}

.bottom-nav-item:active {
    transform: scale(0.92);
}

.bottom-nav-item.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.35);
}

.bottom-nav-item.active i {
    color: white;
    transform: translateY(-1px);
}

.bottom-nav-item.active span {
    color: white;
    font-weight: 700;
}

/* Hover effect for desktop (if bottom nav ever shown on desktop) */
@media (hover: hover) {
    .bottom-nav-item:hover:not(.active) {
        background: rgba(13, 148, 136, 0.08);
        color: var(--primary-color);
    }

    .bottom-nav-item:hover:not(.active) i {
        transform: translateY(-1px);
    }
}

/* Dark mode support for bottom nav */
body.dark-mode .bottom-nav {
    background: rgba(30, 30, 40, 0.98);
    border-top: 1px solid rgba(13, 148, 136, 0.15);
}

body.dark-mode .bottom-nav-item {
    color: #8e8e93;
}

body.dark-mode .bottom-nav-item.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.4);
}

body.dark-mode .bottom-nav-item.active i,
body.dark-mode .bottom-nav-item.active span {
    color: white;
}

/* Mobile touch feedback for game title */
.game-title:active {
    transform: scale(0.97);
    opacity: 0.7;
}
