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

:root {
    --primary: #2d2d2d;
    --primary-light: #3d3d3d;
    --text: #1a1a1a;
    --text-light: #666;
    --bg: #fafafa;
    --white: #ffffff;
    --border: #e5e5e5;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.12);
}

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

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--text);
}

/* App Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}

.app-header {
    margin-bottom: 40px;
    text-align: center;
}

.header-content h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.header-content p {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    margin-bottom: 40px;
}

/* Video Section */
.video-section {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow);
}

.video-container {
    position: relative;
    background: #0f0f1e;
    border-radius: 12px;
    overflow: visible;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

#videoCanvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

#videoInput {
    display: none;
}

.loading-message {
    position: absolute;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    z-index: 1;
}

.video-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.status-indicator {
    color: var(--text-light);
    font-size: 0.95rem;
    padding: 12px 20px;
    background: var(--bg);
    border-radius: 8px;
    flex: 1;
    text-align: center;
}

/* Controls Panel */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.control-card {
    background: var(--white);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px var(--shadow);
}

.control-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.card-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* Color Picker */
.color-picker-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.preset-colors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.color-preset {
    aspect-ratio: 1;
    border: 3px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.color-preset:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.color-preset.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 45, 45, 0.1);
}

.custom-color-input {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.custom-color-input label {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
}

.custom-color-input input[type="color"] {
    width: 100%;
    height: 50px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.custom-color-input input[type="color"]:hover {
    border-color: var(--primary);
}

.current-color-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg);
    border-radius: 12px;
    font-size: 0.95rem;
}

.color-display {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.current-color-indicator span:first-child {
    color: var(--text-light);
}

#currentColorName {
    font-weight: 600;
    color: var(--text);
    text-transform: capitalize;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-lg);
}

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

.btn-secondary:hover {
    background: var(--white);
    border-color: var(--primary);
}

.btn.small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Instructions List */
.instructions-list {
    list-style: none;
    padding: 0;
}

.instructions-list li {
    padding: 12px 0;
    padding-left: 28px;
    position: relative;
    color: var(--text-light);
    line-height: 1.6;
    border-bottom: 1px solid var(--border);
}

.instructions-list li:last-child {
    border-bottom: none;
}

.instructions-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
    font-size: 1.5rem;
}

/* Drum Zones Overlay */
.drum-zones-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    border-radius: 12px;
}

.zone {
    position: absolute;
    border: 3px solid;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0.3;
}

.zone.active {
    opacity: 0.8;
    transform: scale(1.05);
    box-shadow: 0 0 30px currentColor;
}

.zone.kick { border-color: #00ff00; background: rgba(0, 255, 0, 0.1); }
.zone.snare { border-color: #ff0000; background: rgba(255, 0, 0, 0.1); }
.zone.tom { border-color: #0000ff; background: rgba(0, 0, 255, 0.1); }
.zone.floor { border-color: #ffff00; background: rgba(255, 255, 0, 0.1); }
.zone.hat { border-color: #ff00ff; background: rgba(255, 0, 255, 0.1); }
.zone.ride { border-color: #00ffff; background: rgba(0, 255, 255, 0.1); }

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .controls-panel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 20px 16px;
    }
    
    .controls-panel {
        grid-template-columns: 1fr;
    }
    
    .preset-colors {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .video-controls {
        flex-direction: column;
    }
    
    .status-indicator {
        width: 100%;
    }
}
