* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #1a1a2e; color: #e0e0e0; line-height: 1.6; }
a { color: #64b5f6; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Skip link */
.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: #e94560; color: #fff; padding: 0.5rem 1rem; border-radius: 0 0 4px 0;
    font-weight: 600;
}
.skip-link:focus { left: 0; }

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

/* Focus styles */
:focus-visible {
    outline: 2px solid #e94560;
    outline-offset: 2px;
}

nav { background: #16213e; padding: 0.75rem 1.5rem; display: flex; gap: 1.5rem; border-bottom: 2px solid #0f3460; }
nav a { color: #8ab4f8; font-weight: 500; padding: 0.25rem 0; }
nav a.active { color: #fff; border-bottom: 2px solid #e94560; }
nav a:hover { color: #fff; text-decoration: none; }

main { max-width: 900px; margin: 2rem auto; padding: 0 1.5rem; }

h1 { margin-bottom: 1.5rem; color: #fff; }
h2 { margin: 1.5rem 0 0.75rem; color: #ccc; font-size: 1.1rem; }

.help-text { color: #888; font-size: 0.85rem; font-weight: normal; }

.flash { padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: 4px; }
.flash.success { background: #1b5e20; color: #c8e6c9; }
.flash.error { background: #b71c1c; color: #ffcdd2; }

.login-box { max-width: 360px; margin: 4rem auto; background: #16213e; padding: 2rem; border-radius: 8px; }
.login-box h1 { text-align: center; margin-bottom: 1.5rem; }

label { display: block; margin: 0.5rem 0 0.25rem; font-size: 0.9rem; color: #aaa; }
input[type="text"], input[type="password"], select {
    width: 100%; padding: 0.5rem; background: #0f3460; border: 1px solid #333; color: #e0e0e0; border-radius: 4px; font-size: 0.95rem;
}
input:focus, select:focus { outline: none; border-color: #e94560; box-shadow: 0 0 0 2px rgba(233,69,96,0.3); }

button, .btn {
    display: inline-block; padding: 0.5rem 1rem;
    background: #0f3460; color: #e0e0e0; border: 1px solid #333;
    border-radius: 4px; cursor: pointer; font-size: 0.9rem;
    transition: background 0.15s, box-shadow 0.15s;
}
button:hover, .btn:hover { background: #1a4a8a; }
button:disabled, .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-green { background: #1b5e20; border-color: #2e7d32; }
.btn-green:hover { background: #2e7d32; }
.btn-red { background: #b71c1c; border-color: #c62828; }
.btn-red:hover { background: #c62828; }
.btn-small { padding: 0.25rem 0.5rem; font-size: 0.8rem; }

.upload-form { background: #16213e; padding: 1.5rem; border-radius: 8px; margin-bottom: 2rem; }
.form-row { margin-bottom: 0.75rem; }

/* Drop zone */
.drop-zone {
    border: 2px dashed #333; border-radius: 8px;
    padding: 2rem; text-align: center;
    margin-bottom: 1rem; cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone:focus-visible { border-color: #64b5f6; background: rgba(100,181,246,0.05); }
.drop-zone-active { border-color: #e94560; background: rgba(233,69,96,0.1); }
.drop-zone-text { font-size: 1.1rem; color: #ccc; margin-bottom: 0.25rem; }
.drop-zone-subtext { font-size: 0.85rem; color: #888; }

/* Upload buttons */
.upload-buttons { display: flex; gap: 0.75rem; margin-bottom: 1rem; }
.upload-buttons .btn { cursor: pointer; }

/* File queue */
.file-queue { max-height: 200px; overflow-y: auto; margin-bottom: 1rem; border: 1px solid #333; border-radius: 4px; }
.file-queue-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.4rem 0.75rem; border-bottom: 1px solid #222;
}
.file-queue-item:last-child { border-bottom: none; }
.file-queue-name { font-size: 0.85rem; font-family: monospace; color: #ccc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 0.5rem; }

/* Progress bar */
.progress-bar-container {
    background: #0f3460; border-radius: 4px; overflow: hidden;
    height: 1.5rem; margin-bottom: 0.5rem;
}
.progress-bar {
    height: 100%; width: 0; background: #1b5e20;
    transition: width 0.3s; display: flex; align-items: center; justify-content: center;
    min-width: 2rem;
}
.progress-text { font-size: 0.8rem; color: #fff; font-weight: 600; }
.upload-status { font-size: 0.85rem; color: #aaa; margin-bottom: 0.75rem; }
.upload-submit { margin-top: 0.5rem; }

/* Add track form */
.add-track-form { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.add-track-form .form-row { flex: 1; min-width: 200px; margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid #333; }
th { background: #16213e; color: #aaa; font-size: 0.85rem; text-transform: uppercase; }
.mono { font-family: monospace; font-size: 0.85rem; }

.status-panel { background: #16213e; padding: 1.5rem; border-radius: 8px; margin-bottom: 1.5rem; }
.status-list { display: block; }
.status-row { display: flex; justify-content: space-between; padding: 0.4rem 0; }
.status-row dt { color: #aaa; }
.status-row dd { margin: 0; }

.status-badge { padding: 0.15rem 0.6rem; border-radius: 12px; font-size: 0.85rem; }
.status-badge.connected { background: #1b5e20; color: #a5d6a7; }
.status-badge.disconnected { background: #b71c1c; color: #ef9a9a; }
.status-badge.default { background: #0f3460; color: #8ab4f8; }

.controls { display: flex; gap: 0.75rem; margin-bottom: 1rem; }
.api-result { font-family: monospace; background: #0f3460; padding: 0.75rem; border-radius: 4px; min-height: 2rem; font-size: 0.85rem; color: #8ab4f8; }

.actions { white-space: nowrap; }
.actions form { margin: 0; }

.breadcrumb { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid #333; }

/* Responsive */
@media (max-width: 600px) {
    nav { flex-wrap: wrap; gap: 0.75rem; }
    .upload-buttons { flex-direction: column; }
    .add-track-form { flex-direction: column; }
    table { font-size: 0.85rem; }
    th, td { padding: 0.4rem; }
    .actions form { display: block; margin-bottom: 0.25rem; }
}
