/* ── Lokale Schrift (DSGVO-konform, kein Google Fonts) ──────── */
@font-face {
    font-family: 'Nunito';
    src: url('fonts/nunito/Nunito-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Nunito';
    src: url('fonts/nunito/Nunito-Italic-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* ============================================================
   Stundenplan-System – Linden-Grundschule Velten
   assets/style.css  v2.0
   ============================================================ */

/* ── Reset & Basis ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --green-dark:   #1b5e20;
    --green:        #2e7d32;
    --green-mid:    #43a047;
    --green-light:  #e8f5e9;
    --green-pale:   #f1f8e9;
    --today-bg:     #fff9c4;
    --today-border: #f9a825;
    --current-bg:   #fff3e0;
    --current-brd:  #ef6c00;
    --shadow:       0 2px 8px rgba(0,0,0,.12);
    --radius:       10px;
    --font:         'Segoe UI', Arial, sans-serif;
}

body {
    font-family: var(--font);
    font-size: 15px;
    background: var(--green-pale);
    color: #222;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--green); }

/* ── HEADER ─────────────────────────────────────────────────── */
.school-header {
    background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
    color: white;
    padding: 12px 20px;
    box-shadow: 0 3px 8px rgba(0,0,0,.2);
}

.header-inner {
    max-width: 1050px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.school-icon { font-size: 38px; line-height: 1; }

.header-text h2  { margin: 0; font-size: 17px; font-weight: 700; }
.header-text p   { margin: 2px 0 0; font-size: 12px; opacity: .8; }

.header-nav {
    margin-left: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── CONTAINER ──────────────────────────────────────────────── */
.container {
    max-width: 1050px;
    width: 100%;
    margin: 20px auto;
    padding: 0 16px;
    flex: 1;
}

/* ── INFO-BOX ───────────────────────────────────────────────── */
.info-box {
    background: var(--green-light);
    border-left: 5px solid var(--green);
    padding: 13px 16px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.6;
}

.info-box.warning {
    background: #fff8e1;
    border-color: #f9a825;
}

.info-box.error {
    background: #ffebee;
    border-color: #c62828;
}

/* ── SMART-ENTRY-BEREICH ────────────────────────────────────── */
.smart-entry {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}

.smart-entry h2 {
    color: var(--green);
    margin-bottom: 14px;
    font-size: 18px;
}

.entry-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.entry-row label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #444;
}

.entry-row input[type="text"],
.entry-row input[type="number"] {
    padding: 10px 13px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    min-width: 180px;
    transition: border-color .2s;
}

.entry-row input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(46,125,50,.15);
}

/* ── FARBPALETTE ────────────────────────────────────────────── */
.color-bar {
    background: white;
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #555;
}

.color-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform .15s, border-color .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.color-dot:hover   { transform: scale(1.25); }
.color-dot.active  { border-color: #222; transform: scale(1.2); box-shadow: 0 0 0 2px rgba(0,0,0,.3); }

/* ── TABELLE ────────────────────────────────────────────────── */
.table-wrap {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    margin-bottom: 18px;
}

.timetable {
    width: 100%;
    border-collapse: collapse;
}

/* Kopfzeile */
.timetable thead th {
    background: var(--green);
    color: white;
    padding: 11px 8px;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
}

.timetable thead th.hour-col { width: 90px; }

/* Zeit-Zeile unter den Tagen */
.timetable thead .time-row th {
    background: #f5f5f5;
    color: #777;
    font-size: 11px;
    font-weight: normal;
    padding: 4px;
    border-bottom: 1px solid #ddd;
}

/* Pausenzeilen */
.pause-row td {
    background: #fff8e1;
    color: #795548;
    font-size: 12px;
    text-align: center;
    padding: 5px;
    border-top: 1px dashed #e0c060;
    border-bottom: 1px dashed #e0c060;
    font-style: italic;
}

/* Stunden-Zellen */
.timetable tbody tr { transition: background .15s; }
.timetable tbody tr:hover { background: #f9fbe7; }

.timetable td {
    border: 1px solid #e8e8e8;
    padding: 4px 5px;
    text-align: center;
    vertical-align: middle;
}

/* Stunden-Nummer-Spalte */
td.hour-cell {
    background: #f5f5f5;
    font-weight: 700;
    font-size: 15px;
    color: var(--green);
    white-space: nowrap;
    min-width: 80px;
    padding: 6px 8px;
}

td.hour-cell .hour-num   { font-size: 18px; display: block; }
td.hour-cell .hour-time  { font-size: 10px; color: #999; display: block; margin-top: 2px; }

/* Heute-Spalte hervorheben */
.timetable th.today-col  { background: var(--today-border) !important; }
.timetable td.today-col  { background: var(--today-bg); }

/* Aktuelle Stunde hervorheben */
.timetable tr.current-hour td { background: var(--current-bg) !important; }
.timetable tr.current-hour td.hour-cell { background: var(--current-brd) !important; color: white !important; }

/* Eingabefelder im Editor */
.lesson-input {
    width: 100%;
    padding: 7px 6px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    transition: border-color .2s, box-shadow .2s;
    background: #fafafa;
    cursor: pointer;
}

.lesson-input:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(46,125,50,.15);
    background: white;
}

/* Fach-Boxen in der Ansicht */
.lesson-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 6px;
    border-radius: 7px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
    min-height: 38px;
    line-height: 1.2;
}

.lesson-box .lesson-icon { font-size: 16px; flex-shrink: 0; }
.lesson-box .lesson-name { word-break: break-word; }

.empty-cell { color: #ccc; font-size: 13px; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: filter .15s, transform .1s;
    white-space: nowrap;
}

.btn:active { transform: scale(.97); }
.btn:hover  { filter: brightness(.92); }

.btn-primary   { background: var(--green);    color: white; }
.btn-secondary { background: rgba(255,255,255,.2); color: white; border: 1px solid rgba(255,255,255,.4); }
.btn-secondary_admin { background: #DC143C; color: white; border: 1px solid rgba(255,255,255,.4); }
.btn-secondary-hilfe { background: #e65100; color: white; border: 1px solid rgba(255,255,255,.4); }
.btn-outline   { background: white; color: var(--green); border: 2px solid var(--green); }
.btn-danger    { background: #c62828; color: white; }
.btn-warn      { background: #e65100; color: white; }
.btn-save      { background: var(--green); color: white; font-size: 16px; padding: 11px 24px; }
.btn-save:disabled { background: #aaa; cursor: default; }

/* ── ERGEBNIS-BOX (nach dem Speichern) ─────────────────────── */
#resultBox { margin-top: 20px; }

.result-success {
    background: var(--green-light);
    border-left: 5px solid var(--green);
    padding: 18px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.result-error {
    background: #ffebee;
    border-left: 5px solid #c62828;
    padding: 18px 20px;
    border-radius: var(--radius);
}

/* ── QR-CODE BEREICH ────────────────────────────────────────── */
.qr-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-top: 20px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.qr-card img {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    border: 2px solid #eee;
    flex-shrink: 0;
}

.qr-info h3       { color: var(--green); margin-bottom: 8px; }
.qr-info p        { font-size: 14px; line-height: 1.6; color: #555; }
.qr-info .qr-url  { font-size: 12px; color: #999; word-break: break-all; margin-top: 8px; }

.qr-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ── HEUTE-HINWEIS (view.php) ───────────────────────────────── */
.today-banner {
    background: var(--today-bg);
    border-left: 5px solid var(--today-border);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-banner {
    background: var(--current-bg);
    border-left: 5px solid var(--current-brd);
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── PLANS-ÜBERSICHT ────────────────────────────────────────── */
.plans-list { display: flex; flex-direction: column; gap: 14px; }

.plan-card {
    background: white;
    border-radius: var(--radius);
    border-left: 5px solid var(--green);
    box-shadow: var(--shadow);
    display: flex;
    gap: 16px;
    padding: 16px 18px;
    align-items: center;
    flex-wrap: wrap;
}

.plan-card-body { flex: 1; min-width: 200px; }
.plan-card-body h3 { color: var(--green); margin-bottom: 4px; font-size: 17px; }
.plan-card-body .meta { font-size: 12px; color: #888; margin-bottom: 10px; }
.plan-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.plan-card-qr { text-align: center; }
.plan-card-qr img { width: 90px; height: 90px; border-radius: 5px; border: 1px solid #eee; }
.plan-card-qr p { font-size: 10px; color: #aaa; margin-top: 4px; }

/* ── ADMIN ──────────────────────────────────────────────────── */
.admin-header {
    background: linear-gradient(135deg, #212121, #424242);
}

.admin-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.admin-section h2 { color: #333; margin-bottom: 16px; font-size: 17px; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background: #424242; color: white; padding: 10px 12px; text-align: left; font-size: 13px; }
.admin-table td { border-bottom: 1px solid #f0f0f0; padding: 10px 12px; font-size: 14px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafafa; }

.time-editor-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.time-editor-row label { font-size: 13px; font-weight: 600; min-width: 80px; color: #444; }
.time-editor-row input { padding: 6px 10px; border: 1.5px solid #ddd; border-radius: 6px; font-size: 14px; width: 100px; }

/* ── FOOTER ─────────────────────────────────────────────────── */
.school-footer {
    text-align: center;
    padding: 14px;
    font-size: 12px;
    color: #aaa;
    margin-top: 10px;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 680px) {
    .header-inner  { flex-direction: column; align-items: flex-start; }
    .header-nav    { margin-left: 0; }
    .entry-row     { flex-direction: column; align-items: stretch; }
    .entry-row input { min-width: 0; }
    .qr-card       { flex-direction: column; }
    .plan-card     { flex-direction: column; }
}

/* ── PRINT (für Druck-Seite export.php) ────────────────────── */
@media print {
    .no-print      { display: none !important; }
    body           { background: white; }
    .table-wrap    { box-shadow: none; }
    .school-header { box-shadow: none; }
}
