/**
 * Infoskjerm site-wide theme variables and light mode component fixes
 */

:root,
html.theme-dark {
    --theme-header-bg: rgba(42, 42, 42, 0.95);
    --theme-card-bg: rgba(26, 26, 26, 0.85);
    --theme-card-bg-alt: rgba(42, 42, 42, 0.85);
    --theme-footer-bg: #1e293b;
    --theme-footer-border: #374151;
    --theme-mobile-menu-bg: rgba(26, 26, 26, 0.98);
    --theme-gdpr-bg: rgba(26, 26, 26, 0.98);
    --theme-hero-shadow: 0 0 30px rgba(0, 230, 230, 0.25);
    --theme-card-shadow: 0 10px 30px rgba(0, 230, 230, 0.2);
    --theme-nav-hover-bg: rgba(0, 230, 230, 0.1);
    --theme-header-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    --theme-lang-arrow: %23ffffff;
}

html.theme-light {
    --theme-bg-primary: #f1f5f9;
    --theme-bg-secondary: #ffffff;
    --theme-bg-surface: #f8fafc;
    --theme-bg-tertiary: #e2e8f0;
    --theme-text-primary: #0f172a;
    --theme-text-secondary: #334155;
    --theme-text-tertiary: #64748b;
    --theme-primary: #0369a1;
    --theme-accent: #c2410c;
    --theme-border-primary: #cbd5e1;
    --theme-border-subtle: #e2e8f0;
    --theme-header-bg: rgba(255, 255, 255, 0.98);
    --theme-card-bg: #ffffff;
    --theme-card-bg-alt: #ffffff;
    --theme-footer-bg: #e2e8f0;
    --theme-footer-border: #cbd5e1;
    --theme-mobile-menu-bg: rgba(255, 255, 255, 0.99);
    --theme-gdpr-bg: rgba(255, 255, 255, 0.98);
    --theme-hero-shadow: 0 8px 32px rgba(3, 105, 161, 0.12);
    --theme-card-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    --theme-nav-hover-bg: rgba(3, 105, 161, 0.08);
    --theme-header-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.06);
    --theme-lang-arrow: %23334155;
    --theme-stars: radial-gradient(1px 1px at 25px 35px, #cbd5e1, transparent),
        radial-gradient(1px 1px at 75px 65px, #94a3b8, transparent),
        radial-gradient(1px 1px at 120px 45px, #cbd5e1, transparent),
        radial-gradient(1px 1px at 160px 85px, #94a3b8, transparent);
    --theme-twinkling: radial-gradient(1px 1px at 40px 50px, rgba(3, 105, 161, 0.15), transparent),
        radial-gradient(1px 1px at 100px 30px, rgba(15, 23, 42, 0.06), transparent);
}

.header {
    background: var(--theme-header-bg);
    box-shadow: var(--theme-header-shadow);
}

.hero-content {
    background: var(--theme-card-bg);
    box-shadow: var(--theme-hero-shadow);
}

.feature-card {
    background: var(--theme-card-bg-alt);
    box-shadow: var(--theme-card-shadow);
}

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

.footer-bottom {
    border-top-color: var(--theme-footer-border);
}

.mobile-menu {
    background: var(--theme-mobile-menu-bg);
}

.gdpr-banner {
    background: var(--theme-gdpr-bg);
}

.nav a:hover {
    background: var(--theme-nav-hover-bg);
}

html.theme-light .nav a {
    color: #1e3a5f;
    font-weight: 600;
}

html.theme-light .nav a:hover {
    color: var(--theme-primary);
}

html.theme-light .logo {
    color: var(--theme-text-primary);
}

html.theme-light .hero h1 {
    text-shadow: none;
    background: linear-gradient(135deg, #0369a1, #c2410c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

html.theme-light .hero p {
    color: var(--theme-text-secondary);
}

html.theme-light .feature-card {
    border-color: var(--theme-border-subtle);
}

html.theme-light .feature-card:hover {
    border-color: var(--theme-primary);
    box-shadow: 0 8px 28px rgba(3, 105, 161, 0.15);
}

html.theme-light .features h2 {
    color: var(--theme-primary);
}

html.theme-light .footer-logo,
html.theme-light .footer-column h4 {
    color: #0f172a;
}

html.theme-light .footer-tagline,
html.theme-light .footer-column a {
    color: #475569;
}

html.theme-light .footer-copyright {
    color: #64748b;
}

html.theme-light .btn-theme {
    border-color: var(--theme-border-primary);
    color: var(--theme-text-primary);
}

html.theme-light .lang-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23334155' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

html.theme-light .stars {
    opacity: 0.35;
}

html.theme-light .twinkling {
    opacity: 0.12;
}

html.theme-light .btn-primary {
    color: #ffffff;
    background: #0369a1;
    background-image: none;
    box-shadow: none;
}

html.theme-light .btn-secondary {
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

html.theme-light .btn-secondary:hover {
    background: var(--theme-primary);
    color: #ffffff;
}

html.theme-light .btn-signup {
    color: #ffffff;
}

html.theme-light .user-menu-btn,
html.theme-light .user-menu-dropdown-content,
html.theme-light .lang-select {
    background: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
}

html.theme-light .mobile-nav a {
    color: var(--theme-text-secondary);
}

html.theme-light .gdpr-text {
    color: var(--theme-text-secondary);
}

.navbar-offset,
.main {
    padding-top: 90px;
}

/* Cards and panels that still use hardcoded dark backgrounds in page CSS */
.docs-card,
.api-section {
    background: var(--theme-card-bg);
    border-color: var(--theme-border-subtle);
    box-shadow: var(--theme-card-shadow);
}

.doc-content,
.changelog-container,
.legal-content,
.content-panel {
    background: var(--theme-card-bg);
    border-color: var(--theme-border-subtle);
    color: var(--theme-text-primary);
}

/* Contact and generic form pages */
.wrap h1,
.page-title,
.docs-header h1 {
    color: var(--theme-text-primary);
}

.sub,
.docs-header p,
.page-subtitle {
    color: var(--theme-text-secondary);
}

.card {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-subtle);
    box-shadow: var(--theme-card-shadow);
    color: var(--theme-text-primary);
}

label {
    color: var(--theme-text-secondary);
}

input,
select,
textarea {
    background: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
    border: 1px solid var(--theme-border-primary);
}

input::placeholder,
textarea::placeholder {
    color: var(--theme-text-tertiary);
}

select option {
    background: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
}

.links {
    color: var(--theme-text-secondary);
    border-top-color: var(--theme-border-subtle);
}

.links a {
    color: var(--theme-primary);
}

.notice {
    background: rgba(3, 105, 161, 0.08);
    border-color: rgba(3, 105, 161, 0.25);
    color: var(--theme-text-secondary);
}

html.theme-light body {
    background: var(--theme-bg-primary);
    color: var(--theme-text-primary);
}

html.theme-light .docs-card:hover,
html.theme-light .api-section:hover {
    box-shadow: 0 8px 28px rgba(3, 105, 161, 0.15);
    border-color: var(--theme-primary);
}

html.theme-light .docs-card h3,
html.theme-light .doc-section h2 {
    color: var(--theme-text-primary);
}

html.theme-light .docs-card p,
html.theme-light .docs-card-links a,
html.theme-light .api-description {
    color: var(--theme-text-secondary);
}

html.theme-light .docs-card-links a {
    color: var(--theme-primary);
}

html.theme-light .docs-header h1,
html.theme-light .page-title {
    text-shadow: none;
}

html.theme-light .docs-header h1 {
    background: linear-gradient(135deg, #0369a1, #c2410c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

html.theme-light .login-card,
html.theme-light .register-card {
    background: var(--theme-card-bg);
    border-color: var(--theme-border-subtle);
    box-shadow: var(--theme-card-shadow);
}

html.theme-light .login-header h1,
html.theme-light .login-subtitle {
    color: var(--theme-text-primary);
}

html.theme-light .login-subtitle,
html.theme-light .login-security-note {
    color: var(--theme-text-secondary) !important;
}

html.theme-light .legal-content,
html.theme-light .privacy-section,
html.theme-light .terms-section {
    background: var(--theme-card-bg);
    color: var(--theme-text-primary);
}

html.theme-light .changelog-entry {
    background: var(--theme-bg-secondary);
    border-color: var(--theme-border-subtle);
}

html.theme-light .version-header {
    color: var(--theme-text-primary);
}

html.theme-light .change-item {
    color: var(--theme-text-secondary);
}

/* Dashboard alias variables (used by profile and admin components) */
:root,
html.theme-dark,
html.theme-light {
    --theme-accent-primary: var(--theme-primary);
    --theme-accent-hover: #0284c7;
    --theme-hover-bg: rgba(0, 230, 230, 0.08);
    --theme-bg-hover: rgba(0, 230, 230, 0.08);
    --theme-border: var(--theme-border-primary);
    --theme-input-bg: var(--theme-bg-secondary);
    --theme-primary-dark: #0e7490;
    --theme-primary-light: #22d3ee;
    --theme-primary-rgb: 0, 230, 230;
    --theme-secondary-dark: #c026d3;
    --theme-secondary-light: #f0abfc;
    --theme-success-dark: #059669;
    --theme-success-light: #6ee7b7;
    --theme-warning-dark: #d97706;
    --theme-warning-light: #fcd34d;
    --theme-error-dark: #dc2626;
    --theme-error-light: #fca5a5;
    --theme-danger: var(--theme-error);
    --theme-danger-dark: #dc2626;
    --theme-danger-light: #fca5a5;
    --theme-info-dark: #0284c7;
    --theme-info-light: #7dd3fc;
    --theme-shadow-card: var(--theme-card-shadow, 0 4px 20px rgba(0, 0, 0, 0.15));
    --theme-shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.35);
}

html.theme-light {
    --theme-accent-primary: #0369a1;
    --theme-accent-hover: #075985;
    --theme-hover-bg: rgba(3, 105, 161, 0.08);
    --theme-bg-hover: rgba(3, 105, 161, 0.08);
    --theme-primary-rgb: 3, 105, 161;
    --theme-shadow-modal: 0 20px 60px rgba(15, 23, 42, 0.15);
}

/* Dashboard profile and teams readability */
html.theme-light .empty-state,
html.theme-light .team-profile-tab .empty-state {
    color: var(--theme-text-secondary);
}

html.theme-light .empty-state h3,
html.theme-light .team-profile-tab h2,
html.theme-light .team-profile-tab h3 {
    color: var(--theme-text-primary);
}

html.theme-light .team-profile-tab .btn-primary,
html.theme-light .profile-container .btn-primary,
html.theme-light .dashboard-content .btn-primary {
    background: var(--theme-accent-primary);
    color: #ffffff;
    border: 1px solid var(--theme-accent-primary);
    box-shadow: 0 2px 8px rgba(3, 105, 161, 0.25);
}

html.theme-light .team-profile-tab .btn-primary:hover,
html.theme-light .profile-container .btn-primary:hover,
html.theme-light .dashboard-content .btn-primary:hover {
    background: var(--theme-accent-hover);
    border-color: var(--theme-accent-hover);
    color: #ffffff;
}

html.theme-light .dashboard-sidebar,
html.theme-light .sidebar-nav a {
    color: var(--theme-text-secondary);
}

html.theme-light .sidebar-nav a:hover,
html.theme-light .sidebar-nav a.active {
    color: var(--theme-text-primary);
}

html.theme-light .form-section,
html.theme-light .account-info {
    background: var(--theme-card-bg);
    border-color: var(--theme-border-subtle);
}

html.theme-light .tab {
    color: var(--theme-text-secondary);
}

html.theme-light .tab.active {
    color: var(--theme-accent-primary);
    border-bottom-color: var(--theme-accent-primary);
}

html.theme-light .tab:hover {
    color: var(--theme-text-primary);
}

/* Solid primary buttons in light mode (no gradient glow) */
html.theme-light .btn-primary,
html.theme-light .user-profile-dashboard .btn-primary,
html.theme-light .team-profile-tab .btn-primary,
html.theme-light .dashboard-content .btn-primary,
html.theme-light .content-main .btn-primary {
    background: #0369a1 !important;
    background-image: none !important;
    color: #ffffff !important;
    border: 1px solid #075985 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

html.theme-light .btn-primary:hover,
html.theme-light .user-profile-dashboard .btn-primary:hover,
html.theme-light .team-profile-tab .btn-primary:hover,
html.theme-light .dashboard-content .btn-primary:hover,
html.theme-light .content-main .btn-primary:hover {
    background: #075985 !important;
    background-image: none !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(3, 105, 161, 0.25) !important;
}

/* Security / 2FA section in profile (embedded from settings) */
html.theme-light .settings-2fa-section {
    background: var(--theme-card-bg);
    border: 1px solid var(--theme-border-subtle);
    box-shadow: var(--theme-card-shadow);
    color: var(--theme-text-primary);
}

html.theme-light .settings-2fa-section .settings-2fa-title,
html.theme-light .settings-2fa-section .settings-2fa-h2 {
    color: var(--theme-primary) !important;
}

html.theme-light .settings-2fa-section .tagline,
html.theme-light .settings-2fa-section .settings-2fa-form label {
    color: var(--theme-text-secondary) !important;
}

html.theme-light .settings-2fa-section .settings-2fa-form input[type=text],
html.theme-light .settings-2fa-section .settings-2fa-form input[type=password] {
    background: var(--theme-bg-secondary);
    color: var(--theme-text-primary);
    border-color: var(--theme-border-primary);
}

html.theme-light .settings-2fa-section .settings-2fa-hr {
    border-top-color: var(--theme-border-subtle) !important;
}

html.theme-light .settings-2fa-section .btn,
html.theme-light .settings-2fa-section button[type=submit] {
    background: #0369a1 !important;
    color: #ffffff !important;
    border: 1px solid #075985 !important;
    box-shadow: none !important;
}

/* Dashboard overview light mode */
html.theme-light .dashboard-overview {
    background: var(--theme-bg-primary);
    color: var(--theme-text-primary);
}

html.theme-light .welcome-section,
html.theme-light .stat-card,
html.theme-light .system-status-card,
html.theme-light .recent-activity-section {
    background: var(--theme-card-bg) !important;
    background-image: none !important;
    border: 1px solid var(--theme-border-subtle);
    box-shadow: var(--theme-card-shadow);
    color: var(--theme-text-primary);
}

html.theme-light .welcome-title,
html.theme-light .stat-number,
html.theme-light .stat-label {
    color: var(--theme-text-primary) !important;
    background: none !important;
    -webkit-text-fill-color: unset !important;
}

html.theme-light .welcome-subtitle {
    color: var(--theme-text-secondary) !important;
}

html.theme-light .quick-action-btn.primary {
    background: #0369a1 !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

