/* CaptnReverse - Advanced OCR & TTS Stylesheet */

/* Enhanced Gaming UI Glassmorphism */
.glass {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 20px rgba(59, 130, 246, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    position: relative;
    overflow: hidden;
}

.glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.4), transparent);
    animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.glass-strong {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px) saturate(1.3) brightness(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.3) brightness(1.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 30px rgba(59, 130, 246, 0.1),
        inset 0 0 20px rgba(59, 130, 246, 0.02);
    position: relative;
}

.glass-gaming {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(30, 41, 59, 0.6) 50%, rgba(15, 23, 42, 0.8) 100%);
    backdrop-filter: blur(24px) saturate(1.4) hue-rotate(5deg);
    -webkit-backdrop-filter: blur(24px) saturate(1.4) hue-rotate(5deg);
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(59, 130, 246, 0.1),
        0 0 40px rgba(59, 130, 246, 0.08),
        inset 0 0 30px rgba(139, 92, 246, 0.03);
    position: relative;
    overflow: hidden;
}

.glass-gaming::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(45deg, transparent 30%, rgba(59, 130, 246, 0.05) 50%, transparent 70%);
    animation: gaming-pulse 4s ease-in-out infinite;
}

@keyframes gaming-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.glass-cyberpunk {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    backdrop-filter: blur(20px) saturate(1.5) contrast(1.1);
    -webkit-backdrop-filter: blur(20px) saturate(1.5) contrast(1.1);
    border: 1px solid;
    border-image: linear-gradient(45deg, rgba(6, 182, 212, 0.3), rgba(139, 92, 246, 0.3)) 1;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(6, 182, 212, 0.2),
        0 0 30px rgba(6, 182, 212, 0.1);
    position: relative;
}

/* Gaming-Inspired Primary Buttons */
.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    box-shadow:
        0 4px 15px rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(59, 130, 246, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow:
        0 4px 15px rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Gaming Glow Effects */
.gaming-glow {
    box-shadow:
        0 0 10px rgba(59, 130, 246, 0.3),
        0 0 20px rgba(59, 130, 246, 0.2),
        0 0 30px rgba(59, 130, 246, 0.1);
    transition: box-shadow 0.3s ease;
}

.gaming-glow:hover {
    box-shadow:
        0 0 15px rgba(59, 130, 246, 0.5),
        0 0 30px rgba(59, 130, 246, 0.3),
        0 0 45px rgba(59, 130, 246, 0.2);
}

/* Debug canvas positioning and styling */
.debug-canvas {
    position: fixed;
    top: 80px;
    right: 10px;
    border: 2px solid #0ea5e9;
    border-radius: 8px;
    z-index: 9999;
    background: white;
    image-rendering: pixelated;
}

/* Status indicator animations */
.status-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* Custom scrollbar for debug console */
.debug-console-content::-webkit-scrollbar {
    width: 8px;
}

.debug-console-content::-webkit-scrollbar-track {
    background: #1e293b;
}

.debug-console-content::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.debug-console-content::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Camera control styling */
.camera-controls {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 16px;
}

/* OCR processing overlay */
.processing-overlay {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

/* Settings modal styling */
.settings-modal {
    backdrop-filter: blur(16px);
    background: rgba(30, 41, 59, 0.95);
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .debug-canvas {
        width: 150px !important;
        height: auto !important;
        top: 60px;
        right: 5px;
    }
    
    .glass {
        backdrop-filter: blur(8px); /* Reduced for mobile performance */
    }
}

/* Accessibility improvements */
.btn-primary:focus,
button:focus {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* Loading spinner animation */
.loading-spinner {
    border: 4px solid #1e293b;
    border-top: 4px solid #0ea5e9;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Gaming UI Text Effects */
.text-gaming-glow {
    text-shadow:
        0 0 10px rgba(34, 211, 238, 0.6),
        0 0 20px rgba(59, 130, 246, 0.4),
        0 0 30px rgba(139, 92, 246, 0.3);
    animation: glow-pulse 3s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    0% {
        text-shadow:
            0 0 10px rgba(34, 211, 238, 0.6),
            0 0 20px rgba(59, 130, 246, 0.4),
            0 0 30px rgba(139, 92, 246, 0.3);
    }
    100% {
        text-shadow:
            0 0 15px rgba(34, 211, 238, 0.8),
            0 0 30px rgba(59, 130, 246, 0.6),
            0 0 45px rgba(139, 92, 246, 0.4);
    }
}

/* Floating Animation for Gaming Elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Gaming Panel Styling */
.gaming-panel {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow:
        0 0 20px rgba(59, 130, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.gaming-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    opacity: 0.7;
}

.gaming-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #8b5cf6, transparent);
    opacity: 0.5;
}

/* Enhanced Button Animations */
.btn-gaming {
    background: linear-gradient(45deg, #1f2937, #374151);
    border: 1px solid rgba(59, 130, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-gaming::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
    transition: left 0.6s;
}

.btn-gaming:hover {
    border-color: rgba(59, 130, 246, 0.6);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.btn-gaming:hover::before {
    left: 100%;
}

/* Status Indicators with Gaming Aesthetics */
.status-dot-gaming {
    position: relative;
    display: inline-block;
}

.status-dot-gaming::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(45deg, transparent, rgba(59, 130, 246, 0.3), transparent);
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Performance Optimizations for Gaming UI */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* Mobile Gaming UI Adaptations */
@media (max-width: 768px) {
    .gaming-glow {
        box-shadow:
            0 0 5px rgba(59, 130, 246, 0.3),
            0 0 10px rgba(59, 130, 246, 0.2);
    }

    .text-gaming-glow {
        text-shadow:
            0 0 5px rgba(34, 211, 238, 0.6),
            0 0 10px rgba(59, 130, 246, 0.4);
    }

    .animate-float {
        animation-duration: 4s; /* Faster on mobile */
    }
}

/* Accessibility - Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .animate-float,
    .text-gaming-glow,
    .status-dot-gaming::after,
    .btn-primary::before,
    .btn-gaming::before,
    .glass::before,
    .glass-gaming::after {
        animation: none;
    }

    .gaming-glow,
    .btn-primary,
    .btn-gaming {
        transition: none;
    }
}

/* Advanced Theme System */
:root {
    /* Default Theme Variables */
    --theme-primary: #3b82f6;
    --theme-secondary: #8b5cf6;
    --theme-accent: #06b6d4;
    --theme-bg-primary: rgba(15, 23, 42, 0.75);
    --theme-bg-secondary: rgba(30, 41, 59, 0.6);
    --theme-border: rgba(148, 163, 184, 0.12);
    --theme-glow: rgba(59, 130, 246, 0.05);
    --theme-text-glow: 0 0 10px rgba(34, 211, 238, 0.6);
}

/* Cyberpunk Theme */
[data-theme="cyberpunk"] {
    --theme-primary: #06b6d4;
    --theme-secondary: #8b5cf6;
    --theme-accent: #10b981;
    --theme-bg-primary: rgba(6, 78, 82, 0.8);
    --theme-bg-secondary: rgba(75, 0, 130, 0.6);
    --theme-border: rgba(6, 182, 212, 0.3);
    --theme-glow: rgba(6, 182, 212, 0.15);
    --theme-text-glow: 0 0 15px rgba(6, 182, 212, 0.8);
}

[data-theme="cyberpunk"] .glass {
    background: var(--theme-bg-primary);
    border-color: var(--theme-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(6, 182, 212, 0.2),
        0 0 20px var(--theme-glow),
        inset 0 0 0 1px rgba(6, 182, 212, 0.05);
}

[data-theme="cyberpunk"] .glass::before {
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.6), transparent);
}

/* Retro Gaming Theme */
[data-theme="retro"] {
    --theme-primary: #ff6b6b;
    --theme-secondary: #feca57;
    --theme-accent: #48dbfb;
    --theme-bg-primary: rgba(26, 26, 46, 0.85);
    --theme-bg-secondary: rgba(46, 26, 46, 0.7);
    --theme-border: rgba(255, 107, 107, 0.3);
    --theme-glow: rgba(255, 107, 107, 0.1);
    --theme-text-glow: 0 0 15px rgba(255, 107, 107, 0.8);
}

[data-theme="retro"] .glass {
    background: var(--theme-bg-primary);
    border-color: var(--theme-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 107, 107, 0.2),
        0 0 25px var(--theme-glow),
        inset 0 0 0 1px rgba(254, 202, 87, 0.05);
}

[data-theme="retro"] .glass::before {
    background: linear-gradient(90deg, transparent, rgba(255, 107, 107, 0.6), rgba(254, 202, 87, 0.4), transparent);
}

/* High Contrast Theme */
[data-theme="high-contrast"] {
    --theme-primary: #ffffff;
    --theme-secondary: #ffff00;
    --theme-accent: #00ffff;
    --theme-bg-primary: rgba(0, 0, 0, 0.95);
    --theme-bg-secondary: rgba(20, 20, 20, 0.9);
    --theme-border: rgba(255, 255, 255, 0.8);
    --theme-glow: rgba(255, 255, 255, 0.2);
    --theme-text-glow: 0 0 5px rgba(255, 255, 255, 1);
}

[data-theme="high-contrast"] .glass {
    background: var(--theme-bg-primary);
    border: 2px solid var(--theme-border);
    box-shadow:
        0 4px 16px rgba(255, 255, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    backdrop-filter: none; /* Remove blur for accessibility */
}

[data-theme="high-contrast"] .glass::before {
    display: none; /* Remove animations for accessibility */
}

/* Gaming Aesthetic Enhancements */
.theme-transition {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-enhanced {
    background: var(--theme-bg-primary);
    border-color: var(--theme-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 var(--theme-primary, #3b82f6),
        0 0 20px var(--theme-glow);
}

.btn-themed {
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
    box-shadow: 0 4px 15px var(--theme-glow);
}

.text-themed-glow {
    text-shadow: var(--theme-text-glow);
}

/* Advanced Hover Effects */
.glass:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 30px var(--theme-glow, rgba(59, 130, 246, 0.1));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-gaming:hover {
    box-shadow:
        0 20px 56px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 0 50px var(--theme-glow, rgba(59, 130, 246, 0.15));
}