/* Particle Dance - Styles */
/* Brand: Deep purple-black, spectrum particles, Space Grotesk */

:root {
    --bg-primary: #0D0221;
    --bg-secondary: #0A1628;
    --accent-cyan: #00D9FF;
    --accent-magenta: #FF00FF;
    --accent-gold: #FFD700;
    --text-primary: rgba(255, 255, 255, 0.9);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.3);
    --ui-bg: rgba(13, 2, 33, 0.8);
    --ui-border: rgba(255, 255, 255, 0.1);
    --glow-cyan: 0 0 20px rgba(0, 217, 255, 0.5);
    --glow-magenta: 0 0 20px rgba(255, 0, 255, 0.5);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: crosshair;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Canvas */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* UI Overlay */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

#ui-overlay > * {
    pointer-events: auto;
}

/* Mode Indicator */
#mode-indicator {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 24px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#mode-indicator.visible {
    opacity: 1;
}

#mode-text {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Controls */
#controls {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 32px;
    backdrop-filter: blur(10px);
}

.mode-btn, .control-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid var(--ui-border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn svg, .control-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.mode-btn:hover, .control-btn:hover {
    border-color: var(--accent-cyan);
    transform: scale(1.05);
}

.mode-btn:hover svg, .control-btn:hover svg {
    color: var(--accent-cyan);
}

.mode-btn.active {
    border-color: var(--accent-cyan);
    background: rgba(0, 217, 255, 0.1);
    box-shadow: var(--glow-cyan);
}

.mode-btn.active svg {
    color: var(--accent-cyan);
}

.divider {
    width: 1px;
    height: 32px;
    background: var(--ui-border);
    margin: 0 8px;
}

/* Record Button */
.record-btn {
    border-color: #ff4444 !important;
}

.record-btn svg {
    color: #ff4444 !important;
}

.record-btn:hover {
    background: rgba(255, 68, 68, 0.1);
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.record-btn.recording {
    animation: pulse-red 1s infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 68, 68, 0.5); }
    50% { box-shadow: 0 0 30px rgba(255, 68, 68, 0.8); }
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Recording Indicator */
#recording-indicator {
    position: fixed;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 68, 68, 0.2);
    border: 1px solid #ff4444;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    color: #ff4444;
    animation: pulse-red 1s infinite;
}

.rec-dot {
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Help Text */
#help-text {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: var(--text-muted);
    opacity: 1;
    transition: opacity 0.5s ease;
}

#help-text.fade-out {
    opacity: 0;
}

kbd {
    display: inline-block;
    padding: 2px 8px;
    margin: 0 2px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--ui-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
}

/* Help Modal */
#help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(5px);
    cursor: auto;
}

#help-modal * {
    cursor: auto;
}

#help-modal button {
    cursor: pointer;
}

.modal-content {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    text-align: center;
    backdrop-filter: blur(20px);
}

.modal-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.help-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.help-item kbd {
    padding: 8px 16px;
    font-size: 14px;
}

.help-item span {
    font-size: 13px;
    color: var(--text-secondary);
}

.help-tip {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

#close-help {
    padding: 12px 32px;
    background: #06FFA5;
    border: none;
    border-radius: 24px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #0D0221;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#close-help:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(6, 255, 165, 0.5);
}

/* Mobile/Desktop specific */
.desktop-only {
    display: inline;
}

.mobile-only {
    display: none;
}

/* Mobile styles */
@media (max-width: 768px) {
    body {
        cursor: auto;
    }

    #controls {
        bottom: 16px;
        padding: 8px 12px;
        gap: 4px;
    }

    .mode-btn, .control-btn {
        width: 40px;
        height: 40px;
    }

    .mode-btn svg, .control-btn svg {
        width: 18px;
        height: 18px;
    }

    .divider {
        height: 24px;
        margin: 0 4px;
    }

    #help-text {
        bottom: 80px;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: inline;
    }

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

/* Cursor glow effect */
#cursor-glow {
    position: fixed;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0, 217, 255, 0.3) 0%, transparent 70%);
    z-index: 50;
    transition: width 0.2s, height 0.2s;
}

/* Loading state */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: var(--text-secondary);
}

/* Fullscreen adjustments */
:fullscreen #controls,
:-webkit-full-screen #controls {
    bottom: 32px;
}

/* Camera Prompt Modal */
#camera-prompt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    backdrop-filter: blur(10px);
    cursor: auto;
}

#camera-prompt * {
    cursor: auto;
}

#camera-prompt button {
    cursor: pointer;
}

.prompt-content {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 24px;
    padding: 48px;
    max-width: 450px;
    text-align: center;
    backdrop-filter: blur(20px);
}

.prompt-icon {
    font-size: 64px;
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
}

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

.prompt-content h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #FFFFFF;
}

.prompt-content p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.prompt-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.primary-btn {
    padding: 16px 32px;
    background: #06FFA5;
    border: none;
    border-radius: 32px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #0D0221;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(6, 255, 165, 0.5);
}

.secondary-btn {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--accent-cyan);
    border-radius: 32px;
    font-family: inherit;
    font-size: 14px;
    color: var(--accent-cyan);
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.privacy-note {
    font-size: 12px !important;
    color: var(--text-muted) !important;
    margin-bottom: 0 !important;
}

/* Hand Tracking Status */
#hand-status {
    position: fixed;
    top: 24px;
    left: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    z-index: 100;
}

#hand-status.tracking {
    border-color: rgba(0, 255, 100, 0.5);
    color: #00ff64;
}

#hand-status.lost {
    border-color: rgba(255, 200, 100, 0.5);
    color: #ffcc66;
}

#hand-icon {
    font-size: 16px;
}

/* Hand Toggle Button Active State */
#btn-hands.active {
    border-color: var(--accent-magenta);
    background: rgba(255, 0, 255, 0.1);
    box-shadow: var(--glow-magenta);
}

#btn-hands.active svg {
    color: var(--accent-magenta);
}

/* Gesture Indicator */
#gesture-indicator {
    position: fixed;
    top: 70px;
    left: 24px;
    padding: 6px 12px;
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-cyan);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
}

#gesture-indicator.visible {
    opacity: 1;
}

/* Hand visual feedback on canvas - pulsing glow */
.hand-glow {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 50;
}

/* Tutorial Overlay */
#tutorial {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 250;
    cursor: auto;
}

.tutorial-content {
    position: relative;
    text-align: center;
    max-width: 400px;
    padding: 20px;
}

.tutorial-step {
    background: var(--ui-bg);
    border: 1px solid var(--ui-border);
    border-radius: 24px;
    padding: 40px;
    backdrop-filter: blur(20px);
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tutorial-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 2s ease infinite;
}

.tutorial-icon-static {
    font-size: 64px;
    margin-bottom: 20px;
}

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

.tutorial-step h3 {
    font-size: 24px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 12px;
}

.tutorial-step p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.tutorial-hint {
    font-size: 14px;
    color: var(--accent-cyan);
    margin-bottom: 20px;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.tutorial-demo {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(6, 255, 165, 0.1);
    border: 1px solid #06FFA5;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #06FFA5;
    animation: pulse 2s ease infinite;
}

.hint-btn {
    padding: 16px 32px;
    background: #06FFA5;
    border: none;
    border-radius: 32px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #0D0221;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hint-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(6, 255, 165, 0.5);
}

.tutorial-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: #06FFA5;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.skip-btn {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    padding: 10px 20px;
    transition: color 0.2s ease;
}

.skip-btn:hover {
    color: var(--text-secondary);
}

/* Tutorial step indicators */
.tutorial-steps-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.step-dot.active {
    background: #06FFA5;
    transform: scale(1.2);
}

.step-dot.completed {
    background: var(--accent-cyan);
}
