:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6a6a7a;
    --accent-primary: #7c3aed;
    --accent-secondary: #a855f7;
    --accent-gradient: linear-gradient(135deg, #7c3aed, #a855f7, #ec4899);
    --accent-glow: rgba(124, 58, 237, 0.4);
    --success: #10b981;
    --border-color: rgba(255, 255, 255, 0.08);
    --font-family: 'Inter', sans-serif;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.7;
    font-size: 18px;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at 20% 20%, rgba(124, 58, 237, 0.15), transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.1), transparent 50%);
    pointer-events: none;
}

.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2.5rem;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px var(--accent-glow);
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-badge {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    color: var(--text-secondary);
}

.main {
    flex: 1;
    padding: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.upload-zone {
    background: rgba(255, 255, 255, 0.03);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 5rem 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-zone:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.upload-zone.dragover {
    border-color: var(--accent-secondary);
    background: rgba(124, 58, 237, 0.1);
}

.upload-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-color);
}

.upload-icon svg {
    width: 48px;
    height: 48px;
    color: var(--accent-secondary);
}

.upload-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.upload-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.processing-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.file-icon {
    font-size: 2.5rem;
}

.file-details {
    flex: 1;
}

.file-details h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.file-details p {
    font-size: 1rem;
    color: var(--text-muted);
}

.btn-icon {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.waveform-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.waveform-section {
    margin-bottom: 2rem;
}

.waveform-section:last-child {
    margin-bottom: 0;
}

.waveform-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.waveform-label {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.waveform-label.mastered {
    background: rgba(124, 58, 237, 0.3);
    color: var(--accent-secondary);
}

.waveform-controls {
    display: flex;
    gap: 0.75rem;
    flex: 1;
    justify-content: center;
}

.waveform-time {
    font-size: 1rem;
    color: var(--text-muted);
    min-width: 120px;
    text-align: right;
}

.waveform-canvas {
    width: 100%;
    height: 120px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

/* Play/Stop Buttons */
.btn-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-play svg {
    width: 16px;
    height: 16px;
}

/* Play button - Purple */
.btn-play.play-btn {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: white;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.btn-play.play-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.5);
}

/* Stop button - Navy */
.btn-play.stop-btn {
    background: linear-gradient(135deg, #1e3a5f, #2d4a6f);
    color: white;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.4);
}

.btn-play.stop-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(30, 58, 95, 0.5);
}

.btn-play:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-tertiary) !important;
    box-shadow: none !important;
}

.btn-play.playing {
    background: var(--accent-primary);
    color: white;
    animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px var(--accent-glow);
    }

    to {
        box-shadow: 0 0 15px var(--accent-glow);
    }
}

.mastering-controls {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.controls-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.controls-title::before {
    content: '🎚️ ';
}

.full-width-item {
    grid-column: 1 / -1;
}

.analog-highlight {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border: 1px solid var(--accent-secondary);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.1);
}

.analog-select-main {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.1rem;
    /* Slightly larger for visibility */
    font-weight: 600;
    transition: all 0.2s ease;
    appearance: auto;
    /* Ensure OS default indicator is visible */
}

.analog-select-main:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
}

.control-badge {
    background: var(--accent-secondary);
    color: white;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.preset-selector label,
.analog-selector label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}



.preset-selector select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
}

.preset-selector select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.control-item {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.control-header label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.control-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-secondary);
}

input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 3px;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-gradient);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px var(--accent-glow);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 0 40px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
}

.progress-container {
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.result-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.result-header {
    margin-bottom: 1.5rem;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.result-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    min-width: 120px;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-secondary);
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer {
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

/* 7-Band Dynamic EQ Styles */
.dynEq-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.dynEq-band label {
    text-align: center;
    font-weight: 500;
}

.dynEq-band .band-value {
    font-size: 0.7rem;
    color: #39FF14;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Vertical Slider Styling */
.vertical-slider {
    -webkit-appearance: slider-vertical;
    appearance: slider-vertical;
    width: 24px;
    height: 80px;
    background: transparent;
    cursor: pointer;
}

.vertical-slider::-webkit-slider-runnable-track {
    width: 6px;
    background: linear-gradient(to top, #39FF14 0%, #1a1a25 50%, #ec4899 100%);
    border-radius: 3px;
}

.vertical-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #39FF14, #00E676);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    margin-left: -5px;
}

.vertical-slider::-moz-range-track {
    width: 6px;
    background: linear-gradient(to top, #39FF14 0%, #1a1a25 50%, #ec4899 100%);
    border-radius: 3px;
}

.vertical-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #39FF14, #00E676);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    border: none;
}

/* Mobile responsive for Dynamic EQ */
@media (max-width: 768px) {
    .dynEq-bands {
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 4px !important;
    }

    .vertical-slider {
        height: 60px;
        width: 20px;
    }

    .dynEq-band label {
        font-size: 0.6rem !important;
    }
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {

    .header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .logo {
        gap: 0.75rem;
    }

    .logo-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .logo-icon svg {
        width: 26px;
        height: 26px;
    }

    .logo-text {
        font-size: 5.5vw;
        white-space: nowrap;
    }

    .nav {
        width: 100%;
    }

    .nav button {
        width: 100%;
        padding: 10px 16px !important;
        font-size: 0.9rem !important;
        border-radius: 20px !important;
        justify-content: center;
    }

    .nav button svg {
        width: 16px !important;
        height: 16px !important;
    }

    .main {
        padding: 1rem;
    }

    .upload-zone {
        padding: 3rem 1.5rem;
    }

    .controls-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons,
    .result-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}