/* === Track Item Layout === */
.track-item { flex-direction: column; align-items: stretch; gap: 0; padding: 0; }

.track-main {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0.85rem; position: relative; z-index: 2;
}

.track-actions { display: flex; gap: 0.35rem; margin-left: auto; }
.track-actions .icon-btn {
    width: 28px; height: 28px; font-size: 0.7rem; font-weight: 800;
    border-radius: var(--radius-sm);
}

.btn-mute.active { background: rgba(248,113,113,0.2); color: var(--danger); border-color: rgba(248,113,113,0.3); }
.btn-solo.active { background: rgba(250,204,21,0.15); color: #fbbf24; border-color: rgba(250,204,21,0.25); }

/* === Waveform === */
.track-waveform-container {
    position: relative; height: 56px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255,255,255,0.03);
    overflow: hidden; cursor: crosshair;
}
.waveform-canvas { width: 100%; height: 100%; display: block; }
.playhead {
    position: absolute; top: 0; bottom: 0; left: 0; width: 2px;
    background: var(--accent-secondary);
    box-shadow: 0 0 8px var(--accent-secondary), 0 0 20px rgba(34,211,238,0.2);
    z-index: 10; pointer-events: none;
}

/* === Track Settings === */
.track-settings {
    display: flex; flex-wrap: wrap; gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    background: rgba(0, 0, 0, 0.2); border-top: 1px solid rgba(255,255,255,0.03);
}
.track-setting-group { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 100px; }
.track-setting-group label { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.track-setting-group input[type=number],
.track-setting-group input[type=range] {
    background: rgba(0,0,0,0.35); border: 1px solid var(--border-glass);
    color: var(--text-primary); padding: 0.35rem 0.5rem; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.82rem; width: 100%;
}
.track-setting-group input[type=number]:focus { outline: none; border-color: var(--accent-primary); }

/* === Progress Bar === */
.progress-bar-container {
    width: 280px; height: 6px; background: rgba(255,255,255,0.06);
    border-radius: 99px; overflow: hidden;
}
.progress-bar { height: 100%; width: 0%; background: var(--accent-gradient); transition: width 0.2s ease-out; border-radius: 99px; }
.hidden { display: none !important; }

/* === Drag & Drop === */
.drag-active { border: 2px dashed var(--accent-secondary) !important; background: rgba(34,211,238,0.05) !important; }

/* === Modal === */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(8px);
    z-index: 999; display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.modal-overlay.hidden { display: none !important; }
.modal-panel { width: 100%; max-width: 440px; animation: fadeIn 0.2s ease-out; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.modal-header h2 { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; }
.modal-body { display: flex; flex-direction: column; gap: 0.85rem; }
.modal-field { display: flex; flex-direction: column; gap: 0.3rem; }
.modal-field label { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.modal-field input,
.modal-field select,
.modal-field input[type=password] {
    background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border-glass);
    color: var(--text-primary); padding: 0.55rem 0.75rem; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 0.88rem;
}
.modal-field input:focus, .modal-field select:focus, .modal-field input[type=password]:focus {
    outline: none; border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.modal-field select option { background: #111827; }

/* === Status Messages === */
.rbx-status { padding: 0.65rem 0.85rem; border-radius: var(--radius-sm); font-size: 0.82rem; text-align: center; font-weight: 500; }
.rbx-status.success { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.25); color: var(--success); }
.rbx-status.error { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.25); color: var(--danger); }
.rbx-status.loading { background: rgba(129,140,248,0.1); border: 1px solid rgba(129,140,248,0.25); color: var(--accent-secondary); }

.rbx-info-note {
    background: rgba(129,140,248,0.06); border: 1px solid rgba(129,140,248,0.15);
    border-radius: var(--radius-sm); padding: 0.65rem 0.85rem;
    font-size: 0.78rem; color: var(--text-secondary); line-height: 1.6;
}
.rbx-info-note a { color: var(--accent-secondary); text-decoration: none; font-weight: 600; }
.rbx-info-note a:hover { text-decoration: underline; }

/* === Settings Gear Button === */
.settings-gear {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: rgba(129,140,248,0.1); border: 1px solid rgba(129,140,248,0.2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: var(--transition); color: var(--accent-primary);
}
.settings-gear:hover { background: rgba(129,140,248,0.2); }
.settings-gear i { width: 15px; height: 15px; }

/* === User Badge === */
.user-badge {
    display: flex; align-items: center; gap: 0.4rem;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border-glass);
    border-radius: 99px; padding: 0.3rem 0.5rem 0.3rem 0.65rem;
    font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
    margin-left: 0.25rem;
}
.user-badge i:first-child { width: 14px; height: 14px; color: var(--accent-primary); }
.btn-logout {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    display: flex; align-items: center; padding: 0.2rem; border-radius: 50%;
    transition: all 0.2s;
}
.btn-logout:hover { color: #f87171; background: rgba(248,113,113,0.15); }
.btn-logout i { width: 14px; height: 14px; }

/* === History List === */
.history-list {
    max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem;
    padding-right: 0.25rem;
}
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

.history-item {
    display: flex; align-items: center; gap: 0.75rem;
    background: rgba(0,0,0,0.2); border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm); padding: 0.65rem 0.85rem;
    animation: fadeIn 0.2s ease-out;
}
.history-icon {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.history-icon.success { background: rgba(52,211,153,0.12); color: var(--success); }
.history-icon.error { background: rgba(248,113,113,0.12); color: var(--danger); }
.history-icon i { width: 16px; height: 16px; }
.history-info { flex: 1; min-width: 0; }
.history-name { font-weight: 600; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }
.history-badge {
    font-size: 0.65rem; font-weight: 700; padding: 0.15rem 0.45rem;
    border-radius: 99px; text-transform: uppercase; flex-shrink: 0;
}
.history-badge.mp3 { background: rgba(129,140,248,0.15); color: var(--accent-primary); }
.history-badge.wav { background: rgba(34,211,238,0.15); color: var(--accent-secondary); }
.history-empty { color: var(--text-muted); text-align: center; padding: 2rem 0; font-size: 0.85rem; }
