:root {
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --bg-hover: #2c2c2c;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent: #3b82f6;
    /* Accessible Blue */
    --accent-glow: rgba(59, 130, 246, 0.3);
    --border: #333;
    --success: #10b981;
}

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

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.server-status {
    font-family: monospace;
    color: var(--text-muted);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border);
}

.status-indicator.online {
    background-color: var(--success);
    box-shadow: 0 0 5px var(--success);
}

/* NOW PLAYING */
.now-playing {
    background: var(--bg-panel);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
}

.np-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: #fff;
}

.np-info h3 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.progress-container {
    height: 4px;
    background: var(--bg-dark);
    border-radius: 2px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.5s linear;
}

/* UPLOAD ZONE */
.upload-section {
    margin-bottom: 2rem;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.drop-zone p {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.drop-zone small {
    color: var(--text-muted);
}

/* QUEUE */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.queue-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.queue-item {
    background: var(--bg-panel);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
}

.queue-item.playing {
    border-color: var(--accent);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, var(--bg-panel) 100%);
}

.q-track {
    font-weight: 500;
    display: block;
}

.q-artist {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.q-time {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* UTILS */
.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
}

.btn-icon:hover {
    color: var(--text-main);
}

.spinner {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* --- ACTIONS DROPDOWN --- */
.q-actions-container {
    position: relative;
    display: inline-block;
}

.btn-expand {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-expand:hover {
    color: var(--text-main);
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.q-actions-dropdown {
    display: none;
    /* Hidden by default */
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    z-index: 100;
    padding: 0.5rem;
    min-width: 140px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    flex-direction: column;
    gap: 0.5rem;
}

.q-actions-dropdown.visible {
    display: flex;
    animation: fadeIn 0.1s ease-out;
}

.q-actions-dropdown button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--text-main);
    padding: 0.6rem;
    cursor: pointer;
    border-radius: 4px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    font-size: 0.9rem;
}

.q-actions-dropdown button:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border);
}

.q-actions-dropdown button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- MODAL --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-panel);
    margin: 10% auto;
    padding: 0;
    border: 1px solid var(--border);
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    color: var(--text-muted);
    font-size: 28px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 1.5rem;
}

/* --- TABS --- */
.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* --- SEARCH --- */
.search-box {
    position: relative;
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 0.8rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 1rem;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
}

.search-item {
    padding: 0.8rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.search-item:last-child {
    border-bottom: none;
}

.search-item .meta {
    display: flex;
    flex-direction: column;
}

.search-item .title {
    font-weight: bold;
    color: var(--text-main);
}

.search-item .artist {
    font-size: 0.9em;
    color: var(--text-muted);
}

.search-item .duration {
    font-size: 0.8em;
    color: var(--text-muted);
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* --- UPLOAD --- */
.upload-area {
    border: 2px dashed var(--border);
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
}

.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

/* --- ADD BUTTON IN DROPDOWN --- */
/* (Replaced by general .q-actions-dropdown button styling) */
/* SUCCESS TOAST NOTIFICATION */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: var(--success);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    z-index: 10000;
    max-width: 90%;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Screen Reader Only (Visually Hidden) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}