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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #4C7B31 0%, #3d6226 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

header h1 {
    font-size: 2.5em;
    color: #4C7B31;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

section h2 {
    color: #4C7B31;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.config-group {
    margin-bottom: 25px;
}

.config-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.config-group select,
.config-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.config-group select:focus,
.config-group input[type="text"]:focus {
    outline: none;
    border-color: #4C7B31;
}

.tracks-input {
    margin-top: 10px;
}

.input-options {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.or {
    color: #999;
    font-style: italic;
}

.tracks-list {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
}

.tracks-list .empty-message {
    color: #999;
    font-style: italic;
}

.track-item {
    padding: 8px 12px;
    margin: 5px 0;
    background: #d4e4c8;
    border-radius: 4px;
    border-left: 3px solid #4C7B31;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.track-item-name {
    flex: 1;
    font-weight: 500;
}

.btn-primary,
.btn-secondary,
.btn-download {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: #4C7B31;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #3d6226;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 123, 49, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 12px 16px;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-download {
    background: #4C7B31;
    color: white;
}

.btn-download:hover {
    background: #3d6226;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 123, 49, 0.4);
}

.result-container {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.result-container h3 {
    margin-bottom: 15px;
    color: #4C7B31;
}

.params-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.params-table thead {
    background: #4C7B31;
    color: white;
}

.params-table th,
.params-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.params-table th {
    font-weight: 600;
}

.params-table tbody tr:hover {
    background: #f8f9fa;
}

.params-table tbody tr:last-child td {
    border-bottom: none;
}

.audio-player {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.audio-player audio {
    width: 100%;
}

.waveform-container {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.waveform-container canvas {
    max-width: 100%;
    height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.download-section {
    margin-top: 20px;
    text-align: center;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

#loading-message {
    font-size: 1.2em;
    font-weight: 600;
}

.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

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

.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4C7B31;
    color: white;
    padding: 15px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

/* Contrôles de paramètres */
.params-controls {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.params-controls h3 {
    margin-bottom: 20px;
    color: #4C7B31;
}

#track-controls-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.track-control {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.track-control-header {
    font-weight: 600;
    margin-bottom: 15px;
    color: #555;
    font-size: 1.1em;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.control-row label {
    min-width: 80px;
    font-weight: 500;
    color: #666;
}

.control-row input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.control-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4C7B31;
    cursor: pointer;
}

.control-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #4C7B31;
    cursor: pointer;
    border: none;
}

.control-row input[type="number"] {
    width: 100px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: center;
}

.control-row input[type="number"]:focus {
    outline: none;
    border-color: #4C7B31;
}

.control-value {
    min-width: 80px;
    text-align: right;
    font-weight: 500;
    color: #4C7B31;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2em;
    }

    .input-options {
        flex-direction: column;
        align-items: stretch;
    }

    .input-options .or {
        text-align: center;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    .control-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-row label {
        min-width: auto;
    }
    
    .control-row input[type="number"] {
        width: 100%;
    }
}


