* {
    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, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

h1 {
    font-size: 3em;
    color: #667eea;
    margin-bottom: 10px;
}

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

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
}

h3 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.upload-section {
    margin-bottom: 40px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    background: #eef1ff;
    border-color: #764ba2;
    transform: translateY(-2px);
}

.upload-area.dragover {
    background: #e0e7ff;
    border-color: #764ba2;
}

.upload-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.upload-area p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #10b981;
    color: white;
}

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

.btn-success:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.btn-preset {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    font-size: 1.1em;
}

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

.btn-play {
    background: #8b5cf6;
    color: white;
}

.btn-play:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

.file-list {
    margin: 20px 0;
}

.file-item {
    background: #f3f4f6;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: #e5e7eb;
    transform: translateX(5px);
}

.action-buttons {
    text-align: center;
    margin-top: 20px;
}

.module-section {
    margin: 40px 0;
    padding: 30px;
    background: #f9fafb;
    border-radius: 15px;
    border: 2px solid #e5e7eb;
}

.analysis-panel {
    background: white;
    padding: 25px;
    margin: 20px 0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.description {
    color: #6b7280;
    font-size: 0.95em;
    margin-bottom: 20px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

th {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
}

tr:hover {
    background: #f9fafb;
}

.stereo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.stereo-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.stereo-card h4 {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.stereo-value {
    font-size: 2em;
    font-weight: bold;
    margin: 10px 0;
}

.stereo-label {
    font-size: 0.9em;
    opacity: 0.9;
}

.track-selector {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    background: white;
}

.track-selector:focus {
    outline: none;
    border-color: #667eea;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.reference-upload {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

#referenceInfo {
    margin-top: 15px;
    padding: 15px;
    background: #f3f4f6;
    border-radius: 8px;
}

#waveform {
    background: #1f2937;
    border-radius: 8px;
    margin-bottom: 15px;
    min-height: 150px;
}

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

.processed-files {
    margin-top: 20px;
}

.processed-item {
    background: #ecfdf5;
    border: 2px solid #10b981;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.spinner {
    border: 5px solid #f3f4f6;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-overlay p {
    font-size: 1.3em;
    font-weight: 600;
}

canvas {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .preset-buttons {
        grid-template-columns: 1fr;
    }
    
    .reference-upload {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Toggle Switch Styles */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin-right: 10px;
    vertical-align: middle;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #667eea;
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    vertical-align: middle;
    font-weight: 500;
}

.effect-toggle-container {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

/* Radio button styles for presets */
.preset-radio {
    display: inline-block;
    margin: 5px;
    padding: 8px 15px;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-radio:hover {
    background: #f0f4ff;
}

.preset-radio input[type="radio"] {
    display: none;
}

.preset-radio:has(input:checked) {
    background: #667eea;
    color: white;
}

.btn-large {
    padding: 15px 30px !important;
    font-size: 1.2em !important;
}
