/* PANDEMONIUM REPORT - THEME SYSTEM */
/* Cyberprep/Tron Legacy themes with light/dark variants */

/* ==========================================================================
   DARK THEME (DEFAULT)
   ========================================================================== */

   :root {
	/* Colors inspired by Tron Legacy and Arwes */

	/* BACKGROUND */
	--primary-bg: #0a0a0f;
	--secondary-bg: #0f0f1a;
	--surface-bg: #141428;
	--accent-bg: #00d4ff;
	--card-bg: #1a1a2e;
	--dark-bg: #0d0d18;
	--hologram-bg: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(168, 85, 247, 0.1));
	--dark-glass: rgba(5, 15, 25, 0.85);

	/* TEXT */
	--text-primary: #e6f3ff;
	--text-secondary: #9bb3d1;
	--text-accent: #00d4ff;
	--text-muted: #6b7d99;
	--text-dark: #0a0a0f;

	/* ACCENTS */
	--accent-cyan: #00d4ff;
	--accent-orange: #ff6b35;
	--accent-blue: #0f4c75;
	--accent-purple: #7c3aed;
	--accent-green: #248232;
	--accent-red: #880D1E;
	--accent-white: #FBF5F3;
	--ultra-dark: rgba(0, 5, 15, 0.95);

	--cyan-glow: #00fff7;
	--purple-glow: #b300ff;

	--text-glow: rgba(0, 255, 255, 0.8);
	--font-main: 'Orbitron', sans-serif;

	--neon-blue: #00d4ff;
	--neon-purple: #a855f7;
	--neon-cyan: #06b6d4;

	--cinematic-gray: #141428;
	--cinematic-white: #ffffff;
	--cinematic-orange: #ff6b35;
	--cinematic-purple: #7c3aed;

	/* borders */
	--border-color: rgba(0, 212, 255, 0.3);
	/* Fallback */
	--border-color-cyan: rgba(0, 212, 255, 0.3);
	--border-color-orange: rgba(255, 107, 53, 0.3);
	--border-color-blue: rgba(15, 76, 117, 0.3);
	--border-color-purple: rgba(124, 58, 237, 0.3);
	--border-color-green: rgba(36, 130, 50, 0.3);
	--border-active: rgba(0, 212, 255, 0.8);
	--neon-border: rgba(0, 255, 255, 0.6);
	--cyber-border: rgba(0, 212, 255, 0.3);

	/* BOX SHADOWS GLOW */
	--glow-cyan: rgba(0, 212, 255, 0.4);
	--glow-orange: rgba(255, 107, 53, 0.4);
	--glow-blue: rgba(15, 76, 117, 0.4);
	--glow-purple: rgba(124, 58, 237, 0.4);
	--glow-green: rgba(36, 130, 50, 0.4);

	--corner-size: 12px;
	--frame-width: 2px;

	--font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	--font-display: 'Orbitron', 'Inter', sans-serif;

	--navbar-height: 87px;
	--transition: all 0.3s ease;

	--card-radius: 12px;
}

/* ==========================================================================
     LIGHT THEME
     ========================================================================== */

[data-theme="light"] {
	/* Light Theme Base Colors - maintaining cyberprep aesthetic */
	--primary-bg: #f0f4ff;
	--secondary-bg: #e6f0ff;
	--accent-bg: #0099cc;
	--surface-bg: #dce8ff;
	--card-bg: #ffffff;

	--text-primary: #1a1a2e;
	--text-secondary: #2d4059;
	--text-accent: #0099cc;
	--text-muted: #5a6c8a;

	/* Accent colors stay vibrant for cyberprep feel */
	--accent-cyan: #0099cc;
	--accent-orange: #ff5722;
	--accent-blue: #1976d2;
	--accent-purple: #6a1b9a;

	/* Adjusted for light theme */
	--border-color: rgba(0, 153, 204, 0.4);
	--border-active: rgba(0, 153, 204, 0.8);
	--glow-cyan: rgba(0, 153, 204, 0.3);
	--glow-orange: rgba(255, 87, 34, 0.3);

	/* Inverted grid and effects for light theme */
	--grid-opacity: 0.08;
	--scan-opacity: 0.05;

	/* Light theme shadows */
	--shadow-base: rgba(0, 0, 0, 0.1);
	--overlay-bg: rgba(255, 255, 255, 0.01);
	--backdrop-blur: rgba(240, 244, 255, 0.95);
}

/* ============================================
   THE MACHINE - Tema Dark Blu (Interfaccia IA Benevola)
   ============================================ */
   [data-theme="machine"] {
    /* Colori di base - Dominanza BLU freddo e calcolato */
    --primary-bg: #000308;              /* Nero-blu profondo */
    --secondary-bg: #001018;            /* Blu scurissimo */
    --accent-bg: #0d47a1;               /* Blu Machine primario */
    --surface-bg: #001a2e;              /* Superficie blu scura */
    --card-bg: #002440;                 /* Card blu profondo */

    /* Testo - Toni chiari su sfondo scuro */
    --text-primary: #e3f2fd;            /* Bianco-blu chiarissimo */
    --text-secondary: #90caf9;          /* Blu chiaro */
    --text-accent: #42a5f5;             /* Blu Machine */
    --text-muted: #607d8b;              /* Grigio-blu sbiadito */

    /* Colori IA - Palette BLU dominante */
    --accent-cyan: #00e5ff;             /* Cyan brillante (highlight) */
    --accent-red: #ff5252;              /* Rosso minacce */
    --accent-blue: #2196f3;             /* Blu Machine principale */
    --accent-purple: #7986cb;           /* Viola-blu secondario */

    /* Box colorati Machine - Basati sulla serie */
    --box-white: rgba(255, 255, 255, 0.9);      /* Monitored */
    --box-yellow: rgba(255, 235, 59, 0.95);     /* Aware of Machine */
    --box-red: rgba(244, 67, 54, 0.95);         /* Relevant threat */
    --box-blue: rgba(33, 150, 243, 0.95);       /* Government ops */
    --box-analog: rgba(255, 235, 59, 0.3);      /* Analog interface (Root) */

    /* Bordi e effetti - Glow BLU caratteristico */
    --border-color: rgba(33, 150, 243, 0.5);
    --border-active: rgba(33, 150, 243, 0.9);
    --glow-cyan: rgba(0, 229, 255, 0.6);
    --glow-orange: rgba(255, 152, 0, 0.4);
    --focus-outline: rgba(33, 150, 243, 0.8);
    --overlay-bg: rgba(0, 8, 20, 0.92);
    --backdrop-blur: rgba(0, 8, 20, 0.85);

    /* Effetti statici e dinamici */
    --grid-opacity: 0.12;               /* Griglia HUD più visibile */
    --scan-opacity: 0.08;               /* Scanline effetto CRT */
    --shadow-base: rgba(0, 150, 255, 0.4);  /* Ombra blu */
}


/* ============================================
   SAMARITAN - Tema Light Rosso/Giallo (IA Ostile)
   ============================================ */
[data-theme="samaritan"] {
    /* Colori di base - Sfondo CHIARO con dominanza ROSSO/GIALLO */
    --primary-bg: #fafafa;              /* Grigio chiarissimo quasi bianco */
    --secondary-bg: #f5f5f5;            /* Grigio molto chiaro */
    --accent-bg: #d32f2f;               /* Rosso Samaritan primario */
    --surface-bg: #ffffff;              /* Bianco puro */
    --card-bg: #fafafa;                 /* Card grigio chiarissimo */

    /* Testo - Scuro su sfondo chiaro */
    --text-primary: #212121;            /* Nero quasi puro */
    --text-secondary: #424242;          /* Grigio scuro */
    --text-accent: #c62828;             /* Rosso Samaritan */
    --text-muted: #757575;              /* Grigio medio */

    /* Colori IA - Palette ROSSO/GIALLO/ARANCIO aggressiva */
    --accent-cyan: #d32f2f;             /* Arancio intenso (non cyan!) */
    --accent-red: #d32f2f;              /* Rosso Samaritan principale */
    --accent-blue: #f57c00;             /* Arancio scuro */
    --accent-purple: #e65100;           /* Arancio bruciato */

    /* Box colorati Samaritan - Toni caldi */
    --box-white: rgba(66, 66, 66, 0.9);         /* Monitored (scuro) */
    --box-yellow: rgba(255, 179, 0, 0.95);      /* Warning */
    --box-red: rgba(211, 47, 47, 0.95);         /* Threat */
    --box-blue: rgba(255, 111, 0, 0.95);        /* Ops (arancio) */
    --box-analog: rgba(255, 87, 34, 0.3);       /* Analog (arancio trasparente) */

    /* Bordi e effetti - Glow ROSSO/ARANCIO minaccioso */
    --border-color: rgba(211, 47, 47, 0.4);
    --border-active: rgba(211, 47, 47, 0.8);
    --glow-cyan: rgba(255, 111, 0, 0.5);    /* Arancio invece di cyan */
    --glow-orange: rgba(255, 152, 0, 0.6);
    --focus-outline: rgba(211, 47, 47, 0.7);
    --overlay-bg: rgba(250, 250, 250, 0.95);
    --backdrop-blur: rgba(255, 255, 255, 0.9);

    /* Effetti statici e dinamici */
    --grid-opacity: 0.06;               /* Griglia più sottile su light */
    --scan-opacity: 0.04;               /* Scanline più leggera */
    --shadow-base: rgba(211, 47, 47, 0.2);  /* Ombra rossa leggera */
}



/* ==========================================================================
     THEME-SPECIFIC ADJUSTMENTS
     ========================================================================== */

/* Light theme specific overrides */
[data-theme="light"] .grid-background {
	background-image:
		linear-gradient(rgba(0, 153, 204, var(--grid-opacity)) 1px, transparent 1px),
		linear-gradient(90deg, rgba(0, 153, 204, var(--grid-opacity)) 1px, transparent 1px);
}

[data-theme="light"] .scanning-lines {
	background: linear-gradient(0deg,
			transparent 98%,
			rgba(0, 153, 204, var(--scan-opacity)) 99%,
			transparent 100%);
}

/* Light theme header adjustments */
[data-theme="light"] .main-header,
[data-theme="light"] .admin-header,
[data-theme="light"] .immersive-nav {
	background: var(--backdrop-blur);
	border-bottom: 1px solid var(--border-color);
	box-shadow: 0 2px 20px rgba(0, 153, 204, 0.1);
}

/* Light theme sci-fi frames */
[data-theme="light"] .sci-fi-frame:hover {
	border-color: var(--border-active);
	box-shadow:
		0 0 20px var(--glow-cyan),
		inset 0 0 20px rgba(0, 153, 204, 0.05);
}

/* Light theme buttons */
[data-theme="light"] .sci-fi-button:hover {
	border-color: var(--accent-cyan);
	color: var(--accent-cyan);
	text-shadow: 0 0 10px var(--accent-cyan);
	box-shadow: 0 0 20px var(--glow-cyan);
}

/* Light theme terminal/console elements */
[data-theme="light"] .hero-terminal,
[data-theme="light"] .terminal-header {
	background: var(--card-bg);
	border-color: var(--border-color);
	box-shadow: 0 4px 20px rgba(0, 153, 204, 0.1);
}

/* landing page */
[data-theme="light"] .hero-title .line {
	color: var(--card-bg);
}

[data-theme="light"] .hero-title .line.highlight {
	color: var(--accent-cyan);
}

/* Light theme modals and overlays */
[data-theme="light"] .modal-backdrop {
	background: rgba(240, 244, 255, 0.8);
	backdrop-filter: blur(10px);
}

[data-theme="light"] .photo-overlay,
[data-theme="light"] .modal-overlay {
	background: var(--overlay-bg) !important;
}

/* Light theme form elements */
[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-textarea:focus {
	border-color: var(--accent-cyan);
	box-shadow: 0 0 15px var(--glow-cyan);
}

/* Light theme stats and metrics */
[data-theme="light"] .stat-value,
[data-theme="light"] .metric-value {
	color: var(--accent-cyan);
	text-shadow: 0 0 15px var(--glow-cyan);
}

/* Light theme progress bars */
[data-theme="light"] .bar-fill,
[data-theme="light"] .progress-fill {
	background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
	box-shadow: 0 0 10px var(--glow-cyan);
}

/* Light theme images and media */
[data-theme="light"] .story-media img,
[data-theme="light"] .photo-thumb img {
	filter: brightness(0.95) contrast(1.05);
}

[data-theme="light"] .story-card:hover .story-media img,
[data-theme="light"] .photo-item:hover .photo-thumb img {
	filter: brightness(1.0) contrast(1.1);
}

/* Light theme nav active states */
[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-item.active {
	color: var(--accent-cyan);
	background: rgba(0, 153, 204, 0.1);
	border-left-color: var(--accent-cyan);
	text-shadow: 0 0 10px var(--accent-cyan);
}

/* Light theme filter tabs */
[data-theme="light"] .filter-btn.active,
[data-theme="light"] .filter-tab.active {
	background: var(--accent-cyan);
	color: white;
	border-color: var(--accent-cyan);
}

/* Light theme toggle switches */
[data-theme="light"] .toggle-switch input:checked+.switch {
	background: var(--accent-cyan);
	border-color: var(--accent-cyan);
}

/* Light theme status indicators */
[data-theme="light"] .status-dot.active {
	background: #00e676;
	box-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}

/* Light theme action buttons */
[data-theme="light"] .edit-btn:hover {
	border-color: var(--accent-cyan);
	color: var(--accent-cyan);
	box-shadow: 0 0 10px var(--glow-cyan);
}

[data-theme="light"] .delete-btn:hover {
	border-color: var(--accent-orange);
	color: var(--accent-orange);
	box-shadow: 0 0 10px var(--glow-orange);
}

/* Light theme thumbnails */
[data-theme="light"] .thumbnail.selected,
[data-theme="light"] .thumbnail.multi.selected {
	border-color: var(--accent-cyan);
	box-shadow:
		0 0 0 2px var(--accent-cyan),
		0 0 12px 2px var(--glow-cyan),
		0 0 40px 8px rgba(0, 153, 204, 0.12);
}

[data-theme="light"] .thumbnail:hover,
[data-theme="light"] .thumbnail:focus-visible {
	border-color: var(--accent-cyan);
	box-shadow:
		0 0 0 3px var(--accent-cyan),
		0 0 24px 0 var(--glow-cyan),
		0 0 60px 12px rgba(106, 27, 154, 0.08);
}

/* PHOTO MODAL */
[data-theme="light"] .photo-modal {
	background: var(--primary-bg);
}

/* actions and nav btns */
[data-theme="light"] .photo-nav,
[data-theme="light"] .photo-modal-info-toggle,
[data-theme="light"] .photo-modal-close {
	background: var(--secondary-bg);
	color: var(--text-muted);
}

[data-theme="light"] .photo-nav:hover,
[data-theme="light"] .photo-modal-info-toggle:hover,
[data-theme="light"] .photo-modal-close:hover {
	background: var(--primary-bg);
	color: var(--text-secondary);
}

[data-theme="light"] .photo-modal-info {
	background: linear-gradient(to top,
			rgba(240, 244, 255, 0.95) 0%,
			rgba(240, 244, 255, 0.9) 70%,
			transparent 100%);
	color: var(--text-muted)
}

[data-theme="light"] .photo-info-header h4,
[data-theme="light"] .photo-counter {
	color: var(--accent-cyan);
}

[data-theme="light"] .photo-counter {
	background: rgb(230, 240, 255);
}

[data-theme="light"] .metadata-value,
[data-theme="light"] .metadata-label {
	color: var(--text-secondary);
}


/* ==========================================================================
     THEME TRANSITION ANIMATIONS
     ========================================================================== */

* {
	transition:
		background-color 0.3s ease,
		border-color 0.3s ease,
		color 0.3s ease,
		box-shadow 0.3s ease;
}

/* Preserve existing animations */
.typing-text,
.bar-fill,
.progress-fill,
.sci-fi-button::before {
	transition: none;
}

/* Theme switch specific animation */
.theme-transitioning {
	transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}