:root {
    --bg-dark: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --border-glow: rgba(56, 189, 248, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    
    --neon-blue: #38bdf8;
    --neon-pink: #f472b6;
    --neon-green: #4ade80;
    --neon-yellow: #facc15;
    --neon-red: #ef4444;
    
    --drum-base: rgba(51, 65, 85, 0.8);
    --drum-border: rgba(148, 163, 184, 0.4);
    
    --cymbal-base: rgba(234, 179, 8, 0.7);
    --cymbal-border: rgba(250, 204, 21, 0.9);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
.app-header {
    padding: 20px 40px;
    background: linear-gradient(180deg, rgba(15,23,42,0.9) 0%, rgba(15,23,42,0) 100%);
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

h1 {
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
}

h1 span {
    color: var(--neon-blue);
    font-weight: 400;
}

.midi-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--panel-bg);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.midi-selector label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.midi-selector select {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    font-weight: 600;
}

.midi-selector select option {
    background: var(--bg-dark);
}

/* Main Content & SVG */
.main-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.drum-kit-container {
    width: 100%;
    max-width: 900px;
    height: 100%;
    max-height: 700px;
    padding: 20px;
}

svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5));
}

.drum-part {
    cursor: pointer;
    transition: transform 0.1s ease-out;
}

.drum-shape {
    fill: var(--drum-base);
    stroke: var(--drum-border);
    stroke-width: 2;
    transition: all 0.05s ease-out;
}

.drum-rim {
    fill: transparent;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 4;
}

.drum-center {
    fill: rgba(0,0,0,0.4);
}

.drum-label {
    fill: rgba(255,255,255,0.6);
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cymbal {
    fill: var(--cymbal-base);
    stroke: var(--cymbal-border);
}

/* Drum Hit Animations */
.drum-part.active .drum-shape {
    fill: rgba(255, 255, 255, 0.9);
    filter: url(#glow);
}

.drum-part.active.cymbal {
    fill: #fffbeb;
}

/* Specific glows */
.drum-part.active#drum-kick .drum-shape { fill: var(--neon-blue); stroke: #fff; }
.drum-part.active#drum-snare .drum-shape { fill: var(--neon-pink); stroke: #fff; }
.drum-part.active#drum-hihat .drum-shape { fill: var(--neon-yellow); stroke: #fff; }
.drum-part.active#drum-tom1 .drum-shape,
.drum-part.active#drum-tom2 .drum-shape { fill: var(--neon-green); stroke: #fff; }
.drum-part.active#drum-floortom .drum-shape { fill: var(--neon-green); stroke: #fff; }
.drum-part.active#drum-crash .drum-shape,
.drum-part.active#drum-ride .drum-shape { fill: var(--neon-yellow); stroke: #fff; }


/* Controls Panel */
.controls-panel {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-bg);
    border-radius: 50px;
    padding: 15px 30px;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.controls-content {
    display: flex;
    align-items: center;
    gap: 30px;
}

.control-btn {
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-mode {
    background: rgba(239, 68, 68, 0.1);
    color: var(--neon-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.record-mode:hover {
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.record-icon {
    width: 12px;
    height: 12px;
    background: var(--neon-red);
    border-radius: 50%;
    display: inline-block;
}

.record-mode.recording {
    background: var(--neon-red);
    color: white;
    animation: pulse 1.5s infinite;
}

.record-mode.recording .record-icon {
    background: white;
    border-radius: 2px; /* turn into square to mean stop */
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.status-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#recording-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#recording-time {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.secondary {
    background: rgba(255,255,255,0.1);
    color: white;
}

.secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.2);
}

.secondary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Start Overlay */
.overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.overlay-content {
    background: var(--panel-bg);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    max-width: 400px;
}

.overlay-content h2 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.overlay-content p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.5;
}

.primary-btn {
    background: var(--neon-blue);
    color: #0f172a;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.3);
}
