/* JomiMusic - Komplett neues CSS für alle Geräte */

/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Basis-Variablen */
:root {
    /* Farben */
    --bg-dark: #0a0e1a;
    --bg-medium: #050812;
    --bg-light: #030610;
    --text-white: #ffffff;
    --text-light: rgba(255, 255, 255, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Pad-Farben */
    --pad-1: rgba(255, 100, 150, 0.7);
    --pad-2: rgba(100, 200, 255, 0.7);
    --pad-3: rgba(255, 200, 100, 0.7);
    --pad-4: rgba(150, 255, 100, 0.7);
    --pad-5: rgba(200, 100, 255, 0.7);
    
    --pad-1-active: rgba(255, 100, 150, 0.9);
    --pad-2-active: rgba(100, 200, 255, 0.9);
    --pad-3-active: rgba(255, 200, 100, 0.9);
    --pad-4-active: rgba(150, 255, 100, 0.9);
    --pad-5-active: rgba(200, 100, 255, 0.9);
    
    /* Schatten */
    --shadow-light: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-heavy: 0 12px 48px rgba(0, 0, 0, 0.3);
    
    /* Übergänge */
    --transition: 0.3s ease-out;
}

/* Basis-Layout */
html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    background-image: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-medium) 50%, var(--bg-light) 100%);
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    
    /* Touch-Optimierungen */
    -webkit-text-size-adjust: 100%;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Animierte Hintergrund-Bubbles */
body::before,
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.6;
}

body::before {
    background: 
        radial-gradient(circle at 20% 80%, rgba(60, 60, 120, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(120, 60, 120, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(60, 120, 180, 0.3) 0%, transparent 50%);
    animation: bubbleFloat 20s ease-in-out infinite;
}

body::after {
    background: 
        radial-gradient(circle at 70% 70%, rgba(120, 100, 50, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 30% 30%, rgba(50, 120, 100, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(100, 50, 120, 0.2) 0%, transparent 40%);
    animation: bubbleFloat 25s ease-in-out infinite reverse;
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); opacity: 0.6; }
    33% { transform: translateY(-20px) rotate(1deg); opacity: 0.7; }
    66% { transform: translateY(10px) rotate(-1deg); opacity: 0.5; }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* Header */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 20px 0;
    text-align: center;
    position: relative;
    z-index: 10;
}

/* Logo */
.logo {
    font-size: clamp(3rem, 8vw, 9rem);
    font-weight: 700;
    text-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(15px, 3vw, 25px);
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.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-icon {
    font-size: clamp(3rem, 6vw, 5.5rem);
    animation: logoFloat 3s ease-in-out infinite;
}

.logo-note {
    font-size: clamp(2rem, 4vw, 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: clamp(0.9rem, 2vw, 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: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-white);
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all var(--transition);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.bpm-control, .volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--glass-bg);
    padding: 12px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

input[type="range"] {
    width: 100px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

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: min(800px, 90vw);
    margin: 0 auto 40px;
    aspect-ratio: 1;
}

.music-pad {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    border: 2px solid var(--glass-border);
    backdrop-filter: blur(10px);
    
    /* Touch-Optimierungen */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Pad-Farben */
.music-pad.color-1 { background: var(--pad-1); }
.music-pad.color-2 { background: var(--pad-2); }
.music-pad.color-3 { background: var(--pad-3); }
.music-pad.color-4 { background: var(--pad-4); }
.music-pad.color-5 { background: var(--pad-5); }

.music-pad.color-1.active { background: var(--pad-1-active); }
.music-pad.color-2.active { background: var(--pad-2-active); }
.music-pad.color-3.active { background: var(--pad-3-active); }
.music-pad.color-4.active { background: var(--pad-4-active); }
.music-pad.color-5.active { background: var(--pad-5-active); }

.music-pad:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
    border-color: rgba(255, 255, 255, 0.4);
}

.music-pad.active {
    transform: scale(1.1);
    box-shadow: var(--shadow-heavy);
    border-color: rgba(255, 255, 255, 0.6);
    animation: pulse 0.6s ease-in-out;
}

@keyframes pulse {
    0% { transform: scale(1.1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1.1); }
}

.music-pad.theremin-active {
    transform: scale(1.15);
    box-shadow: var(--shadow-heavy);
    border-color: rgba(255, 255, 255, 0.8);
    filter: brightness(1.2);
}

/* 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 */
.drum-machine-section {
    margin: 40px auto;
    max-width: min(800px, 95vw);
}

.drum-machine-section h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.drum-machine {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: clamp(10px, 3vw, 20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-light);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.drum-beat-labels {
    display: grid;
    grid-template-columns: clamp(60px, 15vw, 120px) repeat(8, 1fr);
    gap: clamp(2px, 1vw, 8px);
    margin-bottom: 10px;
}

.beat-label {
    text-align: center;
    font-size: clamp(0.6rem, 1.5vw, 0.8rem);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.drum-grid {
    display: grid;
    grid-template-columns: clamp(60px, 15vw, 120px) repeat(8, 1fr);
    gap: clamp(2px, 1vw, 8px);
    margin-bottom: 15px;
}

.drum-instrument {
    display: flex;
    align-items: center;
    font-size: clamp(0.6rem, 1.5vw, 0.9rem);
    font-weight: 500;
    color: var(--text-light);
    padding: 5px;
}

.drum-step {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
    border: 2px solid var(--glass-border);
    background: var(--glass-bg);
    position: relative;
    min-height: 24px;
}

.drum-step:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-light);
}

.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: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: clamp(20px, 5vw, 30px);
    max-width: min(800px, 95vw);
    margin: 0 auto;
    border: 1px solid var(--glass-border);
    text-align: center;
}

.instructions h3 {
    margin-bottom: 20px;
    font-size: clamp(1.1rem, 2.5vw, 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;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.instructions li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
}

/* Footer */
.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    padding: 20px 0;
    text-align: center;
    margin-top: auto;
    position: relative;
    z-index: 10;
}

.footer p {
    opacity: 0.7;
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    margin-bottom: 5px;
}

.footer a {
    color: var(--text-light);
    text-decoration: none;
    transition: all var(--transition);
}

.footer a:hover {
    color: var(--text-white);
    text-decoration: underline;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .control-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .music-grid {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .music-grid {
        gap: 8px;
    }
    
    .drum-machine {
        padding: 8px;
    }
    
    .drum-grid, .drum-beat-labels {
        gap: 1px;
    }
    
    .control-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* 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); }
}
