/* -----------------------------------------------------------
   1. SCHRIFTARTEN DEFINITION (LOKAL)
   WICHTIG: Pfade müssen absolut sein (/assets/...), damit sie 
   von jeder Unterseite aus gefunden werden!
----------------------------------------------------------- */

/* Hauptschriftart: Agency FB */
@font-face {
    font-family: 'Agency FB';
    src: url('/assets/fonts/AgencyFB.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Zweitschriftart: Aurebesh */
@font-face {
    font-family: 'Aurebesh';
    src: url('/assets/fonts/Aurebesh.otf') format('opentype'),
         url('/assets/fonts/Aurebesh.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* -----------------------------------------------------------
   2. GENERELLE VARIABLEN & THEMES
----------------------------------------------------------- */
:root {
    /* Globale Font-Variable */
    --font-main: 'Agency FB', sans-serif;

    /* --- DEFAULT THEME (Sci-Fi Dark Red) --- */
    --bg-color: #1a1a1a;
    --card-bg: #0f1012;
    --accent-color: #8a0c0c;      
    --accent-glow: #ff1a1a;       
    --text-white: #ffffff;
    --text-gray: #a0a0a0;
    --input-bg: #111;
    --border-color: #333;
    
    --accent-red: var(--accent-color);
    --accent-red-glow: var(--accent-glow);
    
    --btn-special: #e65100;
    --btn-special-border: #ff9800;
    --btn-special-text: #ffffff;

    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 20px;
}

/* -----------------------------------------------------------
   3. GLOBALE SCHRIFTART-ZUWEISUNG
----------------------------------------------------------- */

/* Wir erzwingen Agency FB überall, überschreiben auch alte Orbitron-Klassen */
body, h1, h2, h3, h4, h5, h6, 
p, span, div, a, li,
button, input, select, textarea, 
.font-orbitron {
    font-family: var(--font-main) !important;
    letter-spacing: 1px; /* Agency FB ist eng, etwas Luft tut gut */
}

/* Ausnahme: Aurebesh */
.font-aurebesh {
    font-family: 'Aurebesh', var(--font-main) !important;
    letter-spacing: 2px;
}

/* -----------------------------------------------------------
   4. THEMES
----------------------------------------------------------- */

/* --- THEME: BLUE (Tactical Blue) --- */
body.theme-blue {
    --bg-color: #0b1016;
    --card-bg: #131a24;
    --accent-color: #0d47a1;
    --accent-glow: #42a5f5;
    --text-white: #e3f2fd;
    --text-gray: #90caf9;
    --input-bg: #0f1620;
    --border-color: #1e3a5f;
    --accent-red: #0d47a1; 
    --accent-red-glow: #42a5f5;
    --btn-special: #0277bd;
    --btn-special-border: #29b6f6;
    --btn-special-text: #ffffff;
}

/* --- THEME: DARK ORANGE (Industrial / Geonosis) --- */
body.theme-dark-orange {
    --bg-color: #140a00;
    --card-bg: #1f1205;
    --accent-color: #e65100;
    --accent-glow: #ff9800;
    --text-white: #fff3e0;
    --text-gray: #ffcc80;
    --input-bg: #2d1a08;
    --border-color: #4e342e;
    --accent-red: #bf360c;
    --accent-red-glow: #ff5722;
    --btn-special: #ff6f00;
    --btn-special-border: #ffca28;
    --btn-special-text: #000000;
}

/* --- THEME: WHITE (Laboratory / Kamino) --- */
body.theme-white {
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --accent-color: #263238; 
    --accent-glow: #000000;
    --text-white: #263238;
    --text-gray: #546e7a;
    --input-bg: #eceff1;
    --border-color: #cfd8dc;
    --accent-red: #37474f;
    --accent-red-glow: #263238;
    --btn-special: #263238;
    --btn-special-border: #000000;
    --btn-special-text: #ffffff;
    --card-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* --- THEME: CHRISTMAS (Winter) --- */
body.theme-christmas {
    --bg-color: #0f1810;
    --card-bg: #162418;
    --accent-color: #1b5e20;
    --accent-glow: #c62828;
    --text-white: #e8f5e9;
    --text-gray: #a5d6a7;
    --input-bg: #1b2e1e;
    --border-color: #2e7d32;
    --accent-red: #c62828; 
    --accent-red-glow: #ff5252;
    --btn-special: #b71c1c;
    --btn-special-border: #ef5350;
    --btn-special-text: #ffffff;
}

/* --- THEME: GM-GRAY (Gray-Dark Gray) --- */
body.theme-gray {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --accent-color: #616161;
    --accent-glow: #9e9e9e;
    --text-white: #e0e0e0;
    --text-gray: #bdbdbd;
    --input-bg: #212121;
    --border-color: #424242;
    --accent-red: #616161; 
    --accent-red-glow: #9e9e9e;
    --btn-special: #424242;
    --btn-special-border: #757575;
    --btn-special-text: #ffffff;
}

/* -----------------------------------------------------------
   5. BASIS LAYOUT STYLES
----------------------------------------------------------- */
body {
    background-color: var(--bg-color);
    color: var(--text-white);
    margin: 0; padding: 0;
    display: flex; flex-direction: column;
    min-height: 100vh;
    position: relative; overflow-x: hidden; 
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* White Theme Shadows */
body.theme-white .login-card, 
body.theme-white .dashboard-col,
body.theme-white .matrix-sidebar,
body.theme-white nav {
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

/* Christmas Snow Effect */
body.theme-christmas::before {
    content: ''; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; z-index: -1;
    background-image: 
        radial-gradient(4px 4px at 20% 30%, #fff, transparent),
        radial-gradient(3px 3px at 40% 70%, #fff, transparent),
        radial-gradient(4px 4px at 60% 10%, #fff, transparent);
    background-size: 500px 500px; opacity: 0.6;
    animation: snowFall 15s linear infinite;
}

@keyframes snowFall { 0% { background-position: 0 0; } 100% { background-position: 0 500px; } }

/* -----------------------------------------------------------
   6. DESIGN SWITCHER (FAB)
----------------------------------------------------------- */
.design-fab-container {
    position: fixed; bottom: 30px; right: 30px; z-index: 1000;
    display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 10px;
}
.design-fab-btn {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--card-bg); border: 2px solid var(--accent-glow);
    color: var(--accent-glow); font-size: 24px; cursor: pointer;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transition: all 0.3s; display: flex; justify-content: center; align-items: center;
}
.design-fab-btn:hover { transform: scale(1.1) rotate(90deg); box-shadow: 0 0 30px var(--accent-glow); }

body.theme-christmas .design-fab-btn::after {
    content: '🧝'; font-size: 35px; position: absolute; top: -25px; right: 0;
    filter: drop-shadow(2px 2px 2px rgba(0,0,0,0.8)); animation: elfWiggle 3s infinite ease-in-out; pointer-events: none;
}
@keyframes elfWiggle { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }

.design-menu {
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: var(--radius-medium); padding: 10px;
    display: flex; flex-direction: column; gap: 5px; width: 180px;
    opacity: 0; transform: translateY(20px) scale(0.9); pointer-events: none;
    transition: all 0.3s ease; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.design-menu.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }

.design-option {
    background: transparent; border: none; color: var(--text-white);
    padding: 10px; text-align: left; cursor: pointer;
    font-size: 0.8rem; border-radius: 4px; transition: background 0.2s;
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-main) !important;
}
.design-option:hover { background: rgba(255,255,255,0.1); color: var(--accent-glow); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

@media (max-width: 600px) {
    .design-fab-container { bottom: 15px; right: 15px; }
    .design-fab-btn { width: 52px; height: 52px; font-size: 20px; }
    .design-menu { width: 160px; }
}