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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    min-height: 100vh;
    padding: 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
    font-size: 1.2rem;
    opacity: 0.95;
}

.upload-section, #resultsSection {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    border: 3px dashed var(--border-color);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-color);
}

.file-label:hover {
    border-color: var(--primary-color);
    background: #f1f5f9;
}

.file-icon {
    font-size: 3rem;
}

#fileName {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.settings {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

.setting-row {
    margin-bottom: 1.5rem;
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.setting-row input[type="number"] {
    width: 150px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.setting-row input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.btn-primary {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#uploadProgress {
    margin-top: 1.5rem;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--bg-color);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-weight: 600;
}

#progressText {
    text-align: center;
    color: var(--text-muted);
    font-weight: 500;
}

.file-info {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Otimização Info */
.optimization-info {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 1rem;
    border-radius: 0.5rem;
    color: white;
}

.optimization-info .info-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.optimization-info .info-value {
    color: white;
    font-size: 1.1rem;
}

.optimization-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    margin-left: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cut-point {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.cut-point.approved {
    border-color: var(--success-color);
    background: #f0fdf4;
}

.cut-point.rejected {
    opacity: 0.5;
    border-color: var(--danger-color);
}

.cut-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cut-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

.confidence {
    display: flex;
    gap: 0.25rem;
    font-size: 1.2rem;
}

.cut-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
}

.cut-actions {
    display: flex;
    gap: 1rem;
}

.preview-section {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    border: 2px solid #e2e8f0;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.preview-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.preview-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

.preview-error {
    text-align: center;
    padding: 1rem;
    color: var(--danger-color);
    background: #fef2f2;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.audio-player {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn-play {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 140px;
}

.btn-play:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-play.playing {
    background: var(--warning-color);
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.time-display {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-color);
    min-width: 40px;
    font-weight: 600;
}

.seek-bar {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.seek-bar::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-dark);
}

.seek-bar::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-control span {
    font-size: 1.2rem;
}

.volume-bar {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--success-color);
    border-radius: 50%;
    cursor: pointer;
}

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

.playback-speed {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border-radius: 0.5rem;
}

.playback-speed label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.playback-speed select {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.375rem;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
}

.playback-speed select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.cut-actions {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-approve {
    background: var(--success-color);
    color: white;
}

.btn-approve:hover {
    background: #059669;
}

.btn-reject {
    background: var(--danger-color);
    color: white;
}

.btn-reject:hover {
    background: #dc2626;
}

.btn-preview {
    background: var(--primary-color);
    color: white;
}

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

.action-buttons {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.track-list {
    margin-top: 2rem;
}

.track-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.track-info h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.track-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-download {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.success-message {
    background: #f0fdf4;
    border: 2px solid var(--success-color);
    color: #166534;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .upload-section, #resultsSection {
        padding: 1.5rem;
    }
    
    .cut-actions {
        flex-direction: column;
    }
    
    .info-grid, .cut-details {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   WAVEFORM VISUALIZATION STYLES
   ============================================ */

.waveform-container {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.waveform-header {
    margin-bottom: 1.5rem;
    position: relative;
}

.waveform-header h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.waveform-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.75rem;
    position: relative;
}

.btn-wave-control {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-wave-control:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-wave-control:active {
    transform: translateY(0);
}

.volume-wave-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-wave-control span {
    font-size: 1.2rem;
}

.volume-wave-control input[type="range"] {
    width: 100px;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speed-control label {
    font-weight: 600;
    color: var(--text-color);
}

.speed-control select {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: white;
    cursor: pointer;
}

.zoom-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-zoom {
    padding: 0.5rem 1rem;
    background: var(--text-muted);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
}

.btn-zoom:hover {
    background: var(--text-color);
}

.waveform-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
}

.current-time {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

.current-time span:first-child {
    color: var(--text-muted);
    font-weight: normal;
    font-size: 1rem;
    margin-right: 0.5rem;
}

#currentTimeDisplay {
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

#totalTimeDisplay {
    font-family: 'Courier New', monospace;
}

.instructions {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Waveform canvas styles */
#waveform {
    position: relative;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background: #1e293b;
    min-height: 200px;
}

/* REMOVIDO: Estava bloqueando a interação com o WaveSurfer */
/* A solução é fazer os overlays aparecerem ACIMA do canvas via z-index */

#wave-timeline {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background: #1e293b;
    opacity: 0.8;
}

/* Estilos personalizados para os marcadores de corte */
.wavesurfer-region {
    border-left: 3px solid !important;
    border-right: 3px solid !important;
}

.wavesurfer-region.auto-cut {
    border-color: #ef4444 !important;
    background-color: rgba(239, 68, 68, 0.1) !important;
}

.wavesurfer-region.manual-cut {
    border-color: #10b981 !important;
    background-color: rgba(16, 185, 129, 0.1) !important;
}

.wavesurfer-region.approved-cut {
    border-color: #6366f1 !important;
    background-color: rgba(99, 102, 241, 0.15) !important;
}

/* Cursor de reprodução */
.wavesurfer-cursor {
    border-right: 2px solid var(--primary-color) !important;
}

/* Modo de carregamento */
.waveform-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.waveform-loading .spinner {
    font-size: 3rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Lista de marcadores */
.markers-list {
    background: var(--bg-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.markers-list h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.marker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.marker-item.auto {
    border-left-color: #ef4444;
}

.marker-item.manual {
    border-left-color: #10b981;
}

.marker-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.marker-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.marker-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.marker-badge.auto {
    background: #fee2e2;
    color: #991b1b;
}

.marker-badge.manual {
    background: #d1fae5;
    color: #065f46;
}

.marker-time {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
}

.marker-confidence {
    font-size: 0.9rem;
    color: var(--text-muted);
}

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

.btn-marker-action {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-marker-action.preview {
    background: var(--primary-color);
    color: white;
}

.btn-marker-action.preview:hover {
    background: var(--primary-dark);
}

.btn-marker-action.remove {
    background: var(--danger-color);
    color: white;
}

.btn-marker-action.remove:hover {
    background: #dc2626;
}

.marker-actions-toolbar {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

/* Responsivo */
@media (max-width: 768px) {
    .waveform-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .waveform-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .marker-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    .marker-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* ==============================================
   NOVO SISTEMA MANUAL - ESTILOS ADICIONAIS
   ============================================== */

/* Botão Adicionar Corte */
.btn-add-cut {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add-cut:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 65, 108, 0.5);
}

.btn-add-cut:active {
    transform: translateY(0);
}

.separator {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 10px;
}

/* Contador de cortes */
.cuts-count {
    background: rgba(255, 65, 108, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cuts-count strong {
    color: #ff416c;
    font-size: 18px;
    font-weight: 700;
}

/* Marcadores de corte na forma de onda - CORRIGIDO */
.waveform-cut-marker {
    position: absolute;
    top: 0;
    height: 100%;
    width: 3px;
    background: #ff416c;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
    pointer-events: auto;
}

.waveform-cut-marker:hover {
    width: 5px;
    background: #ff0040;
    box-shadow: 0 0 15px rgba(255, 65, 108, 0.8);
}

.waveform-cut-marker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #ff416c;
}

.waveform-cut-marker::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid #ff416c;
}

.waveform-cut-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff416c;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 110;
}

.waveform-cut-label::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #ff416c;
}

/* Lista de cortes */
.cuts-list-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: var(--shadow-lg);
}

.cuts-list-container h3 {
    color: var(--text-color);
    font-size: 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cuts-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.cut-item {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 20px;
    background: #f8fafc;
    padding: 15px 20px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.cut-item:hover {
    border-color: #ff416c;
    box-shadow: 0 4px 12px rgba(255, 65, 108, 0.15);
}

.cut-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.cut-info {
    flex: 1;
}

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

.cut-time strong {
    font-size: 18px;
    color: var(--text-color);
}

.cut-duration {
    color: var(--text-muted);
    font-size: 14px;
}

.cut-actions {
    display: flex;
    gap: 10px;
}

.btn-goto {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-goto:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-remove {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Seção de processamento */
.process-section {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    border: 2px dashed #667eea;
}

.btn-process {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-process:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-process:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.process-hint {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 14px;
}

.process-hint strong {
    color: #667eea;
    font-size: 20px;
}

/* Seção de Processar */
.process-section {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 2rem;
    border-left: 4px solid #667eea;
}

.btn-process {
    width: 100%;
    max-width: 400px;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-process:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-process:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.process-hint {
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.95rem;
}

/* Seção de download */
.download-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: var(--shadow-lg);
    border: 3px solid #10b981;
}

.download-section h2 {
    color: #10b981;
    font-size: 28px;
    margin-bottom: 15px;
    text-align: center;
}

.download-section > p {
    text-align: center;
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.download-all {
    text-align: center;
    margin-bottom: 30px;
}

.btn-download-all {
    display: inline-block;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    text-decoration: none;
    padding: 16px 40px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transition: all 0.3s ease;
}

.btn-download-all:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.tracks-list {
    display: grid;
    gap: 10px;
}

.track-item {
    display: grid;
    grid-template-columns: 50px 1fr 80px 120px;
    align-items: center;
    gap: 15px;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.track-number {
    background: #667eea;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.track-name {
    font-weight: 500;
    color: var(--text-color);
}

.track-duration {
    color: var(--text-muted);
    font-size: 14px;
}

.btn-download-track {
    background: #10b981;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
}

.btn-download-track:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Notificações */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-width: 400px;
    animation: slideIn 0.3s ease;
    font-size: 15px;
    font-weight: 500;
}

.notification-success {
    border-left: 4px solid #10b981;
    color: #065f46;
}

.notification-warning {
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.notification-info {
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.notification-error {
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.notification.fade-out {
    animation: slideOut 0.3s ease forwards;
}

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .cut-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .cut-actions {
        justify-content: center;
    }
    
    .track-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .waveform-controls {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .btn-add-cut {
        width: 100%;
        justify-content: center;
    }
}

/* Container da waveform */
#waveform {
    width: 100%;
    position: relative;
    overflow: visible; /* IMPORTANTE: permitir popup aparecer fora */
}

/* Forçar canvas do WaveSurfer para trás dos overlays */
#waveform > wave,
#waveform > div:not(.segment-overlay) {
    position: relative !important;
    z-index: 1 !important;
}

/* ========================================
   OVERLAYS DE SEGMENTOS
   ======================================== */

/* Container do overlay */
.segment-overlay {
    position: absolute;
    top: 0;
    height: 100%;
    border-right: 2px dashed rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    pointer-events: all !important;
    z-index: 1000 !important;
    background: transparent;
    overflow: visible;
}

.segment-overlay:hover {
    background: rgba(102, 126, 234, 0.15);
    cursor: pointer;
}

/* Segmento excluído - Mais acinzentado e visível */
.segment-overlay.segment-excluded {
    background: rgba(0, 0, 0, 0.75) !important;
    opacity: 0.7 !important;
}

.segment-overlay.segment-excluded:hover {
    background: rgba(0, 0, 0, 0.8) !important;
}

/* Barra verde com nome da música */
.segment-name-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    z-index: 5;
    pointer-events: none; /* Não interferir com interação do segmento */
    border-radius: 4px 4px 0 0;
    letter-spacing: 0.3px;
}

/* Informações do segmento (aparece no hover) */
.segment-hover-info {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    width: 200px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1001;
    box-sizing: border-box;
}

.segment-overlay:hover .segment-hover-info {
    opacity: 1;
    pointer-events: all;
    top: -130px;
}

/* Ajustar posição para segmentos nas bordas */
.segment-overlay:first-child .segment-hover-info {
    left: 0;
    transform: translateX(0);
}

.segment-overlay:last-child .segment-hover-info {
    left: auto;
    right: 0;
    transform: translateX(0);
}

/* Header do segmento */
.segment-header {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 8px;
    font-size: 9px;
    color: #64748b;
    align-items: center;
}

.segment-number {
    font-weight: bold;
    color: #667eea;
    font-size: 11px;
}

.segment-time {
    font-weight: 500;
    font-size: 9px;
}

.segment-duration {
    color: #9ca3af;
    font-size: 9px;
}

/* Container do input de nome */
.segment-name-container {
    margin-bottom: 8px;
    display: flex;
    gap: 4px;
    align-items: stretch;
}

/* Input de nome do segmento */
.segment-name-input {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 5px;
    font-size: 11px;
    transition: all 0.2s ease;
}

.segment-name-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.segment-name-input::placeholder {
    color: #cbd5e1;
    font-size: 10px;
}

/* Botão de confirmar nome */
.btn-segment-confirm {
    padding: 6px 10px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-segment-confirm:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-segment-confirm:active {
    transform: translateY(0);
}

/* Botões de ação dos segmentos */
.btn-segment-exclude,
.btn-segment-restore {
    width: 100%;
    padding: 6px 10px;
    border: none;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    pointer-events: all;
}

.btn-segment-exclude {
    background: #fee2e2;
    color: #991b1b;
}

.btn-segment-exclude:hover {
    background: #fecaca;
    transform: translateY(-1px);
}

.btn-segment-restore {
    background: #d1fae5;
    color: #065f46;
}

.btn-segment-restore:hover {
    background: #a7f3d0;
    transform: translateY(-1px);
}

/* Label de excluído */
.segment-excluded-label {
    text-align: center;
    padding: 8px;
    background: #f1f5f9;
    border-radius: 6px;
    font-weight: bold;
    color: #64748b;
    margin-bottom: 10px;
    font-size: 12px;
}

/* Resumo dos segmentos */
#segmentsSummary {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #667eea;
}

#segmentsSummary h3 {
    color: #667eea;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.summary-text {
    font-size: 1rem;
    color: #475569;
}

.summary-text .active {
    color: #10b981;
    font-weight: 600;
}

.summary-text .excluded {
    color: #ef4444;
    font-weight: 600;
}

/* Responsividade */

/* ========================================
   BOTÃO PARA REMOVER CORTES (X)
   ======================================== */

.cut-remove-btn {
    position: absolute;
    left: -10px;
    bottom: -15px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cut-remove-btn:hover {
    background: #dc2626;
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.cut-remove-btn:active {
    transform: scale(0.95);
}

/* Responsividade */

/* Layout compacto da waveform-header */
.waveform-controls-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    position: relative;
}

.current-time-compact {
    font-family: 'Courier New', monospace;
    font-size: 15px;
    font-weight: 600;
    color: #475569;
    padding: 6px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.cuts-count-compact {
    background: #fef3c7;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.cuts-count-compact strong {
    color: #b45309;
    font-size: 16px;
}

/* Botão Adicionar Corte - versão compacta */
.waveform-controls-compact .btn-add-cut {
    padding: 8px 18px;
    font-size: 14px;
}

/* Botão Wave Control - versão compacta */
.waveform-controls-compact .btn-wave-control {
    padding: 8px 16px;
    font-size: 14px;
}

/* ==============================================
   NOVO SISTEMA MANUAL - ESTILOS ADICIONAIS
   ============================================== */
