/* ========================================
   OLEVITA - Separação de Faixas Musicais
   Dark Theme Styles
   ======================================== */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-sidebar: #0d0d0d;
    --bg-card: #1a1a1a;
    --bg-hover: #222222;
    --bg-active: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;
    --accent: #00E5C0;
    --accent-hover: #00CCA8;
    --accent-light: rgba(0, 229, 192, 0.15);
    --border: #2a2a2a;
    --border-light: #333333;
    --danger: #ff4444;
    --warning: #ffaa00;
    --waveform-bg: rgba(0, 229, 192, 0.1);
    --waveform-active: #00E5C0;
    --waveform-blue: #4FC3F7;
    --track-vocals: #00E5C0;
    --track-drums: #4FC3F7;
    --track-keyboard: #00E5C0;
    --track-guitar: #00E5C0;
    --track-bass: #4FC3F7;
    --track-piano: #FF7043;
    --track-original: #00E5C0;
    --track-other: #4FC3F7;
    --sidebar-width: 240px;
    --player-height: 120px;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px 16px;
}

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

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.sidebar-nav {
    padding: 0 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s;
    cursor: pointer;
}

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

.nav-item.active {
    background: var(--bg-active);
    color: var(--text-primary);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-section {
    padding: 24px 8px 8px;
}

.section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 12px 8px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
}

.user-plan {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
}

.setlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.setlist-item:hover {
    background: var(--bg-hover);
}

.setlist-thumb {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.setlist-thumb i {
    color: var(--text-muted);
    font-size: 14px;
}

.setlist-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.setlist-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.setlist-author {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    position: relative;
}

.page {
    padding: 32px;
    min-height: 100%;
}

.page.hidden {
    display: none;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Search Box */
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    min-width: 200px;
}

.search-box i {
    color: var(--text-muted);
    font-size: 14px;
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    width: 100%;
    font-family: inherit;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Buttons */
.btn-primary {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    font-family: inherit;
}

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

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

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

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.2s;
}

.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.btn-send {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    font-family: inherit;
}

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

.btn-export {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-export:hover {
    border-color: var(--accent);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.filter-tab {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.filter-tab:hover {
    border-color: var(--text-muted);
}

.filter-tab.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

/* Sort Bar */
.sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.music-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.sort-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.sort-btn:hover {
    color: var(--text-primary);
}

/* Tracks Table */
.tracks-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 40px 2fr 1.5fr 1fr 80px 80px 80px 40px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.table-body {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

.track-row {
    display: grid;
    grid-template-columns: 40px 2fr 1.5fr 1fr 80px 80px 80px 40px;
    padding: 10px 12px;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.track-row:hover {
    background: var(--bg-hover);
}

.col-check {
    display: flex;
    align-items: center;
}

.col-check input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.col-title {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.track-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.track-thumb i {
    color: var(--text-muted);
    font-size: 16px;
}

.track-title-text {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-artist {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-genre {
    color: var(--text-muted);
}

.col-bpm, .col-key, .col-duration {
    color: var(--text-secondary);
    text-align: center;
}

.col-actions {
    display: flex;
    justify-content: flex-end;
}

/* ========== UPLOAD PAGE ========== */
.upload-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.upload-tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-family: inherit;
}

.upload-tab:hover {
    color: var(--text-primary);
}

.upload-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.upload-area {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}

.upload-dropzone {
    width: 100%;
    max-width: 700px;
    border: 2px dashed var(--border-light);
    border-radius: 16px;
    padding: 80px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.dropzone-icon {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.dropzone-text {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.dropzone-formats {
    font-size: 13px;
    color: var(--text-muted);
}

.dropzone-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    max-width: 400px;
}

.dropzone-file-name {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-hover);
    border-radius: 6px;
}

.dropzone-file-name i {
    color: var(--accent);
    font-size: 12px;
}

.upload-status {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.upload-status.hidden {
    display: none;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-primary);
}

.status-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hifi-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    transition: 0.3s;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
    background-color: #000;
}

/* ========== TRACK SELECTION ========== */
.separation-section {
    max-width: 800px;
    margin: 0 auto;
}

.section-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-label i {
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
}

.section-label-sm {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.section-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.track-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 32px;
}

.track-option {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.track-option:hover {
    border-color: var(--text-muted);
    background: var(--bg-hover);
}

.track-option.selected {
    border-color: var(--accent);
    color: var(--text-primary);
}

.track-option i:first-child,
.track-option .track-svg-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.track-svg-icon {
    color: currentColor;
}

.expand-icon {
    margin-left: auto;
    font-size: 12px !important;
    width: auto !important;
    color: var(--text-muted);
}

.audiovisual-section {
    margin-top: 24px;
}

.audiovisual-option {
    grid-column: 1 / -1;
}

.audiovisual-option div {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.audiovisual-option small {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.audiovisual-option .fa-lock {
    margin-left: auto;
    color: var(--text-muted);
}

.separation-footer {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

/* ========== PLAYER PAGE ========== */
#page-player {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

.player-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.btn-back {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-back:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.track-info-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.track-info-header i {
    color: var(--accent);
}

.player-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.pitch-control {
    position: relative;
}

.bpm-display, .key-display, .time-sig-display {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.bpm-display.is-interactive,
.key-display.is-interactive {
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.bpm-display.is-interactive:hover,
.key-display.is-interactive:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.bpm-display i, .key-display i {
    color: var(--text-muted);
    font-size: 12px;
}

.key-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 300px;
    background: #1d1f23;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    z-index: 25;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.key-popover.hidden {
    display: none;
}

.key-popover h4 {
    text-align: center;
    margin-bottom: 12px;
    font-size: 24px;
    color: var(--text-primary);
}

.key-tuning-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.key-tuning-row select {
    background: transparent;
    color: var(--text-primary);
    border: none;
    font-size: 16px;
    font-weight: 600;
}

.key-stepper {
    display: grid;
    grid-template-columns: 58px 1fr 58px;
    gap: 12px;
    margin-bottom: 12px;
}

.key-stepper button,
#key-popover-value {
    height: 58px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #2a2c30;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
}

.key-stepper button {
    cursor: pointer;
    transition: border-color 0.2s;
}

.key-stepper button:hover {
    border-color: var(--accent);
}

#key-popover-value {
    font-size: 36px;
    font-weight: 700;
}

.key-reset-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
}

/* Separation Progress */
.separation-progress {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.separation-progress.hidden {
    display: none;
}

/* Pitch Loading Overlay */
.pitch-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 17, 20, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(4px);
}

.pitch-loading-overlay.hidden {
    display: none;
}

.pitch-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.pitch-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.pitch-loading-text {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.pitch-loading-bar-container {
    width: 200px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.pitch-loading-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Export Progress Overlay */
.export-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 12, 15, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(6px);
}

.export-progress-overlay.hidden {
    display: none;
}

.export-progress-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 60px;
    background: var(--card-bg, #1a1d23);
    border-radius: 16px;
    border: 1px solid var(--border, #2a2d35);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    min-width: 320px;
}

.export-progress-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border, #2a2d35);
    border-top-color: var(--accent, #00E5C0);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.export-progress-text {
    color: var(--text-primary, #fff);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.export-progress-bar-container {
    width: 280px;
    height: 6px;
    background: var(--border, #2a2d35);
    border-radius: 3px;
    overflow: hidden;
}

.export-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent, #00E5C0), #00c4a0);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.export-progress-percent {
    color: var(--accent, #00E5C0);
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.export-cancel-btn {
    margin-top: 8px;
    font-size: 13px;
    padding: 6px 20px;
}

/* ========== PLAYER BODY (split layout) ========== */
.player-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Tracks Area */
.tracks-area {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-width: 0;
    transition: flex 0.3s ease;
}

/* When center panel or sections are visible, tracks shrink */
.player-body.has-center .tracks-area {
    flex: 0 0 230px;
    max-width: 230px;
    border-right: 1px solid var(--border);
}

.player-body.has-center .tracks-area .track-waveform-container {
    display: none;
}

.player-body.has-center .tracks-area .speed-control {
    display: none;
}

/* Center Panel (Lyrics + Chords) */
.center-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.center-panel.hidden {
    display: none;
}

.lyrics-view {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px 28px 8px;
}

.lyrics-view.hidden {
    display: none;
}

.lyrics-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

/* Chords View (bottom of center panel) */
.chords-view {
    border-top: 1px solid var(--border);
    padding: 16px 28px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-height: 200px;
}

.chords-view.hidden {
    display: none;
}

.chord-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.chord-diagram {
    position: relative;
    display: flex;
    justify-content: center;
}

.chord-diagram svg {
    display: block;
}

.chord-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

/* Chord carousel: prev | current | next */
.chord-carousel {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 40px;
    width: 100%;
}

.chord-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.chord-item.chord-active {
    transform: scale(1);
    opacity: 1;
}

.chord-item.chord-active .chord-name {
    font-size: 28px;
    color: #ffffff;
}

.chord-item.chord-side {
    transform: scale(0.65);
    opacity: 0.45;
}

.chord-item.chord-side .chord-name {
    font-size: 18px;
    color: var(--text-muted);
}

.lyrics-refresh-btn {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.lyrics-refresh-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.lyrics-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Lyrics editor overlay */
.lyrics-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
}

.lyrics-editor.hidden {
    display: none;
}

.lyrics-editor textarea {
    width: 100%;
    min-height: 220px;
    max-height: 50vh;
    resize: vertical;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.7;
    padding: 12px;
    box-sizing: border-box;
}

.lyrics-editor textarea::placeholder {
    color: var(--text-muted);
}

.lyrics-editor textarea:focus {
    outline: none;
    border-color: var(--accent, #4a9eff);
}

.lyrics-editor-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.lyrics-editor-btn {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.lyrics-editor-save {
    background: #2a7d4f;
    color: #fff;
    border-color: #2a7d4f;
}

.lyrics-editor-save:hover {
    background: #33956a;
}

.lyrics-editor-cancel {
    background: var(--bg-card);
    color: var(--text-secondary);
}

.lyrics-editor-cancel:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.lyrics-loading,
.lyrics-empty {
    color: var(--text-muted);
    font-size: 14px;
    padding: 10px 4px;
}

.lyrics-loading.hidden,
.lyrics-empty.hidden {
    display: none;
}

.lyrics-lines {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.lyrics-line {
    font-size: 22px;
    line-height: 1.45;
    color: #6e7480;
    margin: 0 0 14px 0;
    transition: color 0.2s ease;
}

.lyrics-line.active-line {
    color: #9aa0ad;
}

/* Word-level highlighting */
.lyrics-word {
    display: inline;
    transition: color 0.15s ease, font-weight 0.15s ease;
    cursor: default;
}

.lyrics-word.spoken {
    color: #b0b6c3;
}

.lyrics-word.active {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(255,255,255,0.25);
}

/* Sections panel is now inside the flex flow, not absolute */
.player-side-panel {
    width: 260px;
    min-width: 260px;
    border-left: 1px solid var(--border);
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.player-side-panel.hidden {
    display: none;
}

.player-side-panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-primary);
}

.sections-list {
    flex: 1;
    overflow-y: auto;
}

.section-row {
    width: 100%;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 12px 16px;
    cursor: pointer;
    text-align: left;
}

.section-check-col {
    width: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
}

.section-repeat-checkbox {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    cursor: pointer;
}

.section-row:hover {
    background: var(--bg-hover);
}

.section-row.active {
    background: rgba(255, 255, 255, 0.08);
}

.section-row.loop-enabled .section-name::after {
    content: '•';
    color: var(--accent);
    margin-left: 6px;
}

.section-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.section-time {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 42px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.section-row-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    gap: 8px;
}

.section-actions-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-actions-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.section-menu {
    position: fixed;
    min-width: 140px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    z-index: 80;
    padding: 6px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.section-menu.hidden {
    display: none;
}

.section-menu-item {
    width: 100%;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-primary);
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-menu-item:hover {
    background: var(--bg-hover);
}

.track-lane {
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    height: 70px;
    position: relative;
}

.track-lane.track-muted {
    opacity: 0.45;
}

.track-lane.track-hidden-by-solo {
    display: none;
}

.track-controls {
    width: 230px;
    min-width: 230px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid var(--border);
    height: 100%;
    flex-shrink: 0;
}

.track-btn {
    width: 22px;
    height: 22px;
    border-radius: 3px;
    border: 1px solid var(--border-light);
    background: none;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: inherit;
}

.track-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.track-btn.active-mute {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.track-btn.active-solo {
    background: var(--warning);
    border-color: var(--warning);
    color: #000;
}

.track-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    min-width: 60px;
}

.track-volume-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

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

.track-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

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

.track-pan-knob {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.track-pan-knob::after {
    content: '';
    width: 2px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 1px;
    position: absolute;
    top: 4px;
}

.track-waveform-container {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.track-waveform {
    width: 100%;
    height: 100%;
    display: block;
}

/* ========== PLAYER CONTROLS ========== */
.player-controls {
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.controls-center {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    color: var(--text-primary);
}

.control-btn.active-loop {
    color: var(--accent);
}

.repeat-mode-btn {
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.repeat-mode-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.repeat-mode-btn.active {
    border-color: var(--accent);
    color: var(--accent);
}

.play-btn {
    background: var(--text-primary) !important;
    color: var(--bg-primary) !important;
    font-size: 16px;
    width: 44px;
    height: 44px;
}

.play-btn:hover {
    transform: scale(1.05);
}

.timeline {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 600px;
}

.time-current, .time-total {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.timeline-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
}

.timeline-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    border: none;
}

.controls-right {
    position: absolute;
    right: 24px;
    bottom: 24px;
    display: flex;
    gap: 8px;
}

/* Controls-right no longer needs offset for sections panel */

.btn-feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-feature:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-feature.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

/* ========== LIBRARY PAGE ========== */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.library-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.library-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.library-card-thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    background: var(--bg-active);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 32px;
    color: var(--accent);
}

.library-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.library-card-artist {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========== EMPTY STATE ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 20px;
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.export-options h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.format-options {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.radio-option {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.radio-option:hover {
    border-color: var(--text-muted);
}

.radio-option.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}

.radio-option input {
    accent-color: var(--accent);
}

.export-track-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.export-track-item input {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

.export-track-item label {
    font-size: 14px;
    cursor: pointer;
}

/* ========== TOAST ========== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    z-index: 2000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: toast-in 0.3s ease;
}

.toast.hidden {
    display: none;
}

.toast i {
    color: var(--accent);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    .sidebar .logo-text,
    .sidebar .nav-item span,
    .sidebar .section-title,
    .sidebar .setlist-info,
    .sidebar .user-details {
        display: none;
    }
    .sidebar .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .main-content {
        width: calc(100% - 60px);
    }
    .upload-status,
    .separation-footer {
        left: 60px;
    }
    .table-header,
    .track-row {
        grid-template-columns: 40px 2fr 1fr 80px 80px 40px;
    }
    .col-genre, .col-artist {
        display: none;
    }
    .player-actions {
        gap: 6px;
    }
    .bpm-display, .key-display, .time-sig-display {
        display: none;
    }
}

/* ========== PLAYHEAD ========== */
.playhead {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--text-primary);
    z-index: 10;
    pointer-events: none;
    left: 0;
}

.playhead::before {
    content: '';
    position: absolute;
    top: 0;
    left: -4px;
    width: 10px;
    height: 10px;
    background: var(--text-primary);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
}

/* Track reset button */
.track-reset-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    margin-top: 4px;
    font-family: inherit;
}

.track-reset-btn:hover {
    text-decoration: underline;
}

/* Metronome track */
.metronome-track .track-waveform-container {
    background: var(--bg-card);
}

/* Speed control */
.speed-control {
    position: absolute;
    bottom: 8px;
    left: 235px;
    display: flex;
    gap: 0;
    z-index: 5;
}

.speed-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 2px 10px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
}

.speed-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.speed-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.speed-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

/* Context menu for track row */
.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 6px;
    min-width: 180px;
    z-index: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.15s;
}

.context-menu-item:hover {
    background: var(--bg-hover);
}

.context-menu-item i {
    width: 16px;
    text-align: center;
    color: var(--text-muted);
}

.context-menu-item.danger {
    color: var(--danger);
}

.context-menu-item.danger i {
    color: var(--danger);
}
