/* style.css - Stylesheet for Convolution Reverb App */

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

:root {
    --primary-color: #00b4d8;
    --secondary-color: #90e0ef;
    --background-dark: #0f0f1a;
    --background-light: #1a1a2e;
    --surface-color: rgba(255, 255, 255, 0.05);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #e0e0e0;
    --text-secondary: #cae9ff;
    --success-color: #4ade80;
    --error-color: #f87171;
    --warning-color: #fbbf24;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--background-dark) 0%, var(--background-light) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    width: 100%;
    background: var(--surface-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.6s ease-out;
}

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

h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.status {
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    background: var(--surface-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.status.loading {
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    background: rgba(144, 224, 239, 0.1);
}

.status.ready {
    color: var(--success-color);
    border: 1px solid var(--success-color);
    background: rgba(74, 222, 128, 0.1);
}

.status.error {
    color: var(--error-color);
    border: 1px solid var(--error-color);
    background: rgba(248, 113, 113, 0.1);
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.control-group {
    background: var(--surface-color);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.control-group:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.control-group h3 {
    margin-bottom: 15px;
    color: var(--secondary-color);
    font-size: 1.2em;
    font-weight: 600;
}

.control {
    margin-bottom: 15px;
}

.control:last-child {
    margin-bottom: 0;
}

.control label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 500;
}

.control input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(144, 224, 239, 0.5);
}

.control input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(144, 224, 239, 0.5);
}

.control select {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--secondary-color);
}

.control select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.2);
}

.control .value {
    display: inline-block;
    margin-left: 10px;
    font-size: 0.85em;
    color: var(--secondary-color);
    font-weight: 600;
    min-width: 35px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.button {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.button:active::before {
    width: 300px;
    height: 300px;
}

.button.primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: var(--background-dark);
}

.button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 180, 216, 0.3);
}

.button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.button.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--secondary-color);
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.visualizer {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.visualizer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(144, 224, 239, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.visualizer canvas {
    width: 100%;
    height: 200px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.info {
    margin-top: 30px;
    padding: 20px;
    background: var(--surface-color);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.info h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.info p {
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.info p:last-child {
    margin-bottom: 0;
}

/* Loading animation */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.loading-indicator {
    animation: pulse 1.5s infinite;
}

/* File input styling */
input[type="file"] {
    display: none;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 20px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .button {
        width: 100%;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(144, 224, 239, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(144, 224, 239, 0.5);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(144, 224, 239, 0.3) rgba(255, 255, 255, 0.05);
}

/* Live input indicator */
.live-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f87171;
    margin-left: 10px;
    animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
    0% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(248, 113, 113, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(248, 113, 113, 0);
    }
}

.button.primary.active {
    background: linear-gradient(45deg, #f87171, #fbbf24);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(248, 113, 113, 0.8), 0 0 30px rgba(248, 113, 113, 0.6);
    }
}

/* Additional animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.control {
    animation: slideIn 0.4s ease-out backwards;
}

.control:nth-child(1) { animation-delay: 0.1s; }
.control:nth-child(2) { animation-delay: 0.2s; }
.control:nth-child(3) { animation-delay: 0.3s; }

/* Tooltip styling */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: rgba(0, 0, 0, 0.9);
    color: var(--text-primary);
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85em;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Focus styles for accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .button,
    .visualizer,
    .status {
        display: none;
    }
}

.preloaded-audio {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-top: 20px;
}

.preloaded-audio label {
    color: #cad3f5;
    font-weight: 500;
}

.preloaded-audio select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cad3f5;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preloaded-audio select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.preloaded-audio select:focus {
    outline: none;
    border-color: #90e0ef;
    box-shadow: 0 0 0 2px rgba(144, 224, 239, 0.2);
}

.preloaded-audio select option {
    background: #1e1e2e;
    color: #cad3f5;
}

.subtitle {
    text-align: center;
    color: #90e0ef;
    font-size: 1.2em;
    margin-bottom: 20px;
}