:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-accent: #0f3460;
    --text-primary: #e94560;
    --text-secondary: #ffffff;
    --accent-color: #e94560;
    --border-color: #0f3460;
    --card-shadow: 0 0 15px rgba(233, 69, 96, 0.3);
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-text: #333;
    --input-border: #ccc;
    --input-focus: #e94560;
    
    --footer-text: #ffffff;
    --footer-logo-bg: #000000;
    --footer-logo-border: #4a4a4a;
}

/* Default Theme: Neon/Cyberpunk */
body.theme-neon {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --input-bg: rgba(22, 33, 62, 0.8);
    --input-text: #fff;
    --input-border: #0f3460;
    --input-focus: #e94560;
}

body.theme-neon .glass-effect {
    background: rgba(22, 33, 62, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

body.theme-neon h1, body.theme-neon h2 {
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
}

body.theme-neon .btn-primary {
    background: linear-gradient(45deg, #e94560, #c03546);
    color: white;
    border: none;
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.5);
}

/* Comic Book Theme */
body.theme-comic {
    --bg-primary: #f0f0f0;
    --bg-secondary: #ffffff;
    --text-primary: #000000;
    --accent-color: #ffcc00;
    
    background-color: #f0f0f0;
    background-image: radial-gradient(#d4d4d4 15%, transparent 16%), radial-gradient(#d4d4d4 15%, transparent 16%);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    color: #000;
    
    --input-bg: #fff;
    --input-text: #000;
    --input-border: #000;
    --input-focus: #ffcc00;
    
    --footer-text: #000000;
    --footer-logo-bg: #000000;
    --footer-logo-border: #000000;
}

body.theme-comic .glass-effect {
    background: #ffffff;
    border: 3px solid #000;
    box-shadow: 8px 8px 0px #000;
    border-radius: 0;
}

body.theme-comic h1 {
    font-family: 'Bangers', cursive;
    color: #ff0000;
    text-transform: uppercase;
    text-shadow: 3px 3px 0px #000;
    letter-spacing: 2px;
}

body.theme-comic .btn-primary {
    background: #ffcc00;
    color: #000;
    border: 3px solid #000;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 4px 4px 0px #000;
    transition: transform 0.1s;
}

body.theme-comic .btn-primary:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px #000;
}

/* Retro Synthwave/Arcade Theme */
body.theme-arcade {
    --bg-primary: #120024;
    --bg-secondary: #2b003b;
    --text-primary: #ff00de;
    --text-secondary: #00ffea;
    --accent-color: #ffe600;
    
    background: 
        linear-gradient(rgba(18, 0, 36, 0.9), rgba(18, 0, 36, 0.9)),
        repeating-linear-gradient(0deg, transparent, transparent 19px, #ff00de 20px),
        repeating-linear-gradient(90deg, transparent, transparent 19px, #00ffea 20px);
    background-size: 100% 100%, 40px 40px, 40px 40px;
    background-color: #120024;
    color: #fff;
    font-family: 'Courier New', Courier, monospace; /* Fallback */
    text-transform: uppercase;
    letter-spacing: 2px;
    
    --input-bg: rgba(0, 0, 0, 0.7);
    --input-text: #00ffea;
    --input-border: #ff00de;
    --input-focus: #ffe600;
    
    --footer-text: #ffe600;
    --footer-logo-bg: rgba(0, 0, 0, 0.9);
    --footer-logo-border: #ff00de;
}

body.theme-arcade .glass-effect {
    background: rgba(0, 0, 0, 0.8);
    border: 4px double #00ffea;
    box-shadow: 
        0 0 10px #00ffea,
        inset 0 0 20px rgba(255, 0, 222, 0.2);
    border-radius: 0;
    position: relative;
}

body.theme-arcade .glass-effect::after {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(45deg, #ff00de, #00ffea, #ffe600);
    z-index: -1;
    opacity: 0.3;
    animation: glowing-border 3s linear infinite;
}

body.theme-arcade h1 {
    color: #ffe600;
    text-shadow: 
        3px 3px 0 #ff00de,
        -1px -1px 0 #00ffea;
    font-weight: 900;
    font-style: italic;
    animation: pulse-text 1.5s ease-in-out infinite alternate;
}

body.theme-arcade .btn-primary {
    background: transparent;
    color: #ffe600;
    border: 2px solid #ffe600;
    box-shadow: 
        0 0 10px #ffe600,
        inset 0 0 10px #ffe600;
    text-shadow: 0 0 5px #ffe600;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

body.theme-arcade .btn-primary:hover {
    background: #ffe600;
    color: #000;
    box-shadow: 
        0 0 20px #ffe600,
        0 0 40px #ff00de;
}

body.theme-arcade select, body.theme-arcade textarea, body.theme-arcade input {
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 5px #00ffea;
}

@keyframes pulse-text {
    from { text-shadow: 3px 3px 0 #ff00de, -1px -1px 0 #00ffea; }
    to { text-shadow: 4px 4px 5px #ff00de, -2px -2px 5px #00ffea; }
}

@keyframes glowing-border {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* PxE Professional Theme */
body.theme-professional {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --accent-color: #0066cc;
    
    background: #f0f2f5;
    color: #333;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    --input-bg: #ffffff;
    --input-text: #333;
    --input-border: #e1e4e8;
    --input-focus: #0066cc;
    
    --footer-text: #333333;
    --footer-logo-bg: #000000;
    --footer-logo-border: #e1e4e8;
}

body.theme-professional .glass-effect {
    background: #ffffff;
    border: 1px solid #e1e4e8;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

body.theme-professional h1 {
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: -0.02em;
}

body.theme-professional .btn-primary {
    background: #0066cc;
    color: white;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
    transition: all 0.2s ease;
}

body.theme-professional .btn-primary:hover {
    background: #0052a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

/* Scoped specifically to Professional theme to avoid affecting others */
body.theme-professional select, 
body.theme-professional textarea, 
body.theme-professional input {
    border-radius: 8px !important;
    font-family: inherit;
    font-size: 0.95rem;
    background-color: var(--input-bg) !important;
    color: var(--input-text) !important;
    border: 1px solid var(--input-border) !important;
}

body.theme-professional .glass-effect i {
    color: #0066cc;
}



/* Common Components */
.camera-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
}

.camera-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

video#camera-feed {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 1rem;
    transform: scaleX(-1); /* Mirror effect */
}

.camera-controls {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    z-index: 10;
    pointer-events: none; /* Allow clicks to pass through container if needed, but buttons need pointer-events: auto */
}

.camera-controls button {
    pointer-events: auto;
}

@media (orientation: landscape) and (max-height: 500px) {
    .camera-container {
        padding: 0.5rem;
    }
    video#camera-feed {
        max-height: 85vh;
    }
    .camera-controls {
        bottom: 1rem;
    }
}

.shutter-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    border: 4px solid rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s;
}

.shutter-btn:active {
    transform: scale(0.9);
}

.loader {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

.print-mode {
    background: white !important;
    color: black !important;
}

@media print {
    .no-print {
        display: none !important;
    }
    .print-only {
        display: block !important;
    }
    body {
        background: white !important;
        color: black !important;
    }
}

/* Input Styling */
select, textarea, input[type="text"], input[type="email"], input[type="password"] {
    background-color: var(--input-bg) !important;
    color: var(--input-text) !important;
    border: 2px solid var(--input-border) !important;
    transition: all 0.3s ease;
}

select:focus, textarea:focus, input:focus {
    border-color: var(--input-focus) !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.2);
}

body.theme-comic select, body.theme-comic textarea, body.theme-comic input {
    border-width: 3px !important;
    font-weight: bold;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.1);
}

body.theme-comic select:focus, body.theme-comic textarea:focus, body.theme-comic input:focus {
    box-shadow: 4px 4px 0px rgba(0,0,0,1);
    transform: translate(-1px, -1px);
}

/* Consent Disclaimer Styling */
.consent-disclaimer {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.consent-text {
    color: rgba(255, 255, 255, 0.7);
}

.consent-strong {
    color: rgba(255, 255, 255, 0.9);
}

/* Comic Theme Consent Override */
body.theme-comic .consent-disclaimer {
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid #000;
    box-shadow: 4px 4px 0px #000;
}

body.theme-comic .consent-text {
    color: #000;
}

body.theme-comic .consent-strong {
    color: #ff0000;
}

/* Professional Theme Consent Override */
body.theme-professional .consent-disclaimer {
    background: #ffffff;
    border: 1px solid #e1e4e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.theme-professional .consent-text {
    color: #4a4a4a;
}

body.theme-professional .consent-strong {
    color: #1a1a1a;
}

/* Arcade Theme Consent Override */
body.theme-arcade .consent-disclaimer {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff00de;
    box-shadow: 0 0 20px rgba(255, 0, 222, 0.4);
}

body.theme-arcade .consent-text {
    color: #ffe600;
}

body.theme-arcade .consent-strong {
    color: #00ffff;
}
