/* =========================================================
   style.css
   Tema gelap ala Spotify untuk Music Request Room
   Warna utama: #121212 (bg), #1DB954 (aksen hijau), #FFFFFF (teks)
   ========================================================= */

:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --bg-card-hover: #282828;
    --accent: #1DB954;
    --accent-dark: #169c46;
    --text-white: #FFFFFF;
    --text-muted: #b3b3b3;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    min-height: 100vh;
}

/* ---------- Umum ---------- */
.text-accent { color: var(--accent) !important; }
.bg-card { background-color: var(--bg-card); }

a { text-decoration: none; }

/* ---------- Halaman User (index.php) ---------- */
.app-header {
    text-align: center;
    padding: 30px 15px 10px;
}

.app-header .logo-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    box-shadow: 0 4px 20px rgba(29, 185, 84, 0.4);
}

.app-header h1 {
    font-weight: 700;
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.app-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.request-form {
    background-color: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin: 0 auto 24px;
    max-width: 520px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.form-control-dark {
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: var(--text-white);
    border-radius: 10px;
    padding: 12px 14px;
}

.form-control-dark:focus {
    background-color: #2a2a2a;
    border-color: var(--accent);
    color: var(--text-white);
    box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.25);
}

.form-control-dark::placeholder {
    color: #8a8a8a;
}

.btn-accent {
    background-color: var(--accent);
    border: none;
    color: #052e14;
    font-weight: 700;
    border-radius: 50px;
    padding: 12px;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-accent:hover {
    background-color: #1ed760;
    transform: scale(1.02);
    color: #052e14;
}

.btn-accent:disabled {
    opacity: 0.6;
    transform: none;
}

.alert-feedback {
    max-width: 520px;
    margin: 0 auto 16px;
    border-radius: 10px;
}

.queue-section {
    max-width: 520px;
    margin: 0 auto;
    padding-bottom: 40px;
}

.queue-section h5 {
    font-weight: 700;
    margin-bottom: 14px;
    padding-left: 4px;
}

.queue-item {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background-color 0.15s ease;
}

.queue-item:hover {
    background-color: var(--bg-card-hover);
}

.queue-item .thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.queue-item .info {
    flex: 1;
    min-width: 0;
}

.queue-item .info .title {
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item .info .meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.queue-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.badge-status {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-waiting { background-color: #3a3a3a; color: #e0e0e0; }
.badge-playing { background-color: var(--accent); color: #052e14; }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 30px 10px;
    font-size: 0.9rem;
}

/* ---------- Halaman Player (player.php) ---------- */
.player-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.player-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background-color: #0a0a0a;
    border-bottom: 1px solid #262626;
    flex-shrink: 0;
}

.player-topbar .brand {
    font-weight: 800;
    font-size: 1.1rem;
}

.qr-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qr-box img {
    border-radius: 8px;
    background: #fff;
    padding: 4px;
}

.qr-box .link-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    max-width: 180px;
    word-break: break-all;
}

.now-playing-section {
    flex-shrink: 0;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 28px;
    background: linear-gradient(180deg, #181818 0%, #121212 100%);
    border-bottom: 1px solid #262626;
}

.now-playing-thumb-wrap {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.now-playing-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.now-playing-info {
    flex: 1;
    min-width: 0;
}

.now-playing-label {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.now-playing-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.now-playing-requester {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 16px;
}

.now-playing-requester .name-pill {
    background-color: var(--bg-card);
    padding: 4px 12px;
    border-radius: 20px;
    color: var(--text-white);
    font-weight: 600;
}

.progress-info {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.player-controls {
    display: flex;
    gap: 10px;
}

.btn-control {
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.15s ease;
}

.btn-control:hover { transform: scale(1.04); }

.btn-skip { background-color: var(--accent); color: #052e14; }
.btn-refresh { background-color: #2a2a2a; color: var(--text-white); }
.btn-clear { background-color: #c0392b; color: var(--text-white); }

/* Sembunyikan player YouTube - hanya audio yang terdengar */
#yt-player-container {
    position: absolute;
    width: 2px;
    height: 2px;
    opacity: 0;
    pointer-events: none;
    top: -9999px;
    left: -9999px;
}

.upcoming-section {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 30px;
}

.upcoming-section h6 {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.78rem;
    margin-bottom: 14px;
}

.upcoming-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 6px;
    background-color: var(--bg-card);
}

.upcoming-item:hover {
    background-color: var(--bg-card-hover);
}

.upcoming-item .thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.upcoming-item .info {
    flex: 1;
    min-width: 0;
}

.upcoming-item .info .title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upcoming-item .info .meta {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.btn-delete-item {
    background: none;
    border: none;
    color: #888;
    font-size: 1.1rem;
    padding: 4px 8px;
}

.btn-delete-item:hover {
    color: #e74c3c;
}

/* ---------- Responsif Mobile untuk Player ---------- */
@media (max-width: 768px) {
    .now-playing-section {
        flex-direction: column;
        text-align: center;
        padding: 18px;
    }
    .now-playing-thumb-wrap {
        width: 140px;
        height: 140px;
    }
    .now-playing-title {
        white-space: normal;
        font-size: 1.3rem;
    }
    .player-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    .qr-box .link-text {
        display: none;
    }
}

/* Scrollbar tipis ala Spotify */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}
