/* Themes CSS - Dark theme and theme variations */

/* Dark Theme (Default) */
:root {
    /* Dark theme colors */
    --theme-bg-primary: #1c1c1e;
    --theme-bg-secondary: #2c2c2e;
    --theme-bg-tertiary: #3a3a3c;
    --theme-text-primary: #ffffff;
    --theme-text-secondary: #e5e5e7;
    --theme-text-muted: #8e8e93;
    --theme-border-primary: #48484a;
    --theme-border-secondary: #3a3a3c;
    
    /* Dark theme component colors */
    --theme-card-bg: #2c2c2e;
    --theme-card-border: #48484a;
    --theme-modal-bg: #2c2c2e;
    --theme-input-bg: #1c1c1e;
    --theme-input-border: #48484a;
    
    /* Dark theme shadows */
    --theme-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --theme-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --theme-shadow-lg: 0 8px 25px rgba(0, 122, 255, 0.15);
    --theme-shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* Apply dark theme variables */
body {
    background: var(--theme-bg-primary);
    color: var(--theme-text-secondary);
}

/* Dark theme component overrides */
.session-card {
    background: var(--theme-card-bg);
    border-color: var(--theme-card-border);
}

.image-card {
    background: var(--theme-bg-primary);
    border-color: var(--theme-card-border);
}

.modal-content {
    background: var(--theme-modal-bg);
}

.form-input, .modal-serial-input {
    background: var(--theme-input-bg);
    border-color: var(--theme-input-border);
    color: var(--theme-text-primary);
}

/* Dark theme status indicators */
.status-indicator.valid {
    background: var(--color-success);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.status-indicator.invalid {
    background: var(--color-danger);
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
}

.status-indicator.pending {
    background: var(--color-warning);
    box-shadow: 0 0 10px rgba(255, 149, 0, 0.5);
}

/* Dark theme serial number styling */
.serial-number .serial-value {
    color: #00d4ff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
}

.serial-number .serial-value:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--color-primary);
}

/* Dark theme verification buttons */
.verify-overlay-btn {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
}

.verify-overlay-btn:hover {
    background: rgba(0, 122, 255, 0.8);
    border-color: var(--color-primary);
}

.verify-overlay-btn.verified {
    background: var(--color-success);
    border-color: var(--color-success);
}

/* Dark theme modal styling */
.image-modal {
    background: rgba(0, 0, 0, 0.9);
}

.image-modal .modal-content {
    background: var(--theme-modal-bg);
}

.image-modal .close-btn {
    background: rgba(0, 0, 0, 0.7);
}

.image-modal .close-btn:hover {
    background: rgba(255, 59, 48, 0.8);
}

.nav-btn {
    background: rgba(0, 0, 0, 0.7);
}

.nav-btn:hover:not(:disabled) {
    background: var(--color-primary);
}

.nav-btn:disabled {
    background: var(--theme-bg-secondary);
    color: var(--theme-text-muted);
}

/* Dark theme serial display in modal */
.serial-container {
    background: var(--theme-bg-primary);
    border-color: var(--theme-card-border);
}

.serial-value {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    font-size: var(--font-2xl) !important;
}

.serial-value-display {
    background: var(--theme-bg-primary);
    border-color: var(--theme-card-border);
    color: var(--theme-text-primary);
    font-size: var(--font-2xl) !important;
}

.modal-serial-input {
    background: var(--theme-bg-primary);
    border-color: var(--theme-card-border);
    color: var(--theme-text-primary);
    font-size: var(--font-2xl) !important;
    text-align: center;
}

/* Dark theme upload zone */
.upload-zone {
    background: var(--theme-bg-secondary);
    border-color: var(--theme-card-border);
}

.upload-zone:hover {
    background: var(--theme-bg-secondary);
    border-color: var(--color-primary);
}

.upload-zone.dragover {
    background: var(--theme-bg-secondary);
    border-color: var(--color-primary);
}

/* Dark theme file preview */
.file-preview {
    background: var(--theme-bg-secondary);
    border-color: var(--theme-border-secondary);
}

.upload-actions {
    background: var(--theme-bg-secondary);
    border-color: var(--theme-border-secondary);
}

/* Dark theme progress section */
.progress-section {
    background: var(--theme-bg-secondary);
}

/* Dark theme status messages */
#status {
    color: var(--color-success);
}

/* Light Theme (Alternative) */
@media (prefers-color-scheme: light) {
    :root {
        --theme-bg-primary: #ffffff;
        --theme-bg-secondary: #f8f9fa;
        --theme-bg-tertiary: #e9ecef;
        --theme-text-primary: #212529;
        --theme-text-secondary: #495057;
        --theme-text-muted: #6c757d;
        --theme-border-primary: #dee2e6;
        --theme-border-secondary: #e9ecef;
        
        --theme-card-bg: #ffffff;
        --theme-card-border: #dee2e6;
        --theme-modal-bg: #ffffff;
        --theme-input-bg: #ffffff;
        --theme-input-border: #ced4da;
        
        --theme-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
        --theme-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
        --theme-shadow-lg: 0 8px 25px rgba(0, 122, 255, 0.15);
        --theme-shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.2);
    }
    
    body {
        background: var(--theme-bg-primary);
        color: var(--theme-text-secondary);
    }
    
    .serial-number .serial-value {
        color: var(--color-primary);
        background: rgba(0, 122, 255, 0.1);
    }
    
    .serial-number .serial-value:hover {
        background: rgba(0, 122, 255, 0.2);
    }
    
    .verify-overlay-btn {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(0, 0, 0, 0.3);
        color: var(--theme-text-primary);
    }
    
    .verify-overlay-btn:hover {
        background: var(--color-primary);
        border-color: var(--color-primary);
        color: white;
    }
    
    .image-modal {
        background: rgba(0, 0, 0, 0.7);
    }
    
    .nav-btn {
        background: rgba(255, 255, 255, 0.9);
        color: var(--theme-text-primary);
    }
    
    .nav-btn:hover:not(:disabled) {
        background: var(--color-primary);
        color: white;
    }
    
    .nav-btn:disabled {
        background: var(--theme-bg-tertiary);
        color: var(--theme-text-muted);
    }
}

/* High Contrast Theme */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #0000ff;
        --color-success: #00ff88;
        --color-danger: #ff0000;
        --color-warning: #ffaa00;
        --theme-text-primary: #000000;
        --theme-bg-primary: #ffffff;
        --theme-bg-secondary: #f0f0f0;
        --theme-border-primary: #000000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .session-card, .image-card {
        border: 2px solid var(--theme-border-primary);
    }
    
    .modal-content {
        border: 2px solid var(--theme-border-primary);
    }
    
    .form-input, .modal-serial-input {
        border: 2px solid var(--theme-border-primary);
    }
}

/* Reduced Motion Theme */
@media (prefers-reduced-motion: reduce) {
    .session-card:hover,
    .image-card:hover,
    .btn:hover {
        transform: none;
    }
    
    .loading::after {
        animation: none;
    }
    
    .nav-btn:hover:not(:disabled) {
        transform: none;
    }
    
    .verify-overlay-btn:hover {
        transform: none;
    }
}

/* Print Theme */
@media print {
    :root {
        --theme-bg-primary: #ffffff;
        --theme-bg-secondary: #ffffff;
        --theme-text-primary: #000000;
        --theme-text-secondary: #000000;
        --theme-text-muted: #666666;
        --theme-border-primary: #000000;
        --color-primary: #000000;
        --color-success: #000000;
        --color-danger: #000000;
        --color-warning: #000000;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .session-card, .image-card {
        border: 1px solid black;
        background: white;
    }
    
    .btn {
        display: none;
    }
    
    .modal, .upload-zone {
        display: none;
    }
}

/* Custom Theme Classes */
.theme-light {
    --theme-bg-primary: #ffffff;
    --theme-bg-secondary: #f8f9fa;
    --theme-bg-tertiary: #e9ecef;
    --theme-text-primary: #212529;
    --theme-text-secondary: #495057;
    --theme-text-muted: #6c757d;
    --theme-border-primary: #dee2e6;
    --theme-border-secondary: #e9ecef;
}

.theme-dark {
    --theme-bg-primary: #1c1c1e;
    --theme-bg-secondary: #2c2c2e;
    --theme-bg-tertiary: #3a3a3c;
    --theme-text-primary: #ffffff;
    --theme-text-secondary: #e5e5e7;
    --theme-text-muted: #8e8e93;
    --theme-border-primary: #48484a;
    --theme-border-secondary: #3a3a3c;
}

.theme-high-contrast {
    --color-primary: #0000ff;
    --color-success: #00ff00;
    --color-danger: #ff0000;
    --color-warning: #ffaa00;
    --theme-text-primary: #000000;
    --theme-bg-primary: #ffffff;
    --theme-border-primary: #000000;
}

/* Theme transition animations */
.theme-transition {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Dark mode toggle button (if needed) */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--theme-bg-secondary);
    border: 1px solid var(--theme-border-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.theme-toggle:hover {
    background: var(--color-primary);
    color: var(--theme-text-primary);
    transform: scale(1.1);
}

/* Theme-specific animations */
@keyframes dark-theme-fade-in {
    from {
        opacity: 0;
        background: #ffffff;
    }
    to {
        opacity: 1;
        background: var(--theme-bg-primary);
    }
}

@keyframes light-theme-fade-in {
    from {
        opacity: 0;
        background: #1c1c1e;
    }
    to {
        opacity: 1;
        background: var(--theme-bg-primary);
    }
}

.theme-dark body {
    animation: dark-theme-fade-in 0.3s ease;
}

.theme-light body {
    animation: light-theme-fade-in 0.3s ease;
}
