/* Browserbasierte Musikmaschine - CSS */

/* CSS Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Farbpalette für die Pads */
    --color-1: rgba(255, 100, 150, 0.7);
    --color-2: rgba(100, 200, 255, 0.7);
    --color-3: rgba(255, 200, 100, 0.7);
    --color-4: rgba(150, 255, 100, 0.7);
    --color-5: rgba(200, 100, 255, 0.7);
    
    /* Aktive Zustände */
    --color-1-active: rgba(255, 100, 150, 0.9);
    --color-2-active: rgba(100, 200, 255, 0.9);
    --color-3-active: rgba(255, 200, 100, 0.9);
    --color-4-active: rgba(150, 255, 100, 0.9);
    --color-5-active: rgba(200, 100, 255, 0.9);
    
    /* Schatten */
    --shadow-normal: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-active: 0 12px 48px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 16px 64px rgba(0, 0, 0, 0.15);
    
    /* Animationen */
    --transition-fast: 0.2s ease-out;
    --transition-medium: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Bubble Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
    animation: bubbleFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes bubbleFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.7;
    }
    33% {
        transform: translateY(-20px) rotate(1deg);
        opacity: 0.8;
    }
    66% {
        transform: translateY(10px) rotate(-1deg);
        opacity: 0.6;
    }
}

/* Additional floating bubbles */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 70% 70%, rgba(255, 200, 100, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 30% 30%, rgba(100, 255, 200, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(200, 100, 255, 0.1) 0%, transparent 40%);
    animation: bubbleFloat 25s ease-in-out infinite reverse;
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
    position: relative;
    z-index: 10;
}

.logo {
    font-size: 9.3rem;
    font-weight: 700;
    text-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.logo-icon {
    font-size: 5.5rem;
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-text {
    font-family: 'Bitcount Grid Single', monospace;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease-in-out infinite;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.logo-note {
    font-size: 4rem;
    color: #ff6b6b;
    animation: noteBounce 2s ease-in-out infinite;
    text-shadow: 0 4px 8px rgba(255, 107, 107, 0.4);
}


@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes noteBounce {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    25% { 
        transform: translateY(-15px) rotate(-5deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(0deg); 
    }
    75% { 
        transform: translateY(-10px) rotate(5deg); 
    }
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.8;
    font-weight: 300;
}

/* Main Content */
.main {
    padding: 40px 0;
    flex: 1;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 0px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition-medium);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

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

.bpm-control, .volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.bpm-control .icon, .volume-control .icon {
    opacity: 0.8;
}

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

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

.bpm-control input[type="range"]::-webkit-slider-thumb, .volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

#bpmValue, #volumeValue {
    font-weight: 600;
    min-width: 30px;
}

/* Music Grid */
.music-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 15px;
    max-width: 800px;
    margin: 0 auto 40px;
    aspect-ratio: 1;
}

.music-pad {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-medium);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

/* Farbvarianten für die Pads */
.music-pad.color-1 { background: var(--color-1); }
.music-pad.color-2 { background: var(--color-2); }
.music-pad.color-3 { background: var(--color-3); }
.music-pad.color-4 { background: var(--color-4); }
.music-pad.color-5 { background: var(--color-5); }

/* Aktive Zustände */
.music-pad.color-1.active { background: var(--color-1-active); }
.music-pad.color-2.active { background: var(--color-2-active); }
.music-pad.color-3.active { background: var(--color-3-active); }
.music-pad.color-4.active { background: var(--color-4-active); }
.music-pad.color-5.active { background: var(--color-5-active); }

/* Hover-Effekte */
.music-pad:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Aktive Pads */
.music-pad.active {
    transform: scale(1.1);
    box-shadow: var(--shadow-active);
    border-color: rgba(255, 255, 255, 0.6);
    animation: pulse 0.6s ease-in-out;
}

/* Pulsierende Animation für aktive Pads */
@keyframes pulse {
    0% { transform: scale(1.1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1.1); }
}

/* Theremin-Effekt (beim Ziehen) */
.music-pad.theremin-active {
    transform: scale(1.15);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    animation: thereminGlow 0.3s ease-out;
}

@keyframes thereminGlow {
    0% { 
        transform: scale(1.15);
        filter: brightness(1);
    }
    50% { 
        transform: scale(1.2);
        filter: brightness(1.3);
    }
    100% { 
        transform: scale(1.15);
        filter: brightness(1.1);
    }
}

/* Glasmorphismus-Effekt für Pads */
.music-pad::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 50%;
    pointer-events: none;
}

/* Drum Machine Section */
.drum-machine-section {
    margin: 40px auto;
    max-width: 800px;
}

.drum-machine-section h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.drum-machine {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-normal);
}

.drum-grid {
    display: grid;
    grid-template-columns: 120px repeat(8, 1fr);
    gap: 8px;
    margin-bottom: 15px;
}

.drum-beat-labels {
    display: grid;
    grid-template-columns: 120px repeat(8, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.beat-label {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.drum-instrument {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    padding: 5px;
}

.drum-step {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    position: relative;
}

.drum-step:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.drum-step.active {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.3);
    animation: drumPulse 0.3s ease-out;
}

@keyframes drumPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.drum-step.playing {
    background: linear-gradient(135deg, #FF6B6B, #FF5252);
    animation: drumPlay 0.2s ease-out;
}

@keyframes drumPlay {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Instructions */
.instructions {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.instructions h3 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 500;
}

.instructions ul {
    list-style: none;
    padding: 0;
    display: inline-block;
    text-align: left;
}

.instructions li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.instructions li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.footer p {
    opacity: 0.7;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.footer a:hover {
    color: white;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 3rem;
        gap: 15px;
    }
    
    .logo-icon {
        font-size: 3.5rem;
    }
    
    .logo-note {
        font-size: 2.5rem;
    }
    
    .controls {
        gap: 15px;
        flex-direction: column;
    }
    
    .music-grid {
        gap: 10px;
        max-width: 95vw;
    }
    
    .drum-machine-section {
        margin: 30px auto;
        max-width: 95vw;
    }
    
    .drum-grid, .drum-beat-labels {
        grid-template-columns: 100px repeat(8, 1fr);
        gap: 6px;
    }
    
    .drum-instrument {
        font-size: 0.8rem;
    }
    
    .instructions {
        padding: 20px;
        margin: 0 15px;
        max-width: 95vw;
    }
}

@media (max-width: 480px) {
    .music-grid {
        gap: 8px;
    }
    
    .drum-grid, .drum-beat-labels {
        grid-template-columns: 80px repeat(8, 1fr);
        gap: 4px;
    }
    
    .drum-instrument {
        font-size: 0.7rem;
    }
    
    .beat-label {
        font-size: 0.7rem;
    }
    
    .control-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .bpm-control {
        padding: 8px 15px;
    }
}

/* Loading Animation */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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