/* YouTube Album Splitter — Mirror's Edge Theme */

:root {
    --bg: #f0f2f5;
    --surface: #ffffff;
    --surface-hover: #f8f9fa;
    --sidebar-bg: #ffffff;
    --sidebar-active: rgba(230, 57, 70, 0.08);
    --sidebar-active-border: #e63946;

    --accent: #e63946;
    --accent-hover: #c1121f;
    --accent-light: rgba(230, 57, 70, 0.1);

    --cyan: #00b4d8;
    --cyan-light: rgba(0, 180, 216, 0.1);
    --orange: #ff6b35;
    --orange-light: rgba(255, 107, 53, 0.1);

    --text: #1d3557;
    --text-muted: #6c757d;
    --text-inverse: #ffffff;

    --border: #e9ecef;
    --border-strong: #dee2e6;

    --success: #2a9d8f;
    --success-light: rgba(42, 157, 143, 0.1);
    --warning: #ff9f1c;
    --warning-light: rgba(255, 159, 28, 0.1);
    --error: #e63946;
    --error-light: rgba(230, 57, 70, 0.1);

    --sidebar-width: 220px;
    --topbar-height: 60px;
}

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

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-brand {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand .logo {
    font-size: 1.5rem;
    text-decoration: none;
}

.sidebar-brand .brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.875rem;
    border-radius: 0.35rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--accent);
    border-left-color: var(--sidebar-active-border);
}

.nav-icon {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.nav-label {
    white-space: nowrap;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Page wrapper */
.page-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 2px solid var(--accent);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text);
}

/* Main content */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* Hero */
.hero {
    text-align: center;
    padding: 2rem 0 1.5rem;
}

.hero h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.hero p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Forms */
.url-form {
    max-width: 600px;
    margin: 0 auto 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

input[type="url"],
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 0;
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    font-weight: 500;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
}

.inline-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.inline-check input[type="checkbox"] {
    width: auto;
    accent-color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--text-muted);
}

.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
}

.btn-danger {
    background: var(--error-light);
    color: var(--error);
    border: 2px solid var(--error);
}

.btn-danger:hover {
    background: var(--error);
    color: var(--text-inverse);
}

.btn-remove {
    background: transparent;
    color: var(--error);
    border: 2px solid var(--error);
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
}

.btn-remove:hover {
    background: var(--error);
    color: var(--text-inverse);
}

/* Tracklist form */
.tracklist-form {
    max-width: 700px;
    margin: 0 auto;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.tracks-header {
    display: grid;
    grid-template-columns: 2.5rem 5rem 1fr 3rem;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    border-bottom: 2px solid var(--accent);
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.track-row {
    display: grid;
    grid-template-columns: 2.5rem 5rem 1fr 3rem;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.track-num {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.time-input {
    padding: 0.5rem;
    font-size: 0.85rem;
    text-align: center;
    border: 2px solid var(--border);
    border-radius: 0;
}

.title-input {
    padding: 0.5rem;
    font-size: 0.85rem;
    border: 2px solid var(--border);
    border-radius: 0;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    max-width: 700px;
    margin: 2rem auto;
    text-align: center;
}

.feature h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
}

.feature p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
    background: var(--surface);
    font-weight: 500;
}

.alert-error {
    border-color: var(--error);
    color: var(--error);
    background: var(--error-light);
}

.alert-warning {
    border-color: var(--warning);
    color: #d4850a;
    background: var(--warning-light);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid;
    border-radius: 0;
}

.badge-pending { border-color: var(--warning); color: var(--warning); background: var(--warning-light); }
.badge-fetching { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-light); }
.badge-downloading { border-color: #0077b6; color: #0077b6; background: rgba(0, 119, 182, 0.08); }
.badge-splitting { border-color: var(--cyan); color: var(--cyan); background: var(--cyan-light); }
.badge-completed { border-color: var(--success); color: var(--success); background: var(--success-light); }
.badge-failed { border-color: var(--error); color: var(--error); background: var(--error-light); }

.badge-active { border-color: var(--success); color: var(--success); background: var(--success-light); }
.badge-inactive { border-color: var(--text-muted); color: var(--text-muted); background: rgba(108, 117, 125, 0.08); }

.badge-unseen { border-color: var(--text-muted); color: var(--text-muted); background: rgba(108, 117, 125, 0.05); }
.badge-detected { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.badge-ignored { border-color: var(--text-muted); color: var(--text-muted); background: rgba(108, 117, 125, 0.05); }
.badge-no_tracks { border-color: var(--text-muted); color: var(--text-muted); background: rgba(108, 117, 125, 0.05); }

/* Tables */
.jobs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
}

.jobs-table th,
.jobs-table td {
    padding: 0.875rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.jobs-table th {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    font-weight: 700;
    background: var(--surface-hover);
}

.jobs-table a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.jobs-table a:hover {
    color: var(--accent);
}

.url-small {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.error-small {
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 0.25rem;
}

.inline-form {
    display: inline;
}

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

/* Job detail */
.job-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.job-url {
    margin-bottom: 1.5rem;
}

.job-url a {
    color: var(--accent);
    word-break: break-all;
    font-weight: 600;
}

.download-all {
    margin: 1.5rem 0;
}

.track-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    margin-bottom: 0.5rem;
}

.track-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.track-number {
    width: 2rem;
    text-align: center;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.9rem;
}

.track-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.track-time {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.job-meta {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--accent);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.job-meta p {
    margin-bottom: 0.25rem;
}

/* Channels */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.channel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    padding: 1.25rem;
    transition: all 0.15s;
}

.channel-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.08);
}

.channel-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1rem;
}

.channel-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 0;
    object-fit: cover;
    background: var(--surface-hover);
    border: 2px solid var(--border);
}

.channel-avatar.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.channel-info {
    min-width: 0;
}

.channel-name {
    display: block;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.channel-handle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.channel-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.sync-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.channel-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Channel detail */
.channel-header-detail {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: var(--surface);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
}

.channel-avatar-large {
    width: 5rem;
    height: 5rem;
    border-radius: 0;
    object-fit: cover;
    background: var(--surface-hover);
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.channel-url a {
    color: var(--accent);
    word-break: break-all;
    font-weight: 600;
}

.channel-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem;
    max-width: 600px;
}

.channel-actions-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Video table */
.video-table .video-thumb {
    width: 6rem;
    padding: 0.5rem 0.75rem;
}

.video-table .video-thumb img {
    width: 100%;
    border-radius: 0;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--surface-hover);
    border: 1px solid var(--border);
}

.video-title {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.video-title:hover {
    color: var(--accent);
}

.video-id {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    font-family: 'SF Mono', monospace;
    font-weight: 500;
}

.video-duration {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    white-space: nowrap;
    font-weight: 600;
}

.video-tracks {
    text-align: center;
    font-weight: 700;
}

.video-row.status-detected {
    background: var(--accent-light);
}

.video-row.status-no_tracks {
    opacity: 0.75;
}

.video-row.status-ignored {
    opacity: 0.5;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.settings-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    padding: 1.5rem;
}

.settings-card h2 {
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    color: var(--text);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-value {
    font-weight: 700;
    color: var(--text-muted);
}

.danger-zone {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--error);
}

/* Flash messages */
.flash-messages {
    margin-bottom: 1rem;
}

.flash {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--accent);
    background: var(--surface);
    font-weight: 600;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 0.35rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Video Detail */
.video-detail-header {
    display: flex;
    gap: 1.5rem;
    background: var(--surface);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.video-detail-thumb {
    width: 320px;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--surface-hover);
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.video-detail-info {
    flex: 1;
    min-width: 0;
}

.video-detail-info h1 {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.video-detail-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.video-detail-url a {
    color: var(--accent);
    word-break: break-all;
    font-weight: 600;
    font-size: 0.85rem;
}

.video-detail-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.75rem 0;
    max-width: 600px;
    line-height: 1.6;
}

.video-detail-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.track-title-cell {
    font-weight: 600;
}

/* ==================== MODERN AUDIO PLAYER ==================== */

.audio-player-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    min-height: 500px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    position: relative;
    overflow: hidden;
}

/* ---- Hero: centered album art + track info ---- */
.player-hero {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem 1.5rem;
    gap: 1.5rem;
    min-height: 0;
    overflow: hidden;
}

.player-artwork {
    width: 220px;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(29, 53, 87, 0.18), 0 2px 8px rgba(0,0,0,0.06);
    flex-shrink: 0;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.player-artwork:hover {
    transform: scale(1.02);
    box-shadow: 0 16px 48px rgba(29, 53, 87, 0.22), 0 4px 12px rgba(0,0,0,0.08);
}

.artwork-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artwork-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    font-size: 4rem;
    color: white;
}

.player-track-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 0;
    max-width: 100%;
}

.track-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin: 0;
    line-height: 1.25;
    text-transform: none;
    letter-spacing: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.track-artist {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0.35rem 0 0;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* ---- Progress Section ---- */
.player-progress-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.5rem;
    height: 32px;
    flex-shrink: 0;
}

.time-current,
.time-total {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    min-width: 3.2rem;
    text-align: center;
    user-select: none;
}

.progress-container {
    flex: 1;
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
}

.progress-bar-bg {
    width: 100%;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    transition: height 0.15s ease;
}

.progress-bar-buffer {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--surface-hover);
    border-radius: 3px;
    transition: width 0.2s;
}

.progress-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.1s linear;
    z-index: 1;
}

.seek-slider {
    position: absolute;
    inset: -8px 0;
    width: 100%;
    height: calc(100% + 16px);
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.progress-container:hover .progress-bar-bg {
    height: 8px;
}

/* ---- Controls Bar ---- */
.player-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.5rem 0.75rem;
    gap: 0.5rem;
    flex-shrink: 0;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.left-controls,
.right-controls {
    flex: 1;
    min-width: 0;
}

.right-controls {
    justify-content: flex-end;
}

.playback-controls {
    gap: 1.25rem;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: all 0.15s;
    border-radius: 50%;
    padding: 0.5rem;
    position: relative;
}

.control-btn:hover {
    color: var(--accent);
    background: var(--surface-hover);
}

.control-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.control-btn.secondary {
    opacity: 0.6;
    width: 36px;
    height: 36px;
}

.control-btn.secondary:hover {
    opacity: 1;
}

.control-btn.secondary.active {
    opacity: 1;
    color: var(--accent);
    background: var(--accent-light);
}

.control-btn.nav-btn {
    width: 40px;
    height: 40px;
}

.control-btn.nav-btn svg {
    width: 26px;
    height: 26px;
}

.control-btn.play-btn {
    width: 56px;
    height: 56px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(230, 57, 70, 0.35);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.control-btn.play-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.45);
    color: white;
}

.repeat-indicator {
    position: absolute;
    bottom: 1px;
    right: 1px;
    font-size: 0.55rem;
    font-weight: 800;
    background: var(--accent);
    color: white;
    padding: 1px 3px;
    border-radius: 2px;
    display: none;
    line-height: 1;
}

.control-btn.active .repeat-indicator {
    display: block;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.volume-slider-container {
    width: 90px;
    height: 24px;
    display: flex;
    align-items: center;
}

.volume-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#speed-indicator {
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 2rem;
    text-align: center;
}

/* ---- Playlist ---- */
.playlist-container {
    flex-shrink: 0;
    max-height: 260px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.5rem;
    background: var(--surface-hover);
    flex-shrink: 0;
}

.playlist-header h3 {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin: 0;
}

.playlist-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.playlist {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem 0.5rem;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    border: 2px solid transparent;
    margin-bottom: 0.15rem;
}

.playlist-item:hover {
    background: var(--surface-hover);
}

.playlist-item:focus-visible {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-hover);
}

.playlist-item.active {
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
}

.pl-indicator {
    width: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.pl-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.pl-playing-icon {
    display: none;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    height: 16px;
}

.pl-playing-icon .bar {
    width: 3px;
    background: var(--accent);
    border-radius: 1px;
    animation: playing-bar 0.8s ease-in-out infinite;
}

.pl-playing-icon .bar:nth-child(1) { height: 8px; animation-delay: 0s; }
.pl-playing-icon .bar:nth-child(2) { height: 14px; animation-delay: 0.1s; }
.pl-playing-icon .bar:nth-child(3) { height: 10px; animation-delay: 0.2s; }

@keyframes playing-bar {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.6); }
}

.playlist-item.active .pl-number {
    display: none;
}

.playlist-item.active .pl-playing-icon {
    display: flex;
}

.pl-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.pl-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-duration {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.pl-download-btn {
    opacity: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s, color 0.15s;
    flex-shrink: 0;
    border-radius: 4px;
}

.playlist-item:hover .pl-download-btn {
    opacity: 1;
}

.pl-download-btn:hover {
    color: var(--accent);
    background: var(--accent-light);
}

/* ---- Error Display ---- */
.player-error {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: var(--error);
    color: white;
    padding: 0.875rem 1.1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    max-width: 400px;
}

.player-error button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.player-error button:hover {
    opacity: 1;
}

/* ---- Help Toggle & Shortcuts ---- */
.help-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    z-index: 50;
}

.help-toggle:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.shortcuts-help {
    position: fixed;
    bottom: 4rem;
    right: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 50;
    min-width: 220px;
}

.shortcuts-help h4 {
    margin: 0 0 0.75rem 0;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
}

.shortcuts-help ul {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
}

.shortcuts-help li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
}

.shortcuts-help li:last-child {
    border-bottom: none;
}

kbd {
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'SF Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ==================== AUDIO PLAYER RESPONSIVE ==================== */

@media (max-width: 900px) {
    .player-artwork {
        width: 180px;
        height: 180px;
    }
    
    .track-title {
        font-size: 1.2rem;
    }

    .control-group.left-controls,
    .control-group.right-controls {
        display: none;
    }

    .player-controls-bar {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .player-hero {
        padding: 1.25rem 1rem 1rem;
        gap: 1rem;
    }

    .player-artwork {
        width: 150px;
        height: 150px;
    }

    .track-title {
        font-size: 1.05rem;
    }

    .track-artist {
        font-size: 0.85rem;
    }

    .player-progress-section {
        padding: 0 1rem;
    }

    .time-current,
    .time-total {
        font-size: 0.7rem;
        min-width: 2.5rem;
    }

    .control-btn.play-btn {
        width: 48px;
        height: 48px;
    }

    .control-btn.play-btn svg {
        width: 24px;
        height: 24px;
    }

    .control-btn.nav-btn {
        width: 36px;
        height: 36px;
    }

    .playlist-item {
        padding: 0.5rem 0.6rem;
    }

    .pl-download-btn {
        opacity: 1;
    }

    .shortcuts-help {
        left: 1rem;
        right: 1rem;
        bottom: 4rem;
        min-width: auto;
    }
}
