:root {
    --bg-dark: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-a: #6366f1;
    /* Indigo */
    --accent-b: #ec4899;
    /* Pink */
    --surface: rgba(30, 41, 59, 0.7);
    --surface-border: rgba(255, 255, 255, 0.1);
    --glow: rgba(99, 102, 241, 0.3);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

/* Dynamic Background */
.background-globes {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at top left, #1e1b4b, #0f172a);
}

.background-globes::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--accent-a);
    filter: blur(120px);
    opacity: 0.2;
    border-radius: 50%;
}

.background-globes::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--accent-b);
    filter: blur(120px);
    opacity: 0.15;
    border-radius: 50%;
}

.main-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

/* Glass Card */
.glass-container {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 3rem 2rem;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 500px;
    text-align: center;
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
    position: relative;
    /* For loader positioning */
    overflow: hidden;
    /* Keep loader inside */
}

h1 {
    margin: 0 0 1rem;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

/* Player Card */
.player-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    border: 1px solid var(--surface-border);
}

.status-indicator {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 1.5rem;
}

/* Play Buttons */
.btn-player {
    flex: 1;
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    padding: 1rem 0.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-player:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-player.active {
    background: var(--accent-a);
    border-color: var(--accent-a);
    box-shadow: 0 0 20px var(--glow);
}

.btn-player.btn-b.active {
    background: var(--accent-b);
    border-color: var(--accent-b);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
}

.playing-dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    margin-top: 6px;
    opacity: 0;
    transition: opacity 0.2s;
}

.btn-player.active .playing-dot {
    opacity: 1;
}

.btn-stop {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--surface-border);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-stop:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    transform: scale(1.05);
}

/* Timeline */
.progress-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    cursor: pointer;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
    width: 0%;
    transition: width 0.1s linear;
}

/* Vote Section */
.vote-section h2 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-weight: 500;
}

.vote-buttons {
    display: flex;
    gap: 1rem;
}

.btn-vote {
    flex: 1;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s, filter 0.2s;
}

.btn-vote:first-child {
    background: linear-gradient(135deg, var(--accent-a), #4f46e5);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-vote:last-child {
    background: linear-gradient(135deg, var(--accent-b), #db2777);
    color: white;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.btn-vote:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-vote:active {
    transform: translateY(0);
}

/* Footer */
.app-footer {
    text-align: center;
    margin-top: auto;
    padding-top: 1rem;
}

.app-footer p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.app-footer a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s;
    border-bottom: 1px dotted var(--text-secondary);
}

.app-footer a:hover {
    opacity: 1;
    border-bottom-style: solid;
}

.hidden {
    display: none !important;
}

.check-icon {
    font-size: 3rem;
    color: #10b981;
    margin-bottom: 1rem;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    margin-left: auto;
    margin-right: auto;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    border-radius: 24px;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--surface-border);
    border-top: 4px solid var(--accent-a);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    background: #1e293b;
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-card h3 {
    color: white;
    margin: 0 0 1rem;
}

.modal-card p {
    color: #94a3b8;
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-actions button {
    flex: 1;
    margin: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-a), #818cf8);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: #cbd5e1;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

/* Admin Styles */
.dashboard-container table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-container th,
.dashboard-container td {
    padding: 1rem;
    border-bottom: 1px solid var(--surface-border);
    text-align: left;
}

/* Responsive Mobile */
@media (max-width: 480px) {
    .glass-container {
        padding: 2rem 1.5rem;
        box-shadow: none;
        border: none;
        background: transparent;
    }

    .player-card {
        padding: 1rem;
        background: var(--surface);
        backdrop-filter: blur(10px);
        border: 1px solid var(--surface-border);
    }

    .controls-row {
        gap: 8px;
    }

    .btn-player {
        font-size: 0.9rem;
        padding: 0.8rem 0.2rem;
    }

    .btn-stop {
        width: 40px;
        height: 40px;
    }

    h1 {
        font-size: 1.75rem;
    }
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.tooltip-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: help;
    transition: all 0.2s;
}

.tooltip-icon:hover {
    color: white;
    border-color: white;
    background: rgba(255, 255, 255, 0.1);
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    width: 250px;
    background-color: #1e293b;
    border: 1px solid var(--surface-border);
    color: #e2e8f0;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    /* Position above */
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-size: 0.85rem;
    font-weight: normal;
    line-height: 1.5;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}


.tooltip-container:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 480px) {
    .tooltip-content {
        width: 220px;
        left: auto;
        right: 0;
        transform: none;
        bottom: 140%;
        white-space: normal;
        text-align: center;
    }

    .tooltip-content::after {
        left: auto;
        right: 1px;
    }
}