/**
 * Projekt: Skool Dimension
 * Datei: css/lighttheme/light.css
 *
 * Zweck:
 * Vollständiges Light Theme für Frontend, Backend und Dokumentation.
 *
 * Hinweise:
 * - Diese Datei enthält Layout, Komponenten und Light-Farbwerte.
 * - dark.css wird zusätzlich geladen und greift nur bei html[data-theme="dark"].
 * - Der Wechsel erfolgt über js/theme-switcher.js.
 */

/* ------------------------------------------------------------
   1. Theme-Variablen
------------------------------------------------------------ */

:root,
html[data-theme="light"] {
    color-scheme: light;

    --bg: #f5f7fb;
    --bg-gradient: radial-gradient(circle at top left, rgba(36, 87, 166, 0.11), transparent 32rem),
                   linear-gradient(180deg, #fbfdff 0%, #f5f7fb 42%, #eef3f9 100%);

    --surface: #ffffff;
    --surface-soft: #f7faff;
    --surface-strong: #edf4ff;

    --text: #162033;
    --text-soft: #334155;
    --muted: #667085;

    --primary: #2457a6;
    --primary-hover: #1b4484;
    --primary-soft: #e9f1ff;
    --primary-ring: rgba(36, 87, 166, 0.22);

    --secondary: #607086;
    --secondary-hover: #4b5a6e;
    --danger: #b42318;

    --success-bg: #edf9f0;
    --success-text: #216a31;
    --success-border: #98d3a5;

    --error-bg: #fff0f0;
    --error-text: #8a1f1f;
    --error-border: #e2a2a2;

    --info-bg: #eef4ff;
    --info-text: #183d73;
    --info-border: #b9cef2;

    --warning-bg: #fff8e7;
    --warning-text: #8a5a00;
    --warning-border: #f2d48b;

    --border: #d8e0ea;
    --border-strong: #c5d0dd;

    --shadow-sm: 0 4px 14px rgba(23, 32, 51, 0.06);
    --shadow-md: 0 10px 28px rgba(23, 32, 51, 0.09);
    --shadow-lg: 0 22px 55px rgba(23, 32, 51, 0.17);

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 26px;

    --container: 1120px;
    --transition: 180ms ease;
}

/* ------------------------------------------------------------
   2. Reset und Basis
------------------------------------------------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
    background-image: var(--bg-gradient);
    line-height: 1.6;
    accent-color: var(--primary);
}

img,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--primary);
    text-decoration: none;
    text-underline-offset: 0.18em;
}

a:hover,
a:focus-visible {
    text-decoration: underline;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

code {
    padding: 0.1rem 0.35rem;
    border-radius: 0.35rem;
    color: var(--primary-hover);
    background: var(--primary-soft);
}

pre {
    overflow-x: auto;
    white-space: pre-wrap;
}

.project-tree {
    padding: 1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    white-space: pre;
    line-height: 1.55;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin-block: 1.5rem;
}

::selection {
    color: #ffffff;
    background: var(--primary);
}

:focus-visible {
    outline: 3px solid var(--primary-ring);
    outline-offset: 3px;
}

.container {
    width: min(var(--container), calc(100% - 2rem));
    margin-inline: auto;
}

.container.narrow,
.narrow {
    max-width: 720px;
}

/* ------------------------------------------------------------
   3. Buttons und Theme-Switch
------------------------------------------------------------ */

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: #ffffff;
    background: var(--primary);
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition), border-color var(--transition);
}

.button:hover,
.button:focus-visible,
button:hover,
button:focus-visible {
    background: var(--primary-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
    text-decoration: none;
}

.button-primary {
    background: var(--primary);
    color: #ffffff;
}

.button-secondary {
    background: var(--secondary);
    color: #ffffff;
}

.button-secondary:hover,
.button-secondary:focus-visible {
    background: var(--secondary-hover);
}

.button-danger {
    color: #ffffff;
    background: var(--secondary);
}

.button-danger:hover,
.button-danger:focus-visible {
    color: #ffffff;
    background: var(--danger);
}

.button-small {
    min-height: 2.15rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
}

.theme-toggle {
    min-height: 2.35rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    color: var(--text);
    background: var(--surface-soft);
    border-color: var(--border-strong);
}

.theme-toggle-fixed {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1000;
}

.theme-toggle-icon {
    font-size: 1rem;
    line-height: 1;
}

/* ------------------------------------------------------------
   4. Header und Meta-Navigation
------------------------------------------------------------ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* Ordnet Logo, Titel und Meta-Links horizontal im Kopfbereich an. */
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1rem;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
}

.logo-link:hover,
.logo-link:focus-visible {
    text-decoration: none;
}

.logo {
    width: 54px;
    height: 54px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
    box-shadow: var(--shadow-sm);
}

.site-title {
    font-size: 1.35rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Fasst Login-, Doku- und Hilfslinks kompakt rechtsbuendig zusammen. */
.meta-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.8rem;
    font-size: 0.95rem;
}

.meta-navigation a {
    color: var(--text-soft);
    font-weight: 700;
}

.meta-navigation span {
    color: var(--muted);
    font-weight: 700;
}

.login-status {
    color: var(--muted);
}

/* ------------------------------------------------------------
   5. Hauptnavigation
------------------------------------------------------------ */

.site-navigation {
    background: #e9f1ff;
    background-image: linear-gradient(180deg, #f4f8ff 0%, #e7f0ff 100%);
    border-bottom: 1px solid var(--border);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.55);
}

/* Hält die Hauptnavigation auch bei vielen Menüpunkten sauber umbrechbar. */
.site-navigation ul {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0.45rem;
    list-style: none;
    margin: 0;
    padding: 0.55rem 0;
}

.site-navigation a {
    display: inline-flex;
    align-items: center;
    min-height: 2.8rem;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-soft);
    font-weight: 800;
    text-decoration: none;
    transition: color var(--transition), background-color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.site-navigation a[aria-current="page"],
.site-navigation a:hover,
.site-navigation a:focus-visible {
    color: var(--primary-hover);
    background: #ffffff;
    border-color: #c8d7ee;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.site-navigation a[aria-current="page"] {
    color: #ffffff;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-color: #1b4484;
}

/* ------------------------------------------------------------
   6. Suche und Formulare
------------------------------------------------------------ */

/* Trennt die globale Suche sichtbar vom eigentlichen Seiteninhalt. */
.global-search {
    background: #f2f7ff;
    border-bottom: 1px solid var(--border);
    padding-block: 1rem;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.75rem 0.9rem;
}

/* Einheitliche Feldoptik fuer Frontend-, Backend- und Suchformulare. */
.search-form label,
.contact-form label,
.login-form label,
.register-form label,
.admin-form label {
    font-weight: 800;
}

.search-form label {
    grid-column: 1 / -1;
}

.search-form input {
    max-width: none;
}

.search-form button {
    min-width: 9rem;
}

input,
textarea,
select {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    outline: 0;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-ring);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

.contact-form,
.login-form,
.register-form,
.admin-form {
    display: grid;
    gap: 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow-md);
}

/* Zusatzbox fuer Demo-Logins und Bedienhinweise auf der Login-Seite. */
.login-hints {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--primary-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.login-hints h2 {
    margin-top: 0;
}

/* ------------------------------------------------------------
   7. Seitenlayout und Hero
------------------------------------------------------------ */

.site-main {
    min-height: 52vh;
}

/* Hebt die Startseite mit einem eigenstaendigen Hero-Bereich hervor. */
.hero {
    padding-block: 4.25rem;
    background: radial-gradient(circle at top right, rgba(36, 87, 166, 0.16), transparent 24rem), linear-gradient(135deg, var(--surface), var(--primary-soft));
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: center;
}

.hero-text p {
    max-width: 62ch;
    color: var(--text-soft);
}

.eyebrow {
    color: var(--primary);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.hero h1,
.page-header h1 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 4vw, 3.55rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Kapselt das grosse Vorschaubild der Startseite separat vom Fliesstext. */
.hero-image {
    display: flex;
    justify-content: center;
}

.hero-image img {
    width: min(100%, 390px);
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

/* ------------------------------------------------------------
   8. Sektionen, Karten und Detailansichten
------------------------------------------------------------ */

/* Vereinheitlicht Abstaende und Maximalbreiten fuer Inhaltsbloecke. */
.info-section,
.content-section {
    padding-block: 3rem;
}

.page-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-header p {
    max-width: 70ch;
    color: var(--text-soft);
}

/* Nutzt flexible Kartenraster fuer Dashboard-, About- und Listenbloecke. */
.card-grid,
.seminar-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.card,
.seminar-card,
.detail-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow-md);
}

.card h3,
.seminar-card h2,
.detail-card h2 {
    margin-top: 0.25rem;
    letter-spacing: -0.02em;
}

.seminar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1rem 0;
    color: var(--muted);
    font-weight: 800;
}

.price {
    color: var(--primary);
    font-size: 1.35rem;
    font-weight: 900;
}

.breadcrumb {
    color: var(--muted);
    margin-bottom: 1rem;
}

/* Trennelement fuer thematisch verwandte Inhaltsabschnitte. */
.related-section {
    margin-top: 2rem;
}

/* ------------------------------------------------------------
   9. Tabellen
------------------------------------------------------------ */

/* Erlaubt horizontales Scrollen, wenn Tabellen mehr Spalten als Platz haben. */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
}

/* Haelt Kopfzeilen visuell stabil, ohne Woerter mitten im Begriff zu trennen. */
.data-table th,
.data-table td {
    padding: 0.9rem 0.85rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: manual;
}

.data-table th {
    color: var(--text);
    background: var(--primary-soft);
    font-weight: 900;
    white-space: nowrap;
}

.data-table tbody tr {
    transition: background-color var(--transition);
}

.data-table tbody tr:hover {
    background: var(--surface-soft);
}

.data-table tr:last-child td {
    border-bottom: 0;
}

/* ------------------------------------------------------------
   10. Meldungen, Badges und Hilfstexte
------------------------------------------------------------ */

/* Einheitlicher Rahmen fuer Erfolg, Fehler, Warnung und leere Zustaende. */
.flash,
.message,
.search-result-info {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.95rem 1rem;
}

.flash {
    margin-bottom: 1rem;
}

.flash-success,
.message-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

.flash-error,
.message-error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
}

.message-info,
.search-result-info {
    background: var(--info-bg);
    color: var(--info-text);
    border-color: var(--info-border);
}

.message-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-border);
}

.message pre {
    overflow-x: auto;
    white-space: pre-wrap;
    padding: 1rem;
    color: #f9fafb;
    background: #1f2937;
    border-radius: var(--radius-sm);
}

.badge {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 900;
}

.badge-muted {
    color: var(--text-soft);
    background: #edf0f4;
}

.hint,
small {
    color: var(--muted);
}

/* ------------------------------------------------------------
   11. Dokumentation und Medien
------------------------------------------------------------ */

/* Ordnet Diagramme, Screenshots und Beispielmedien in der Doku konsistent an. */
.doc-figure {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.doc-figure img {
    width: 100%;
    border-radius: var(--radius-md);
}

.doc-figure figcaption {
    margin-top: 0.65rem;
    color: var(--muted);
    font-weight: 700;
}

/* ------------------------------------------------------------
   12. Footer
------------------------------------------------------------ */

/* Trennt Footer-Navigation und Rechtstexte optisch vom Seiteninhalt. */
.site-footer {
    margin-top: 2rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1rem;
}

.footer-inner ul {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ------------------------------------------------------------
   13. Responsive Anpassungen
------------------------------------------------------------ */

@media (max-width: 980px) {
    /* Reduziert grosse Raster und den Hero auf Tabletgroesse. */
    .card-grid,
    .seminar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-inner {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-block: 3rem;
    }

    .hero-image {
        justify-content: flex-start;
    }
}

@media (max-width: 780px) {
    /* Stapelt Navigation, Suche und Footer auf schmalen Displays sauber um. */
    .header-inner,
    .footer-inner,
    .page-header {
        display: block;
    }

    .search-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .meta-navigation,
    .hero-actions {
        justify-content: flex-start;
        margin-top: 1rem;
    }

    .site-navigation ul {
        display: block;
    }

    .card-grid,
    .seminar-grid {
        grid-template-columns: 1fr;
    }

    .site-navigation a {
        width: 100%;
    }

    .search-form button {
        width: 100%;
    }

    .footer-inner ul {
        margin-top: 0.75rem;
    }

    .theme-toggle-fixed {
        right: 0.75rem;
        bottom: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
