/* CSS Variables */
:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --accent-primary: #e94560;
    --accent-secondary: #0f3460;
    --accent-green: #00d9a0;
    --accent-yellow: #ffd700;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --border-color: #2a2a4a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 30px 0;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-yellow));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: none;
}

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

/* Main Content */
main {
    flex: 1;
}

/* Sections */
.section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.section h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Sound Type Buttons */
.sound-types {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.sound-type-btn {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sound-type-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(233, 69, 96, 0.1);
}

.sound-type-btn.active {
    border-color: var(--accent-primary);
    background: rgba(233, 69, 96, 0.2);
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.3);
}

/* Parameters */
.parameters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.param-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-group label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.param-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    appearance: none;
    cursor: pointer;
}

.param-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.param-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.param-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
}

.param-group select {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    cursor: pointer;
}

.param-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.param-value {
    color: var(--accent-yellow);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Visualizer */
.visualizer-container {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 10px;
    border: 1px solid var(--border-color);
}

#visualizer {
    width: 100%;
    height: 120px;
    display: block;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon {
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--text-primary);
}

.btn-primary:hover {
    background: #ff5a75;
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--accent-secondary);
    color: var(--text-primary);
    border: 2px solid var(--accent-primary);
}

.btn-secondary:hover {
    background: rgba(233, 69, 96, 0.2);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--accent-green);
    color: var(--bg-primary);
}

.btn-success:hover {
    background: #00f5b5;
    box-shadow: 0 0 20px rgba(0, 217, 160, 0.4);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Presets */
.presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.preset-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.preset-btn:hover {
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
    background: rgba(255, 215, 0, 0.1);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

footer a:hover {
    color: var(--accent-yellow);
    text-decoration: underline;
}

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

    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .section {
        padding: 18px;
    }

    .sound-types {
        grid-template-columns: repeat(2, 1fr);
    }

    .parameters {
        grid-template-columns: 1fr;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .presets {
        justify-content: center;
    }

    .preset-btn {
        flex: 1 1 calc(50% - 10px);
        text-align: center;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }

    .sound-types {
        grid-template-columns: 1fr 1fr;
    }

    .sound-type-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    #visualizer {
        height: 80px;
    }
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.btn-primary:active {
    animation: pulse 0.3s ease;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}
