* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    background: linear-gradient(135deg, #0a0a12 0%, #0f0f1a 50%, #0a0a12 100%);
    min-height: 100vh;
}

.font-display {
    font-family: 'Space Grotesk', sans-serif;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.header-gradient {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
}

.glass-card {
    background: rgba(30, 30, 50, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.recording-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    margin-left: 12px;
    animation: pulse-recording 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

@keyframes pulse-recording {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.9); }
}

.mode-btn {
    background: rgba(51, 51, 77, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    cursor: pointer;
}

.mode-btn:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.mode-btn.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.mode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-switch {
    width: 52px;
    height: 28px;
    background: #374151;
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
    border: none;
    padding: 0;
}

.toggle-switch.active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.toggle-switch.active .toggle-knob {
    transform: translateX(24px);
}

.toggle-switch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.audio-meter {
    height: 6px;
    background: rgba(51, 51, 77, 0.6);
    border-radius: 3px;
    overflow: hidden;
}

.audio-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #eab308 70%, #ef4444 100%);
    transition: width 0.1s ease;
    border-radius: 3px;
}

.preview-container {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.preview-container.recording-active {
    border-color: #ef4444;
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
    animation: border-pulse 2s ease-in-out infinite;
}

@keyframes border-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.2); }
    50% { box-shadow: 0 0 40px rgba(239, 68, 68, 0.4); }
}

.preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-character {
    text-align: center;
    animation: float 3s ease-in-out infinite;
}

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

.control-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 15, 26, 0.9);
    backdrop-filter: blur(12px);
    padding: 12px 24px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.control-btn:hover {
    transform: scale(1.1);
}

.pause-btn {
    background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
    color: white;
}

.resume-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.stop-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.cancel-btn {
    background: rgba(100, 100, 120, 0.5);
    color: #94a3b8;
}

.timer-display {
    font-size: 24px;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.paused-badge {
    font-size: 10px;
    background: #eab308;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.record-button {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 20px 48px;
    border-radius: 50px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4);
}

.record-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(239, 68, 68, 0.5);
}

.record-icon {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    animation: pulse-record 1.5s ease-in-out infinite;
}

@keyframes pulse-record {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.download-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(34, 197, 94, 0.4);
}

.secondary-btn {
    background: rgba(100, 100, 120, 0.3);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: rgba(100, 100, 120, 0.5);
    color: white;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

video::-webkit-media-controls {
    background: rgba(0, 0, 0, 0.5);
}

select option {
    background: #1e1e32;
    color: white;
}