/* 80Quiz — Core Layout & Search Box Styles (Retro-Neon 80s Dark Theme + Glassmorphism) */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    position: relative;
}

/* Retro grid overlay */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* Subtle horizon glow at bottom */
body::after {
    content: '';
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 200px;
    background: linear-gradient(to top, rgba(255, 40, 160, 0.06) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* ===== APP CONTAINER ===== */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* ===== HEADER / SEARCH SECTION ===== */
.search-section {
    text-align: center;
    padding-top: 12vh;
    padding-bottom: 16px;
    flex-shrink: 0;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    letter-spacing: -1px;
    filter: drop-shadow(0 0 12px rgba(255, 40, 160, 0.4));
}

.tagline {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--neon-cyan);
    margin-bottom: 20px;
    font-weight: 500;
    opacity: 0.7;
}

/* ===== GLASS BUBBLE SEARCH BOX ===== */
.search-box {
    max-width: 100%;
    margin: 0 auto;
}

.search-box form {
    display: flex;
    align-items: center;
    background: rgba(18, 8, 45, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    backdrop-filter: var(--glass-blur) var(--glass-saturate);
    -webkit-backdrop-filter: var(--glass-blur) var(--glass-saturate);
    box-shadow:
        var(--glass-inner-glow),
        0 8px 32px rgba(0, 0, 0, 0.25),
        0 0 40px rgba(0, 240, 255, 0.04);
    transition: box-shadow 0.3s, border-color 0.3s, transform 0.3s, background 0.3s;
}

.search-box form:focus-within {
    border-color: rgba(0, 240, 255, 0.35);
    background: rgba(18, 8, 45, 0.55);
    box-shadow:
        var(--glass-inner-glow),
        0 8px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(0, 240, 255, 0.1),
        0 0 60px rgba(255, 40, 160, 0.04);
    transform: translateY(-2px);
}

.search-box input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-system);
    font-size: 16px;
    padding: 10px 0;
    min-width: 0;
}

.search-box input[type="text"]::placeholder {
    color: rgba(240, 240, 255, 0.3);
}

.search-box select {
    border: none;
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--neon-cyan);
    font-family: var(--font-system);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 32px 10px 14px;
    border-radius: 24px;
    margin-right: 8px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2300f0ff' d='M1.41 0L6 4.59 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    transition: background-color 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.search-box select:hover {
    background-color: rgba(0, 240, 255, 0.12);
}

.search-box select option {
    background: #150535;
    color: #f0f0ff;
}

.search-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--accent-gradient);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 12px rgba(0, 240, 255, 0.2);
}

.search-btn:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-button);
}

.search-btn:active {
    transform: scale(0.95);
}

.search-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* ===== MAIN CONTENT AREA ===== */
.content-area {
    display: flex;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    padding-top: 4vh;
    padding-bottom: 20px;
    align-items: flex-start;
}

.quiz-panel {
    flex: 1;
    max-width: var(--quiz-max-width);
}

.leaderboard-panel {
    width: var(--leaderboard-width);
    flex-shrink: 0;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 16px 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

footer nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-system);
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

footer a:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

footer .separator {
    color: var(--text-muted);
    font-size: 13px;
}

.sound-toggle {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 18px;
    transition: color 0.2s;
    user-select: none;
}

.sound-toggle:hover {
    color: var(--neon-cyan);
}

.sound-toggle.muted {
    opacity: 0.4;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .content-area {
        flex-direction: column;
        align-items: center;
    }

    .quiz-panel {
        max-width: 100%;
        width: 100%;
    }

    .leaderboard-panel {
        width: 100%;
        max-width: var(--quiz-max-width);
    }
}

@media (max-width: 500px) {
    .logo {
        font-size: 1.6rem;
    }

    .search-section {
        padding: 20px 0 14px;
    }

    .search-box form {
        flex-wrap: wrap;
        border-radius: 16px;
        padding: 8px;
        gap: 6px;
    }

    .search-box input[type="text"] {
        width: 100%;
        padding: 10px 12px;
    }

    .search-box select {
        flex: 1;
    }
}
