/* ==========================================================================
   LocutorPro - Modern Audio Engineering Studio UI
   ========================================================================== */

:root {
    --bg-main: #090d16;
    --bg-card: rgba(18, 24, 38, 0.75);
    --bg-card-hover: rgba(26, 34, 54, 0.85);
    --bg-inner: rgba(10, 14, 23, 0.6);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.4);
    --border-glow: 0 0 20px rgba(99, 102, 241, 0.25);
    
    --accent-indigo: #6366f1;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;

    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-ab-active: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 6px;

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        linear-gradient(180deg, #070a12 0%, #0c121e 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1.5rem 4rem;
    -webkit-font-smoothing: antialiased;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 2.5rem;
    max-width: 700px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a5b4fc;
    margin-bottom: 1rem;
    backdrop-filter: blur(8px);
}

.brand-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 8px var(--accent-emerald);
}

.app-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.6rem;
}

.app-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Main Container */
.container {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Card Component */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-primary);
}

.card-title svg {
    color: var(--accent-indigo);
}

/* ==========================================================================
   Drop Zone / Upload Section
   ========================================================================== */
.drop-zone {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    background: var(--bg-inner);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}

.drop-zone:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(18, 24, 40, 0.8);
}

.drop-zone.drag-active {
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.12);
    box-shadow: var(--border-glow);
    transform: scale(1.01);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    pointer-events: none;
}

.upload-icon-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    margin-bottom: 0.3rem;
    transition: var(--transition);
}

.drop-zone:hover .upload-icon-circle,
.drop-zone.drag-active .upload-icon-circle {
    transform: translateY(-4px) scale(1.05);
    color: #ffffff;
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.4);
}

.drop-zone-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.drop-zone-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.drop-zone-btn {
    pointer-events: auto;
    margin: 0.5rem 0;
}

.supported-formats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.format-tag {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.format-tag.highlight {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

/* File Input hidden */
.hidden-file-input {
    display: none;
}

/* Selected File Card */
.selected-file-preview {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.25rem;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

.selected-file-info {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    overflow: hidden;
}

.selected-file-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.selected-file-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.selected-file-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 450px;
}

.selected-file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.btn-remove-file {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.4rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-remove-file:hover {
    color: var(--accent-rose);
    background: rgba(244, 63, 94, 0.15);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--gradient-primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 22px rgba(99, 102, 241, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-accent {
    background: var(--gradient-accent);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-accent:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--gradient-success);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
    margin-top: 1rem;
    padding: 0.9rem;
    font-size: 1rem;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Waveform Section
   ========================================================================== */
.waveform-wrapper {
    background: var(--bg-inner);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

#waveform {
    width: 100%;
    min-height: 110px;
}

.waveform-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

.playback-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-play-pause {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
}

.btn-play-pause:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.time-display {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.preset-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.preset-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.preset-select {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.55rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
}

.preset-select:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.preset-select option {
    background: #182030;
    color: var(--text-primary);
}

/* ==========================================================================
   Settings / Audio Rack Section
   ========================================================================== */
.sliders-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.slider-card {
    background: var(--bg-inner);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    transition: var(--transition);
}

.slider-card:focus-within {
    border-color: rgba(99, 102, 241, 0.4);
}

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

.slider-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.value-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.18rem 0.5rem;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

/* Range input styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-indigo);
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #818cf8;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-indigo);
    border: 2px solid #ffffff;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    cursor: pointer;
}

/* Reverb Row */
.reverb-card {
    background: var(--bg-inner);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.3rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.reverb-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reverb-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.reverb-select {
    min-width: 240px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}

.reverb-select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}

.reverb-select option {
    background: #182030;
    color: var(--text-primary);
}

/* Toggles Section */
.toggles-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-inner);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.2rem;
}

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

.toggle-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.toggle-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-slider {
    background: var(--accent-emerald);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

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

/* Processing Actions */
.actions-row {
    display: flex;
    gap: 1rem;
}

.actions-row .btn {
    flex: 1;
    padding: 0.85rem 1rem;
}

/* ==========================================================================
   Preview & A/B Comparison Section
   ========================================================================== */
.preview-section {
    border-color: rgba(139, 92, 246, 0.35);
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, rgba(18, 24, 38, 0.85) 100%);
    animation: fadeIn 0.4s ease;
}

.preview-help {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.ab-comparison-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.btn-ab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-ab:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.ab-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.btn-ab.active {
    background: var(--gradient-ab-active);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 18px rgba(139, 92, 246, 0.4);
}

.btn-ab.active .ab-badge {
    background: #ffffff;
    color: var(--accent-indigo);
}

.active-effects-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.effect-chip {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

/* ==========================================================================
   Output Section
   ========================================================================== */
.output-card {
    border-color: rgba(16, 185, 129, 0.35);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(18, 24, 38, 0.85) 100%);
    animation: fadeIn 0.4s ease;
}

.audio-player-wrapper {
    margin: 1.25rem 0;
}

audio {
    width: 100%;
    border-radius: var(--radius-md);
    outline: none;
}

.download-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

.toast-error {
    background: #dc2626;
}

.toast-success {
    background: #059669;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 680px) {
    body {
        padding: 1.5rem 1rem;
    }
    .app-title {
        font-size: 2.2rem;
    }
    .sliders-grid, .toggles-row {
        grid-template-columns: 1fr;
    }
    .actions-row, .ab-comparison-controls {
        flex-direction: column;
    }
    .waveform-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .playback-group {
        justify-content: space-between;
    }
    .preset-group {
        justify-content: space-between;
    }
    .reverb-card {
        flex-direction: column;
        align-items: stretch;
    }
    .reverb-select {
        width: 100%;
    }
}
