/* ===== CSS VARIABLES ===== */
:root {
    /* Chrome gradient colors */
    --chrome-light: #e8e8e8;
    --chrome-white: #ffffff;
    --chrome-mid: #909090;
    --chrome-dark: #505050;
    --chrome-accent: #c0c0c0;
    
    /* Accent colors */
    --accent-red: #d32fb4;
    --accent-yellow: #ffd700;
    --accent-black: #000000;
    --accent-white: #ffffff;
    --accent-gold: #daa520;
    
    /* Text colors */
    --text-black: #000000;
    --text-red: #b700cc;
    --text-grey: #666666;
}

/* ===== BASE RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background: 
        url('/background.svg'),
        linear-gradient(135deg, #007fac 0%, #02112f 100%);
    background-size: 100px 100px, 100% 100%;
    background-repeat: repeat, no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    padding-top: max(20px, 5vh);
    min-height: 100vh;
    font-family: 'Helvetica Neue', 'Roboto Condensed', Helvetica, Arial, sans-serif;
}

/* ===== FLOATING USER BADGE ===== */
.user-badge {
    position: fixed;
    top: 16px;
    right: 16px;
    background: transparent;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-nickel-container {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-nickel {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: nickel-spin 2s ease-in-out infinite;
}

@keyframes nickel-spin {
    0% {
        transform: scaleX(1);
    }
    25% {
        transform: scaleX(0);
    }
    50% {
        transform: scaleX(1);
    }
    100% {
        transform: scaleX(1);
    }
}

.user-nickels {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: var(--accent-white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.user-nickels {
    font-size: 13px;
    color: var(--accent-gold);
}

/* ===== MODAL STYLES ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #2a2a3e 0%, #1a1a2e 100%);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-title {
    font-family: 'Pacifico', cursive;
    font-size: 28px;
    color: var(--accent-gold);
    margin-bottom: 16px;
}

.modal-text {
    color: var(--accent-white);
    font-size: 16px;
    margin-bottom: 24px;
    opacity: 0.8;
}

.modal-input {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-white);
    margin-bottom: 16px;
    font-family: 'Oswald', sans-serif;
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent-yellow);
    box-shadow: 0 0 10px rgba(218, 165, 32, 0.5);
}

.modal-input::placeholder {
    color: rgba(255, 255, 240, 0.5);
}

.modal-button {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: bold;
    background: var(--accent-gold);
    color: var(--text-black);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
}

.modal-button:hover {
    background: var(--accent-yellow);
    transform: translateY(-2px);
}

.modal-button.secondary {
    background: transparent;
    color: var(--accent-white);
    border: 2px solid rgba(255, 255, 240, 0.3);
}

.modal-button.secondary:hover {
    border-color: var(--accent-white);
    background: rgba(255, 255, 240, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.modal-error {
    color: #e74c3c;
    margin-top: 16px;
    font-size: 14px;
}

.confirm-track-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.confirm-track-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.confirm-track-artist {
    font-size: 16px;
    color: var(--accent-white);
    opacity: 0.8;
}

/* ===== MAIN JUKEBOX CONTAINER ===== */
.jukebox {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 9 / 14;
    background: linear-gradient(
        90deg,
        #707070 0%,
        #c0c0c0 8%,
        #e8e8e8 15%,
        #ffffff 25%,
        #e0e0e0 35%,
        #909090 50%,
        #505050 65%,
        #707070 75%,
        #ffffff 88%,
        #505050 100%
    );
    border-radius: clamp(120px, 30vw, 240px) clamp(120px, 30vw, 240px) 20px 20px;
    border: clamp(4px, 1vw, 8px) solid #404040;
    box-shadow: 
        inset 0 2px 5px rgba(255, 255, 255, 0.4),
        inset 0 -2px 5px rgba(0, 0, 0, 0.3),
        0 15px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    padding: clamp(8px, 2vw, 16px);
    gap: clamp(8px, 2vw, 16px);
    flex-shrink: 0;
    margin-bottom: 40px;
}

/* ===== HEADER / COIN SECTION ===== */
.jukebox-header {
    background: linear-gradient(
        90deg,
        #707070 0%,
        #c0c0c0 10%,
        #e8e8e8 20%,
        #ffffff 30%,
        #e0e0e0 40%,
        #909090 60%,
        #505050 80%,
        #707070 100%
    );
    border-radius: 40px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    box-shadow: 
        inset 0 1px 3px rgba(255, 255, 255, 0.4),
        inset 0 -1px 3px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    max-width: 280px;
    margin: 0 auto;
}

/* Coin indicator circle */
.coin-indicator {
    width: 40px;
    height: 40px;
    background: var(--accent-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-white);
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 -1px 2px rgba(255, 255, 255, 0.2),
        0 -3px 6px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

/* Plays info block */
.plays-info {
    background: var(--accent-red);
    padding: clamp(6px, 1.5vw, 10px) clamp(8px, 2vw, 12px);
    border-radius: 4px;
    color: var(--accent-white);
    font-size: clamp(7px, 1.5vw, 11px);
    font-weight: bold;
    text-align: center;
    line-height: 1.4;
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.2),
        inset 0 -1px 2px rgba(0, 0, 0, 0.3),
        0 3px 6px rgba(0, 0, 0, 0.3);
}

.plays-info-line {
    display: block;
}

/* ===== DISPLAY WINDOW ===== */
.display-window {
    flex: 1;
    background: linear-gradient(
        90deg,
        #e0e0e0 0%,
        #f0f0f0 20%,
        #ffffff 50%,
        #f0f0f0 80%,
        #e0e0e0 100%
    );
    border-radius: 30px;
    padding: 16px;
    box-shadow: 
        inset 0 2px 8px rgba(255, 255, 255, 0.5),
        inset 0 -2px 8px rgba(0, 0, 0, 0.2),
        0 6px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Glass overlay effect */
.glass-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
    pointer-events: none;
    z-index: 10;
    border-radius: 12px;
}

/* Navigation arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(28px, 6vw, 40px);
    height: clamp(28px, 6vw, 40px);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    font-size: clamp(14px, 3vw, 20px);
    color: #333;
}

.nav-arrow:hover {
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.nav-arrow-left {
    left: 0;
}

.nav-arrow-right {
    right: 0;
}

/* Display content container */
.display-content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ===== CAROUSEL ===== */
.carousel-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.35, 0, 0.25, 1);
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
}

.carousel-slide {
    flex: 0 0 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(8px, 2vw, 12px);
    padding: 0 clamp(2px, 0.5vw, 4px);
    min-height: 0;
}

.strip-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

/* ===== TITLE STRIP CARD ===== */
.title-strip {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 2px;
    padding: 4px 8px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    background-image:
        repeating-linear-gradient(
            180deg,
            #ffffff 0px,
            #ffffff 18px,
            #e0e0e0 18px,
            #e0e0e0 19px
        );
}

.title-strip:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.title-strip.in-queue {
    opacity: 0.5;
    pointer-events: none;
}

.title-strip.empty {
    cursor: default;
    opacity: 0.6;
}

.title-strip.empty:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.title-strip.selected {
    box-shadow: 0 0 0 3px var(--accent-gold), 0 4px 12px rgba(218, 165, 32, 0.5);
}

/* Selection code */
.selection-code {
    position: absolute;
    font-size: clamp(7px, 1.5vw, 10px);
    font-weight: bold;
    color: var(--accent-white);
    background: var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(4px, 0.8vw, 8px) clamp(6px, 1.2vw, 10px);
    border-radius: 2px;
    top: 50%;
    transform: translateY(-50%);
}

.selection-code-left {
    left: clamp(2px, 0.5vw, 4px);
}

.selection-code-right {
    right: clamp(2px, 0.5vw, 4px);
}

.strip-title {
    font-size: clamp(9px, 2vw, 14px);
    font-weight: bold;
    color: var(--text-black);
    text-align: center;
    line-height: 1.2;
    margin: 0 clamp(12px, 3vw, 24px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
}

.strip-artist {
    font-size: clamp(8px, 1.5vw, 11px);
    color: var(--text-red);
    text-align: center;
    margin-top: clamp(1px, 0.5vw, 3px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Branding overlay */
.branding-overlay {
    position: absolute;
    bottom: clamp(4px, 1vw, 10px);
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(12px, 3vw, 22px);
    font-weight: bold;
    color: var(--accent-red);
    letter-spacing: clamp(1px, 0.3vw, 2px);
    z-index: 5;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
    font-family: 'Pacifico', cursive;
    white-space: nowrap;
}

/* Carousel indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    flex-shrink: 0;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.indicator.active {
    background: var(--accent-red);
    border-color: var(--accent-red);
    width: 20px;
    border-radius: 4px;
}

/* ===== KEYPAD ===== */
.keypad {
    background: linear-gradient(
        90deg,
        #707070 0%,
        #c0c0c0 10%,
        #e8e8e8 20%,
        #ffffff 30%,
        #e0e0e0 40%,
        #909090 60%,
        #505050 80%,
        #707070 100%
    );
    border-radius: 8px;
    padding: 12px;
    box-shadow:
        inset 0 1px 3px rgba(255, 255, 255, 0.4),
        inset 0 -1px 3px rgba(0, 0, 0, 0.2),
        0 4px 8px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.button-row {
    display: flex;
    gap: 3px;
    margin-bottom: 3px;
}

.button-row:last-child {
    margin-bottom: 0;
}

.keypad-button {
    flex: 1;
    aspect-ratio: 1;
    background: var(--accent-yellow);
    border: clamp(1px, 0.3vw, 2px) solid #daa520;
    border-radius: 3px;
    color: var(--accent-red);
    font-weight: bold;
    font-size: clamp(12px, 3vw, 22px);
    cursor: pointer;
    transition: all 0.08s ease;
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.4),
        inset 0 -2px 2px rgba(0, 0, 0, 0.2),
        0 3px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Arial Rounded MT', 'Arial Rounded', Arial, sans-serif;
    padding: 0;
}

.keypad-button:hover:not(.pressed):not(.selected) {
    background: #ffed4e;
    border-color: #ffd700;
    transform: translateY(-1px);
}

.keypad-button.pressed {
    transform: translateY(2px);
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 2px 2px rgba(255, 255, 255, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Selected/active keypad button - stays pressed with glow */
.keypad-button.selected {
    transform: translateY(2px);
    background: #ffcc00;
    border-color: #ff9900;
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.2),
        inset 0 2px 2px rgba(255, 255, 255, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(255, 204, 0, 0.8),
        0 0 30px rgba(255, 153, 0, 0.4);
}

/* ===== PAGE CONTENT SECTIONS ===== */
.page-section {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.section-header {
    font-family: 'Pacifico', cursive;
    font-size: clamp(20px, 5vw, 32px);
    color: var(--accent-white);
    margin-bottom: 20px;
    text-align: center;
}

/* Now Playing Section */
.now-playing-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 24px;
    color: var(--accent-white);
}

.now-playing-empty {
    text-align: center;
    opacity: 0.5;
    font-size: 16px;
}

.now-playing-title {
    font-size: clamp(18px, 4vw, 28px);
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--accent-gold);
}

.now-playing-artist {
    font-size: clamp(14px, 3vw, 20px);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 16px;
}

.now-playing-meta {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.now-playing-progress {
    margin-top: 16px;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gold);
    transition: width 1s linear;
}

/* Queue Section */
.queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.queue-empty {
    text-align: center;
    color: rgba(255, 255, 240, 0.5);
    grid-column: 1 / -1;
    padding: 40px;
}

.queue-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 16px;
    color: var(--accent-white);
    transition: all 0.3s ease;
}

.queue-card:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-4px);
}

.queue-position {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.queue-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: 6px;
    line-height: 1.3;
}

.queue-artist {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.queue-requester {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* Footer */
.footer {
    width: 100%;
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    line-height: 1.6;
}

.footer-text a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-text a:hover {
    color: var(--accent-white);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    body {
        padding: 10px;
        padding-top: 10px;
    }
    
    .jukebox {
        max-width: 95vw;
        width: 95vw;
    }
    
    .user-badge {
        top: 8px;
        right: 8px;
    }
}

@media (max-height: 800px) {
    .jukebox {
        max-width: 100%;
    }
}

@media (max-width: 400px) {
    .jukebox {
        border-radius: 100px 100px 16px 16px;
        max-width: 98vw;
        width: 98vw;
    }
}
