/* assets/css/style.css - GLOBAL BASIS (Vollständig & Repariert) */

:root {
    /* --- 1. FARBPALETTE (Global) --- */
    --color-primary: #285694;
    --color-primary-light: rgba(40, 86, 148, 0.1);
    --color-accent: #47bcc2;
    --color-danger: #d93025;
    --color-success: #2ecc71; /* Neu für Status-Anzeigen */

    /* --- 2. THEME VARIABLEN (Light Mode Standard) --- */
    --color-bg: #f4f7fa;           /* App Hintergrund */
    --color-bg-card: #ffffff;      /* Karten Hintergrund */
    --color-bg-input: #ffffff;     /* Input Hintergrund */
    --color-bg-nav: #2c3e50;       /* Sidebar Hintergrund (Dunkelblau) */
    
    --color-text: #1a202c;         /* Haupttext */
    --color-text-secondary: #5a657d; /* Nebentext */
    --color-border: #e2e8f0;       /* Rahmen */

    /* --- 3. LAYOUT MAßE --- */
    --header-height: 60px;
    --mobile-nav-height: 60px;
    --sidebar-width: 260px;
    
    /* --- 4. STYLE UTILS --- */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --radius-md: 8px;
    --radius-lg: 12px;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- DARK MODE DEFINITION --- */
html.dark {
    /* Hintergrundtöne */
    --color-bg: #1a202c;           
    --color-bg-card: #2d3748;      
    --color-bg-input: #171d29;     
    --color-bg-nav: #2d3748;       
    
    /* Textfarben */
    --color-text: #e4e6eb;         
    --color-text-secondary: #b0b3b8; 
    --color-border: #333333;       
    
    /* Akzentfarben */
    --color-primary: #64b5f6;      
    --color-primary-light: rgba(100, 181, 246, 0.15);
}

/* --- BASIS RESET --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 16px;
    line-height: 1.5;
    background-image: none; 
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- APP LAYOUT STRUKTUR --- */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* SIDEBAR (Desktop) */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-bg-nav);
    color: white;
    display: none;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-weight: bold;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: rgba(255,255,255,0.7);
    border-radius: var(--radius-md);
    margin-bottom: 5px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-link.active {
    background-color: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.sidebar-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    background-color: currentColor; 
}

/* MAIN CONTENT AREA */
.app-main {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--mobile-nav-height); 
}

/* Desktop Anpassungen */
@media (min-width: 768px) {
    .app-sidebar { display: flex; }
    .app-main { 
        margin-left: var(--sidebar-width); 
        /* FIX: Globaler Padding unten, da Mobile Nav ausgeblendet wird */
        padding-bottom: 40px !important; 
    }
    .app-mobile-nav { display: none; }
    .mobile-menu-toggle { display: none; }
}

/* HEADER */
.app-header {
    height: var(--header-height);
    background-color: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 90; 
}

.header-left { display: flex; align-items: center; gap: 1rem; }
.header-right { display: flex; align-items: center; gap: 1rem; }

.header-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--color-text);
    margin: 0;
}

/* Icon Buttons */
.icon-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--color-text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.icon-button:hover {
    background-color: var(--color-bg);
    color: var(--color-primary);
}

/* Theme Toggle Icons */
#theme-toggle .icon-moon { display: none; }
html.dark #theme-toggle .icon-moon { display: block; }
html.dark #theme-toggle .icon-sun { display: none; }

/* MOBILE NAVIGATION */
.app-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background-color: var(--color-bg-card);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 95;
    padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    gap: 4px;
    width: 20%;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-nav-link i {
    font-size: 1.4rem;
    background-color: currentColor;
}

.mobile-nav-link.active {
    color: var(--color-primary);
    font-weight: bold;
}

/* HELPER */
/* FIX: Hier .detail-card ergänzt, damit sie das gleiche Styling hat wie content-card */
.content-card, .detail-card {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.main-content-area {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* --------------------------------------------------------- */
/* NEU: GLOBALE MOBILE OPTIMIERUNG (Weniger Rand = Mehr Platz) */
/* --------------------------------------------------------- */
@media (max-width: 768px) {
    /* 1. Weniger Rand um den gesamten Inhalt (vorher 16px, jetzt 8px) */
    .main-content-area {
        padding: 8px !important; 
    }
    
    /* 2. Header etwas kompakter */
    .app-header { 
        padding: 0 12px; 
    }

    /* 3. Alle Karten: Padding drastisch reduzieren für Handy */
    /* Das löst dein Problem mit dem Abstand in den Boxen */
    .content-card, .detail-card {
        padding: 12px !important; /* Vorher 24px, jetzt 12px -> viel mehr Platz innen */
        border-radius: var(--radius-md);
    }

    /* 4. Verhindert doppeltes Padding falls Framework-Klassen genutzt werden */
    .card-body {
        padding: 0 !important;
    }
}