/* ==================== RESET & VARIABLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-hover: #2a2a2a;
    --bg-active: #333333;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    
    --accent-primary: #00d4aa;
    --accent-secondary: #00b894;
    --accent-cyan: #00CED1;
    --accent-blue: #4169E1;
    --accent-yellow: #f0c040;
    
    --border-color: #333333;
    --border-light: #444444;
    
    --sidebar-width: 240px;
    --header-height: 60px;
    --footer-height: 80px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

/* ==================== APP CONTAINER ==================== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-info span,
.sidebar.collapsed .setlist-name {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 16px 8px;
}

.sidebar.collapsed .logo {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px;
}

.sidebar.collapsed .nav-item i {
    margin-right: 0;
    font-size: 18px;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
    padding: 12px 8px;
}

.sidebar.collapsed .user-avatar {
    margin-right: 0;
}

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

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

.logo-icon {
    width: 28px;
    height: 28px;
    color: var(--text-primary);
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    display: block;
    padding: 0 16px;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition-fast);
    cursor: pointer;
}

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

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

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

.nav-item .badge {
    margin-left: auto;
    padding: 2px 8px;
    background-color: var(--bg-tertiary);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
}

.setlist-item {
    padding-left: 20px;
}

.setlist-item .setlist-thumb {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background-color: var(--bg-tertiary);
}

.setlist-item .setlist-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setlist-item .setlist-name {
    font-size: 13px;
    color: var(--text-primary);
}

.setlist-item .setlist-author {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding: 8px 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

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

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

.user-plan {
    font-size: 11px;
    color: var(--text-muted);
}

.user-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.page {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.page.hidden {
    display: none;
}

.page-header {
    padding: 24px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.page-header h1 .track-count {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 12px;
}

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

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

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    min-width: 200px;
}

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

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

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

/* ==================== BUTTONS ==================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.btn-hifi {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: none;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.btn-hifi i {
    color: var(--accent-yellow);
}

.btn-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.btn-tool {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-tool:hover {
    background-color: var(--bg-hover);
}

/* ==================== TRACKS TABLE ==================== */
.tracks-table {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 32px;
}

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

.table-header .col-bpm,
.table-header .col-key,
.table-header .col-duration {
    text-align: center;
}

.table-body {
    flex: 1;
    overflow-y: auto;
}

.track-row {
    display: grid;
    grid-template-columns: 1fr 150px 60px 80px 70px 40px;
    gap: 12px;
    padding: 12px 16px;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.track-row .col-actions {
    display: flex;
    justify-content: center;
}

.track-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    opacity: 0;
}

.track-row:hover .track-menu-btn {
    opacity: 1;
}

.track-menu-btn:hover {
    background-color: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

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

.track-row .track-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.track-row .track-thumb {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    object-fit: cover;
    background-color: var(--bg-tertiary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    flex-shrink: 0;
}

.track-row .track-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.track-row .track-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

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

.track-row .col-bpm,
.track-row .col-key,
.track-row .col-duration {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}

.track-row .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.processing {
    background-color: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.status-badge.separated {
    background-color: rgba(0, 212, 170, 0.2);
    color: var(--accent-primary);
}

/* ==================== SORTABLE COLUMNS ==================== */
.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}

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

.sortable.active {
    color: var(--accent-primary);
}

.sort-icon {
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.5;
}

.sortable.active .sort-icon {
    opacity: 1;
}

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

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.pagination.hidden {
    display: none;
}

.pagination-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #000;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 13px;
    margin: 0 12px;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-muted);
}

.empty-state.hidden {
    display: none;
}

.empty-state i {
    font-size: 64px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 14px;
}

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

.tab-btn {
    padding: 16px 24px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
}

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

.tab-btn.active {
    color: var(--text-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--text-primary);
}

.upload-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.upload-dropzone {
    width: 100%;
    max-width: 600px;
    padding: 80px 48px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.upload-dropzone:hover {
    border-color: var(--text-muted);
    background-color: var(--bg-secondary);
}

.upload-dropzone.dragover {
    border-color: var(--accent-primary);
    background-color: rgba(0, 212, 170, 0.05);
}

.upload-dropzone i {
    font-size: 32px;
    color: var(--text-muted);
}

.upload-dropzone p {
    font-size: 16px;
    color: var(--text-primary);
}

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

.upload-progress {
    padding: 24px 32px;
}

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

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.progress-bar {
    height: 4px;
    background-color: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

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

/* ==================== STEMS SELECTION ==================== */
.stems-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stems-section {
    width: 100%;
    max-width: 800px;
    margin-bottom: 32px;
}

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

.stems-section h3 i {
    font-size: 12px;
    color: var(--text-muted);
}

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

.stems-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stem-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
}

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

.stem-card.selected {
    border-color: var(--accent-primary);
}

.stem-card.wide {
    grid-column: span 2;
}

.stem-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stem-name {
    font-size: 14px;
    font-weight: 500;
}

.stem-count {
    font-size: 12px;
    color: var(--text-muted);
}

.stem-expand {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
}

.stem-check {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-primary);
    border-radius: 50%;
    color: var(--bg-primary);
    font-size: 12px;
    opacity: 0;
    transition: var(--transition-fast);
}

.stem-card.selected .stem-check {
    opacity: 1;
}

.stems-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

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

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

/* ==================== EDITOR ==================== */
.editor-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.track-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background-color: var(--bg-tertiary);
}

.track-title {
    font-size: 16px;
    font-weight: 500;
}

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

.bpm-display,
.key-display {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

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

#page-editor {
    display: none;
    flex-direction: column;
    height: 100%;
}

#page-editor:not(.hidden) {
    display: flex;
}

.editor-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.editor-tracks-area {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.tracks-controls-column {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background-color: #151515;
    border-right: 1px solid rgba(255,255,255,0.08);
}

.timeline-header {
    height: 32px;
    background-color: #1a1a1a;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
}

.stems-footer {
    padding: 12px 16px;
    background-color: #1a1a1a;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.btn-reset-link {
    background: transparent;
    border: none;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-reset-link:hover {
    color: #aaa;
    text-decoration: underline;
}

.stems-controls-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #151515;
}

.stems-controls-list::-webkit-scrollbar {
    display: none;
}

.tracks-waveforms-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.timeline-ruler {
    height: 32px;
    background-color: #1a1a1a;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: flex-end;
    padding: 0 16px 6px;
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    position: relative;
    flex-shrink: 0;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.timeline-ruler span {
    position: absolute;
    transform: translateX(-50%);
    padding-bottom: 2px;
}

.waveforms-container {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #0d0d0d;
}

.playhead {
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, #fff 0%, rgba(255,255,255,0.8) 100%);
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(255,255,255,0.4), 0 0 2px rgba(255,255,255,0.8);
}

.playhead::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -6px;
    width: 14px;
    height: 14px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.stems-waveforms-list {
    min-height: 100%;
}

/* ==================== STEM CONTROL ROW ==================== */
.stem-control-row {
    display: flex;
    align-items: center;
    height: 36px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0 12px;
    gap: 8px;
    transition: background-color 0.15s;
}

.stem-control-row:hover {
    background-color: rgba(255,255,255,0.03);
}

.stem-control-row.muted {
    opacity: 0.4;
}

/* ==================== STEM WAVEFORM ROW ==================== */
.stem-waveform-row {
    height: 36px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: relative;
    border-radius: 4px;
    margin: 0 8px 0 0;
    overflow: hidden;
}

.stem-waveform-row.muted {
    opacity: 0.25;
}

/* ==================== STEM BUTTONS ==================== */
.stem-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255,255,255,0.08);
    border: none;
    border-radius: 4px;
    color: rgba(255,255,255,0.6);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.stem-btn:hover {
    background-color: rgba(255,255,255,0.15);
    color: #fff;
}

.stem-btn.mute-btn.active {
    background-color: #e74c3c;
    color: #fff;
}

.stem-btn.solo-btn.active {
    background-color: #f39c12;
    color: #000;
}

/* ==================== STEM NAME & COLOR INDICATOR ==================== */
.stem-color-indicator {
    width: 3px;
    height: 24px;
    border-radius: 2px;
    flex-shrink: 0;
}

.stem-icon {
    font-size: 12px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.stem-name {
    min-width: 60px;
    max-width: 80px;
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== STEM SLIDERS ==================== */
.stem-sliders {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.pan-slider,
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.pan-slider {
    width: 40px;
}

.volume-slider {
    width: 60px;
}

.pan-slider::-webkit-slider-thumb,
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background-color: #1DB954;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.pan-slider::-webkit-slider-thumb {
    background-color: #00CED1;
}

.pan-slider::-moz-range-thumb,
.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background-color: #1DB954;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.pan-slider::-moz-range-thumb {
    background-color: #00CED1;
}

.stem-waveform-row .waveform-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: linear-gradient(180deg, #1a1a1a 0%, #111 100%);
    border-top: 1px solid rgba(255,255,255,0.08);
    height: var(--footer-height);
}

/* Chord Display */
.chord-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(29, 185, 84, 0.15);
    border: 1px solid rgba(29, 185, 84, 0.3);
    border-radius: 8px;
    margin-left: 16px;
}

.chord-label {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}

.chord-current {
    font-size: 18px;
    font-weight: 700;
    color: #1DB954;
    min-width: 50px;
    text-align: center;
}

/* Cifra Area */
.cifra-area {
    background: #1a1a1a;
    border-top: 1px solid rgba(255,255,255,0.1);
    max-height: 250px;
    display: flex;
    flex-direction: column;
}

.cifra-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #222;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.cifra-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.cifra-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-small:hover {
    background: rgba(255,255,255,0.2);
}

.btn-small.active {
    background: #1DB954;
}

.cifra-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.cifra-empty {
    text-align: center;
    color: rgba(255,255,255,0.4);
    padding: 40px;
}

.cifra-empty .hint {
    font-size: 12px;
    margin-top: 8px;
}

.cifra-line {
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.cifra-line.current {
    background: rgba(29, 185, 84, 0.2);
    border-left: 3px solid #1DB954;
}

.cifra-line.chord {
    color: #1DB954;
    font-weight: 600;
}

.cifra-line.section {
    color: #f0a500;
    font-weight: 700;
    margin-top: 16px;
}

.cifra-line.synced {
    cursor: pointer;
}

.cifra-line.synced:hover {
    background: rgba(255,255,255,0.05);
}

/* Sync Mode */
.cifra-area.sync-mode .cifra-header {
    background: #1DB954;
}

.cifra-area.sync-mode .cifra-line:not(.synced) {
    opacity: 0.5;
}

.cifra-area.sync-mode .cifra-line.next-to-sync {
    background: rgba(240, 165, 0, 0.3);
    border-left: 3px solid #f0a500;
    opacity: 1;
}

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

.player-controls .btn-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    border-radius: 50%;
    transition: all 0.15s ease;
    cursor: pointer;
}

.player-controls .btn-icon:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

/* Master Volume Control */
.master-volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-right: 12px;
    border-right: 1px solid rgba(255,255,255,0.1);
    margin-right: 4px;
}

.master-volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    cursor: pointer;
}

.master-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #1DB954;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
}

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

.master-volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #1DB954;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.master-volume-label {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    min-width: 35px;
    text-align: right;
}

.btn-play {
    width: 48px !important;
    height: 48px !important;
    background: #1DB954 !important;
    border: none;
    border-radius: 50%;
    color: #000 !important;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(29, 185, 84, 0.3);
}

.btn-play:hover {
    transform: scale(1.05);
    background: #1ed760 !important;
    box-shadow: 0 6px 16px rgba(29, 185, 84, 0.4);
}

.timeline-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 500px;
    margin: 0 32px;
}

.time-current,
.time-total {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    min-width: 36px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.timeline-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background-color: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.footer-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==================== MODALS ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    min-width: 400px;
    max-width: 500px;
}

.modal-content h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
}

.modal-content input:focus,
.modal-content textarea:focus {
    border-color: var(--accent-primary);
}

.modal-content textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.export-option:hover {
    background-color: var(--bg-hover);
}

.export-option input {
    width: auto;
    margin: 0;
}

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

#exportTracksList {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.export-track-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.export-track-item input {
    width: auto;
    margin: 0;
}

/* ==================== CONTEXT MENU ==================== */
.context-menu {
    position: fixed;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 0;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 3000;
}

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

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
}

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

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

.context-menu-item.danger {
    color: #e74c3c;
}

.context-menu-item.danger i {
    color: #e74c3c;
}

.context-menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 8px 0;
}

/* ==================== FILE INFO MODAL ==================== */
.modal-file-info {
    max-width: 700px;
    width: 90vw;
}

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

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

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

.file-info-content {
    display: flex;
    gap: 24px;
}

.file-info-left {
    width: 200px;
    flex-shrink: 0;
}

.file-info-cover {
    width: 100%;
    aspect-ratio: 1;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    overflow: hidden;
}

.file-info-cover i {
    font-size: 48px;
    color: var(--text-muted);
}

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

.file-info-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.meta-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.file-info-right {
    flex: 1;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    margin: 0;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon input {
    padding-right: 40px;
}

.btn-search-artist {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.btn-search-artist:hover {
    background-color: var(--bg-hover);
}

/* ==================== ADD TO SETLIST MODAL ==================== */
.setlist-select-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.setlist-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.setlist-select-item:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-primary);
}

.setlist-select-item.selected {
    border-color: var(--accent-primary);
    background-color: rgba(0, 212, 170, 0.1);
}

.setlist-select-item i {
    color: var(--text-muted);
}

.setlist-select-item span {
    flex: 1;
}

.empty-setlists {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--accent-primary);
}

.toast.error {
    border-left: 4px solid #e74c3c;
}

.toast.info {
    border-left: 4px solid var(--accent-blue);
}

.toast i {
    font-size: 18px;
}

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

.toast.error i {
    color: #e74c3c;
}

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

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .sidebar {
        width: 60px;
    }
    
    .logo-text,
    .nav-item span,
    .nav-section-title,
    .user-details,
    .badge {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .editor-sidebar {
        left: 60px;
    }
}

@media (max-width: 768px) {
    .stems-grid {
        grid-template-columns: 1fr;
    }
    
    .stem-card.wide {
        grid-column: span 1;
    }
    
    .table-header,
    .track-row {
        grid-template-columns: 1fr 100px 80px;
    }
    
    .col-genre,
    .col-bpm,
    .col-key {
        display: none;
    }
}

/* ==================== LOADING OVERLAY ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.visible {
    opacity: 1;
}

.loading-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.loading-header {
    text-align: center;
    margin-bottom: 24px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--bg-tertiary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.loading-header h3 {
    color: #fff;
    font-size: 20px;
    margin: 0 0 8px;
}

.loading-status {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.loading-stems {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loading-stem {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
}

.loading-stem.loaded {
    background: rgba(29, 185, 84, 0.1);
}

.loading-stem-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.loading-stem-name {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.loading-stem-percent {
    color: var(--text-secondary);
    font-size: 12px;
}

.loading-stem.loaded .loading-stem-percent {
    color: var(--accent-primary);
}

.loading-stem-bar {
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    overflow: hidden;
}

.loading-stem-progress {
    height: 100%;
    border-radius: 2px;
    transition: width 0.2s ease;
}

/* Reset button */
.reset-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    margin-left: 8px;
    background: transparent;
    border: 1px solid var(--text-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.reset-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.reset-btn i {
    font-size: 10px;
}

/* ==================== PROJETOS ==================== */

/* Projeto item na sidebar */
.project-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 4px;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-secondary);
}

.project-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.project-item.active {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-primary);
}

.project-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.project-name {
    font-size: 13px;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-count {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.add-project-btn {
    opacity: 0.7;
}

.add-project-btn:hover {
    opacity: 1;
}

/* Modal de Projeto */
.project-modal {
    max-width: 450px;
}

.project-modal .form-group {
    margin-bottom: 20px;
}

.project-modal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.project-modal .form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.project-modal .form-group input[type="text"]:focus {
    border-color: var(--accent-primary);
}

.project-modal .form-group input[type="text"]::placeholder {
    color: var(--text-muted);
}

/* Seletor de ícones */
.icon-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.icon-option {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

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

.icon-option.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 212, 170, 0.1);
}

/* Seletor de cores */
.color-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: white;
    box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px currentColor;
}

.color-option.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Estado vazio de projetos */
.no-projects-message {
    padding: 16px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}
