/* ===========================
   Multi-Theme Support
   Inspector Platform (Dark/Light) + Sinergy
   =========================== */

/* Inspector Platform - Dark Mode (Default) */
:root[data-theme="inspector"][data-mode="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --logo-color: #3b82f6;
}

/* Inspector Platform - Light Mode */
:root[data-theme="inspector"][data-mode="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --border-color: #e2e8f0;
    --accent-primary: #3b82f6;
    --accent-hover: #2563eb;
    --logo-color: #1e293b;
}

/* Sinergy Theme (Original Light) */
:root[data-theme="sinergy"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8f9fa;
    --text-primary: #1a1a1a;
    --text-secondary: #495057;
    --text-tertiary: #6c757d;
    --border-color: #dee2e6;
    --accent-primary: #32373c;
    --accent-hover: #1a1a1a;
    --logo-color: #32373c;
}

/* Apply theme variables to body and main elements */
body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    transition: background-color 0.3s, color 0.3s;
}

.header,
.footer,
.scanner-container,
.manual-input-container,
.result-card {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

.header-text h1,
.section-header h2,
.scanner-header h2 {
    color: var(--text-primary) !important;
}

.subtitle,
.scanner-status p,
.footer-text p {
    color: var(--text-tertiary) !important;
}

.form-group input {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.btn-primary {
    background: var(--accent-primary) !important;
}

.btn-primary:hover {
    background: var(--accent-hover) !important;
}

.btn-secondary,
.btn-switch,
.btn-close {
    background: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

.qr-reader,
.scanner-status {
    background: var(--bg-tertiary) !important;
    border-color: var(--border-color) !important;
}

.info-item {
    background: var(--bg-tertiary) !important;
    border-left-color: var(--accent-primary) !important;
}

.info-value,
.form-group label {
    color: var(--text-primary) !important;
}

.divider::before,
.divider::after {
    background: var(--border-color) !important;
}

/* Theme Controls (Discrete) */
.theme-controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0 0.25rem;
}

.theme-toggle,
.brand-toggle {
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.theme-toggle:hover,
.brand-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.theme-toggle svg {
    width: 0.875rem;
    height: 0.875rem;
    stroke-width: 2;
}

.brand-name {
    font-weight: 500;
    font-size: 0.75rem;
}

/* Logo Container */
.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 2.5rem;
    width: auto;
    flex-shrink: 0;
}

.logo-inspector {
    stroke: var(--logo-color);
}

.footer-logo {
    height: 2rem;
}

/* Responsive adjustments for theme controls */
@media (max-width: 640px) {
    .theme-controls {
        gap: 0.375rem;
        margin-bottom: 0.5rem;
    }

    .theme-toggle,
    .brand-toggle {
        padding: 0.3rem 0.5rem;
        font-size: 0.6875rem;
    }

    .theme-toggle svg {
        width: 0.75rem;
        height: 0.75rem;
    }

    .logo {
        height: 2rem;
    }

    .footer-logo {
        height: 1.75rem;
    }
}

@media (max-width: 380px) {
    .logo {
        height: 1.75rem;
    }

    .footer-logo {
        height: 1.5rem;
    }
}
