/* Pfad: schulportal/assets/css/style.css */

/* =====================================================================
   1. GLOBALE PORTAL-EINSTELLUNGEN & VARIABLEN (UM 2PX VERKLEINERT)
   ===================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:root {
    --primary: #003354;       /* Das tiefe Hintergrund-Blau */
    --primary-dark: #00223a;  /* Extra tiefes Navy für Tabellenköpfe */
    --secondary: #0082c3;     /* Sky Blue für Hovers */
    --mpg-turquois: #00bfa5;  /* Das exakte MPG-Türkis für aktive Elemente */
    --accent-green: #24b872;  /* Erfolg / Aktiv-P5 */
    --accent-red: #d9534f;    /* Fehler / Lösch-Rot */
    --border-color: #e5e7eb;  /* Feines Soft-Grau wie im Wunschbild */
}

body {
    background-color: var(--primary) !important;
    color: #333333;
    font-size: 0.85rem; /* Reduziert von ~16px auf ~13.5px */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =====================================================================
   2. OBERER HEADER BANNER (STICKY)
   ===================================================================== */
.main-header, .header-container {
    background-color: #ffffff !important;
    padding: 0 25px !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 4px solid var(--primary-dark);
    position: sticky !important;
    top: 0;
    height: 70px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
}

.navbar-center-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.35rem; /* Um 2px verkleinert */
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--mpg-turquois);
    display: inline-block;
    z-index: 1;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 2;
}

.logo-img {
    height: 45px;
    width: auto;
}

/* =====================================================================
   3. HAUPT-NAVBAR REITER (IM BANNER)
   ===================================================================== */
.navbar {
    height: 100%;
}

.nav-tabs, .navbar .nav-links {
    display: flex;
    list-style: none;
    height: 100%;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
}

.nav-links li, .nav-tabs a {
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-link, .navbar .nav-links li a {
    text-decoration: none !important;
    border-bottom: none !important;
    outline: none !important;
    color: #333333 !important;
    font-weight: bold;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 0.85rem; /* Um 2px verkleinert */
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover, .navbar .nav-links li:hover a {
    background-color: var(--secondary) !important;
    color: #ffffff !important;
}

.nav-link.active, .navbar .nav-links .active-tab a {
    color: var(--mpg-turquois) !important; 
    background-color: #ffffff !important;
}
/* =====================================================================
   4. INNERE REITER-LEISTE (KARTEN-LOOK & STICKY - TEXT REDUZIERT)
   ===================================================================== */
.sub-nav-bar, .admin-tab-bar {
    display: flex !important;
    list-style: none !important;
    gap: 4px !important;
    width: calc(100% - 50px) !important;
    max-width: 1400px !important;
    margin: 25px auto 0 auto !important;
    background: #ffffff !important;
    padding: 10px 15px 0 15px !important;
    border-radius: 8px 8px 0 0 !important;
    border: 2px solid var(--border-color) !important;
    border-bottom: 1px solid var(--border-color) !important;
    position: sticky !important;
    top: 70px;
    z-index: 999;
}

.sub-nav-container {
    display: flex;
    gap: 4px;
    width: 100%;
    align-items: flex-end;
}

.sub-nav-link, .admin-tab-bar li a {
    text-decoration: none !important;
    color: #4b5563 !important;
    font-weight: bold !important;
    padding: 8px 16px !important; /* Etwas kompakter */
    display: block !important;
    font-size: 0.85rem !important; /* Um 2px verkleinert */
    border-radius: 6px 6px 0 0 !important;
    background: #ffffff !important;
    border: 1px solid var(--border-color) !important;
    border-bottom: none !important;
    transition: all 0.15s ease-in-out;
    margin-bottom: -1px !important;
}

.sub-nav-link:hover, .admin-tab-bar li:hover a {
    background-color: #f8fafc !important;
    color: var(--secondary) !important;
}

.sub-nav-link.active, .admin-tab-bar .active-admin-tab a {
    background-color: #ffffff !important;
    color: var(--mpg-turquois) !important;
    border-color: var(--border-color) !important;
    border-bottom: 4px solid var(--mpg-turquois) !important;
    padding-bottom: 5px !important;
    position: relative;
    z-index: 1001;
}

/* =====================================================================
   5. COMPACT INHALTSBOX (BREITBILD-OPTIMIERT BIS 1400PX)
   ===================================================================== */
.container, .card, .content {
    display: block !important;
    width: calc(100% - 50px) !important;
    max-width: 1400px !important;
    margin: 0 auto 30px auto !important;
    padding: 20px 25px !important; /* Kompakteres Innenpadding */
    background: #ffffff !important;
    border-radius: 0 0 8px 8px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25) !important;
    box-sizing: border-box !important;
    border: 2px solid var(--border-color) !important;
    border-top: none !important;
}

.container h2, .card h2 {
    color: var(--primary);
    font-size: 1.4rem; /* Um 2px verkleinert */
    margin-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

/* =====================================================================
   6. EDLE DATA-TABELLEN (SCHRIFT OPTIMIERT)
   ===================================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #ffffff !important;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

th {
    background-color: var(--primary-dark) !important;
    color: #ffffff !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem; /* Um 2px verkleinert, kompakt und edel */
    letter-spacing: 0.8px;
    padding: 10px 12px;
    border: none;
    border-bottom: 3px solid var(--secondary);
}

td {
    padding: 9px 12px; /* Kompaktisiert */
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 0.82rem; /* Um ~2px verkleinert für maximale Datenübersicht */
}

tr:nth-child(even) td { background-color: #f8fafc !important; }
tr:hover td { background-color: #f1f5f9 !important; }

/* =====================================================================
   7. INTERAKTIVES AG-WAHLGRID & FLIMMERSCHUTZ
   ===================================================================== */
.wahl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.wahl-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 2px solid #cbd5e1;
    box-shadow: 0 3px 6px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.wahl-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.08);
}

.wahl-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.wahl-card-body, .p-badge, .ag-info-slider { pointer-events: none !important; }
.wahl-card-body { padding: 12px; }
.wahl-card-body h3 { font-size: 1rem !important; }

.p-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    color: white;
    font-weight: bold;
    font-size: 0.95rem;
    padding: 4px 10px;
    border-radius: 4px;
}

/* =====================================================================
   8. FORMULARE, CHIPS & NEUE MODAL-POPUP STRUKTUREN (UNIVERSELL)
   ===================================================================== */
.input-field, .form-control, select, textarea {
    width: 100%;
    padding: 8px 10px; /* Kompakter */
    border: 2px solid #cbd5e1;
    background-color: #f8fafc;
    color: #0f172a;
    border-radius: 6px;
    font-size: 0.85rem; /* Verkleinert */
}

.input-field:focus, .form-control:focus, select:focus, textarea:focus {
    border-color: var(--secondary);
    background-color: #ffffff;
    outline: none;
}

.btn-action {
    display: inline-block;
    background: var(--secondary);
    color: #ffffff !important;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    font-size: 0.85rem;
}

.btn-mini {
    padding: 4px 8px;
    font-size: 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #ffffff !important;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

.chip {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 4px;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.72rem;
}

.p1 { background-color: #0082c3 !important; }
.p2 { background-color: #f0ad4e !important; }
.p3 { background-color: #f08080 !important; }
.p4 { background-color: #9370db !important; }
.p5 { background-color: #24b872 !important; }

/* MODAL SYSTEM (FÜR JEDES TAB EINSETZBAR) */
.custom-system-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 51, 84, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.modal-content-box {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    border-top: 5px solid var(--secondary);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
    box-sizing: border-box;
}

/* =====================================================================
   9. SYSTEM FOOTER & MOBILE ANPASSUNG
   ===================================================================== */
.main-footer {
    margin-top: auto;
    background: var(--primary-dark);
    color: rgba(255,255,255,0.5);
    text-align: center;
    padding: 12px;
    font-size: 0.75rem;
    border-top: 4px solid var(--secondary);
}

@media (max-width: 900px) {
    .main-header, .header-container { position: relative !important; height: auto; padding: 10px; flex-direction: column; gap: 10px; }
    .sub-nav-bar, .admin-tab-bar { position: relative !important; top: 0; width: calc(100% - 20px) !important; margin: 15px 10px 0 10px !important; padding: 5px !important; }
    .navbar-center-title { position: relative; left: 0; transform: none; margin: 10px 0; }
    .container, .card, .content { width: calc(100% - 20px) !important; margin: 0 10px 20px 10px !important; padding: 15px !important; border-radius: 8px !important; }
}
