/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */

:root {
    --bg-color: #0a0a0f;
    --text-color: #ffffff;
    --accent-color: #7000ff;
    --accent-glow: #7000ff80;
    --bubble-color-1: #ff0055;
    --bubble-color-2: #00ddff;
    --bubble-color-3: #7000ff;
    --font-main: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow: hidden;
}

/* ==========================================================================
   2. LAYOUT & CONTAINERS
   ========================================================================== */

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: #050505;
    overflow: hidden;
    pointer-events: none;
}

.glow {
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
}

.glow-1 { top: -200px; left: -200px; background: #00ddff; }
.glow-2 { bottom: -200px; right: -200px; background: #7000ff; }

.app-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.voting-page {
    background: radial-gradient(circle at 50% 0%, #1a1a25, #0a0a0f);
    overflow-y: auto !important;
}

.voting-page body {
    overflow-y: auto;
}

header {
    position: relative;
    padding: 80px 0 20px 0;
    text-align: center;
}

header h1 {
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-size: 2.5em;
    text-shadow: 0 0 20px var(--accent-glow);
}

/* ==========================================================================
   3. COMPONENTS
   ========================================================================== */

/* --- Navigation --- */
.main-nav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
}

.nav-links {
    display: flex;
    gap: 15px;
    padding: 8px 20px;
    border-radius: 50px;
    background: rgba(16, 16, 24, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.3s;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: white;
    background: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* --- Vinyl Bubbels --- */
.bubble-container {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--bg);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 30px var(--accent-glow);
    cursor: pointer;
    transition: width 0.5s ease, height 0.5s ease;
    animation: vinylSpin 10s linear infinite;
}

.bubble-cover {
    position: absolute;
    width: 33%;
    height: 33%;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    z-index: 2;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
    background-color: #111;
}

.bubble span {
    z-index: 10;
    animation: counterSpin 10s linear infinite;
    pointer-events: none;
}

.bubble span.title {
    font-weight: 700;
    font-size: 1.1em;
    max-width: 85%;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.bubble span.artist {
    font-size: 0.8em;
    opacity: 0.8;
    margin-top: 5px;
}

.bubble span.votes {
    position: absolute;
    bottom: 15%;
    font-weight: 700;
    font-size: 1.2em;
    opacity: 0.5;
}

/* --- Voting Lists --- */
.voting-main {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 20px 20px 180px;
}

.search-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.genre-select,
.search-container input {
    padding: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: white;
    outline: none;
    backdrop-filter: blur(10px);
}

.genre-select {
    width: auto;
    min-width: 140px;
    cursor: pointer;
}

.search-container input {
    flex-grow: 1;
}

.trending-item,
.result-item {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.mini-cover {
    width: 45px;
    height: 45px;
    border-radius: 6px;
    background-size: cover;
    margin-right: 15px;
    flex-shrink: 0;
}

.result-info {
    flex-grow: 1;
    min-width: 0;
}

.result-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
}

.result-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.result-artist {
    font-size: 0.8em;
    opacity: 0.5;
    text-transform: uppercase;
}

.result-votes {
    color: var(--accent-color);
    font-weight: 700;
    margin-left: 10px;
}

.trending-item:hover {
    transform: translateX(5px);
    border-color: var(--accent-color);
}

/* --- Now Playing Banner --- */
.now-playing-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: 90%;
    max-width: 500px;
    background: linear-gradient(135deg,
            rgba(6, 182, 212, 0.2) 0%,
            rgba(139, 92, 246, 0.2) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.5s ease;
    z-index: 1000;
    opacity: 0;
}

.now-playing-banner.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.np-label {
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(6, 182, 212, 1);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
    white-space: nowrap;
}

.np-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.np-track {
    flex-grow: 1;
    overflow: hidden;
    min-width: 0;
}

.np-title {
    font-weight: 700;
    font-size: 1em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-artist {
    font-size: 0.85em;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 30px;
    flex-shrink: 0;
}

.np-visualizer span {
    width: 3px;
    background: linear-gradient(to top, rgba(6, 182, 212, 0.8), rgba(139, 92, 246, 0.8));
    border-radius: 2px;
    animation: pulse 0.8s ease-in-out infinite;
}

.np-visualizer span:nth-child(1) {
    animation-delay: 0s;
}

.np-visualizer span:nth-child(2) {
    animation-delay: 0.2s;
}

.np-visualizer span:nth-child(3) {
    animation-delay: 0.4s;
}

.np-visualizer span:nth-child(4) {
    animation-delay: 0.6s;
}

@keyframes pulse {

    0%,
    100% {
        height: 8px;
    }

    50% {
        height: 30px;
    }
}

/* ==========================================================================
   4. ANIMATIONS
   ========================================================================== */

@keyframes vinylSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes counterSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-360deg);
    }
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: floatBlob 20s infinite alternate;
}

@keyframes floatBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(20px, 20px) scale(1.1);
    }
}

.exploding {
    animation: explode 0.6s forwards;
    pointer-events: none;
}

@keyframes explode {
    to {
        transform: scale(3);
        opacity: 0;
        filter: blur(20px);
    }
}

/* ==========================================================================
   5. AUTH & MODALS
   ========================================================================== */

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(10px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.auth-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.auth-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.auth-card h2 {
    margin-bottom: 10px;
    font-weight: 700;
}

.auth-card p {
    margin-bottom: 30px;
    opacity: 0.7;
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px;
    background: white;
    color: #1a1a1a;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.google-login-btn:hover {
    transform: scale(1.02);
}

.google-login-btn img {
    width: 20px;
    height: 20px;
}

.voted-badge {
    background: var(--accent-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.65em;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 0 15px var(--accent-glow);
    flex-shrink: 0;
}

.unvote-btn {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    margin-left: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    vertical-align: middle;
    backdrop-filter: blur(5px);
    flex-shrink: 0;
}

.unvote-btn:hover {
    background: rgba(255, 50, 100, 0.15);
    color: #ff3264;
    border-color: rgba(255, 50, 100, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 50, 100, 0.2);
}

.unvote-btn svg {
    transition: transform 0.3s ease;
}

.unvote-btn:hover svg {
    transform: rotate(-10deg) scale(1.1);
}

.trending-item.voted:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.1);
}

.debug-controls {
    display: none;
}

body.is-admin .debug-controls {
    display: block;
}
/* Load More Button */
.load-more-btn { width: 100%; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.7); padding: 15px; border-radius: 12px; margin-top: 15px; cursor: pointer; font-weight: 500; transition: all 0.2s ease; }
.load-more-btn:hover { background: rgba(255, 255, 255, 0.1); color: white; }
/* Navigation & Admin visibility */
.admin-only { display: none !important; }
body.is-admin .admin-only { display: inline-block !important; }
