/* ========================================================
   DATEI: style.css
   Material Design 3 (M3) Tokens & Framework Klassen
   ======================================================== */

:root {
    /* Standard-Tokens (Light Mode - Fallback) */
    --md-sys-color-primary: #005fb8; 
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #d3e4ff;
    --md-sys-color-on-primary-container: #001c38;
    --md-sys-color-surface: #fdfdfd; 
    --md-sys-color-on-surface: #1a1c1e;
    --md-sys-color-surface-variant: #dfe2e6;
    --md-sys-color-on-surface-variant: #43474e;
    --md-sys-color-outline: #74777f;
    --md-sys-color-error: #ba1a1a;
    --md-sys-color-on-error: #ffffff;
    --md-sys-color-scrim: rgba(0, 0, 0, 0.32);

    --md-sys-color-primary-glow: rgba(0, 95, 184, 0.15);

    /* System Variablen & Layout-Maße */
    --header-max-width: 1100px;
    --md-sys-typescale-body-large-font: 'Roboto', 'Arial', sans-serif;
    --md-sys-drawer-width: 280px; 
    --card-border-radius: 12px;
}

/* ========================================================
   BASIS & TYPOGRAFIE
   ======================================================== */
body {
    margin: 0;
    font-family: var(--md-sys-typescale-body-large-font);
    background-color: var(--md-sys-color-surface); 
    color: var(--md-sys-color-on-surface);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========================================================
   HEADER & OFF-CANVAS MENÜ (Geschützte Module)
   ======================================================== */
.m3-header {
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    width: 100%; 
    position: sticky; 
    top: 0; 
    z-index: 1200;    
    border-bottom: 1px solid var(--md-sys-color-surface-variant);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.m3-toolbar {
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    max-width: var(--header-max-width); 
    margin: 0 auto; 
    padding: 8px 24px; 
    min-height: 56px;
}

.m3-brand-area { 
    display: flex; 
    align-items: center; 
    gap: 16px; 
}

.m3-logo { 
    display: flex; 
    align-items: center; 
    text-decoration: none; 
    color: var(--md-sys-color-on-surface); 
    font-weight: 500; 
    font-size: 1.2rem; 
}

.m3-logo img { 
    width: 40px; 
    border-radius: 4px; 
    margin-right: 12px; 
}

/* Menü-Hintergrund (Abdunkelung) */
.m3-backdrop {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background-color: var(--md-sys-color-scrim); 
    z-index: 1250;
    opacity: 0; 
    visibility: hidden; 
    transition: 0.3s ease;
}
.m3-backdrop.is-open { 
    opacity: 1; 
    visibility: visible; 
}

/* Menü-Drawer (Die seitliche Navigation) */
.m3-nav-drawer {
    position: fixed; 
    top: 0; 
    left: calc(-1 * var(--md-sys-drawer-width));
    width: var(--md-sys-drawer-width); 
    height: 100vh;
    background-color: var(--md-sys-color-surface); 
    z-index: 1300;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1); 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    display: flex; 
    flex-direction: column;
}
.m3-nav-drawer.is-open { 
    transform: translateX(var(--md-sys-drawer-width)); 
}

.m3-drawer-header { 
    padding: 24px; 
    border-bottom: 1px solid var(--md-sys-color-surface-variant); 
    font-size: 1.2rem; 
    font-weight: 500; 
    color: var(--md-sys-color-on-surface);
}

.m3-drawer-links { 
    list-style: none; 
    padding: 12px; 
    margin: 0; 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}

.m3-drawer-links a { 
    text-decoration: none; 
    color: var(--md-sys-color-on-surface-variant); 
    padding: 16px; 
    border-radius: 100px; 
    font-weight: 500; 
    display: block;
    min-height: 48px;
    box-sizing: border-box;
}

.m3-drawer-links a:hover, .m3-drawer-links a.active { 
    background-color: var(--md-sys-color-surface-variant); 
    color: var(--md-sys-color-on-surface); 
}

/* ========================================================
   M3 BUTTONS (Optimiert für mind. 48px Touch-Ziele)
   ======================================================== */
.m3-icon-button { 
    background: transparent; 
    border: none; 
    color: var(--md-sys-color-on-surface-variant); 
    cursor: pointer; 
    width: 48px; 
    height: 48px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    border-radius: 50%; 
    transition: background-color 0.2s ease, color 0.2s ease;
}
.m3-icon-button:hover {
    background-color: var(--md-sys-color-surface-variant);
}

.m3-button-primary { 
    background-color: var(--md-sys-color-primary); 
    color: var(--md-sys-color-on-primary); 
    border: none; 
    border-radius: 9999px; 
    padding: 0 24px; 
    height: 40px; 
    font-weight: 500; 
    cursor: pointer; 
    transition: opacity 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.m3-button-primary:hover { 
    opacity: 0.95; 
    box-shadow: 0 0 12px var(--md-sys-color-primary-glow);
}

.m3-button-secondary { 
    background-color: transparent; 
    color: var(--md-sys-color-primary); 
    border: 1px solid var(--md-sys-color-primary); 
    border-radius: 9999px; 
    padding: 0 24px; 
    height: 40px; 
    font-weight: 500; 
    cursor: pointer; 
    transition: all 0.2s ease;
}
.m3-button-secondary:hover {
    background-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    box-shadow: 0 0 12px var(--md-sys-color-primary-glow);
}

.m3-button-error { 
    background-color: var(--md-sys-color-error); 
    color: var(--md-sys-color-on-error); 
    border: none; 
    border-radius: 9999px; 
    padding: 0 16px; 
    height: 36px; 
    cursor: pointer; 
    transition: opacity 0.2s ease;
}
.m3-button-error:hover { opacity: 0.9; }

/* ========================================================
   HERO SECTION
   ======================================================== */
.m3-hero { 
    display: flex; 
    align-items: center; 
    gap: 48px; 
    padding: 64px 24px; 
    max-width: var(--header-max-width); 
    margin: 0 auto; 
}

.m3-hero-text, .m3-hero-image { flex: 1; }

.m3-hero-image img { 
    max-width: 100%; 
    border-radius: 16px; 
    object-fit: cover; 
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.m3-hero h1 { 
    font-size: clamp(2.5rem, 5vw, 3.5rem); 
    color: var(--md-sys-color-on-surface); 
    margin: 0 0 16px 0; 
    line-height: 1.15;
}

.m3-hero p { 
    font-size: 1.125rem; 
    color: var(--md-sys-color-on-surface-variant); 
    margin: 0 0 32px 0; 
    line-height: 1.6;
}

.m3-hero.layout-text-right { flex-direction: row-reverse; }

/* ========================================================
   CONTENT BEREICH & M3 KARTEN (Dashboard & Onepages)
   ======================================================== */
.m3-main-content { 
    max-width: var(--header-max-width); 
    margin: 0 auto; 
    padding: 24px; 
}

.m3-cockpit-header { margin-bottom: 32px; }

.m3-cockpit-header h2 { 
    font-size: clamp(2rem, 4vw, 2.5rem); 
    color: var(--md-sys-color-on-surface); 
    margin: 0 0 8px 0; 
}

.m3-cockpit-header p {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 1.1rem;
    margin: 0;
}

.m3-card-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 24px; 
}

.m3-card { 
    background-color: var(--md-sys-color-surface-variant); 
    border-radius: var(--card-border-radius); 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    overflow: hidden; 
    border: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.m3-card:hover {
    background-color: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--md-sys-color-primary-glow);
}

.m3-card-content { padding: 24px; }

.m3-card-content h3 { 
    margin: 0 0 12px 0; 
    color: var(--md-sys-color-on-surface); 
    font-size: 1.25rem;
}

.m3-card-content p {
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
    line-height: 1.5;
}

.m3-link-list { 
    list-style: none; 
    padding: 0; 
    margin: 16px 0 0 0; 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.m3-link-list a { 
    color: var(--md-sys-color-primary); 
    text-decoration: none; 
    font-weight: 500; 
    display: inline-flex; 
    align-items: center; 
    min-height: 48px; /* Wichtig für Touchscreen A16 5G */
}

.m3-link-list a:hover { text-decoration: underline; }

.m3-card-actions { 
    padding: 16px 24px; 
    border-top: 1px solid var(--md-sys-color-surface-variant); 
}

/* ========================================================
   ADMIN FORMS & DETAILS ACCORDIONS
   ======================================================== */
.m3-form-group { margin-bottom: 24px; }

.m3-form-label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 500; 
    color: var(--md-sys-color-on-surface);
}

.m3-form-input { 
    width: 100%; 
    padding: 12px 16px; 
    border: 1px solid var(--md-sys-color-outline); 
    border-radius: 8px; 
    box-sizing: border-box; 
    font-family: inherit;
    font-size: 1rem;
    background-color: transparent;
    color: var(--md-sys-color-on-surface);
    transition: border-color 0.2s, outline 0.2s;
}

.m3-form-input:focus {
    outline: 2px solid var(--md-sys-color-primary);
    border-color: transparent;
}

select.m3-form-input {
    background-color: var(--md-sys-color-surface);
}

/* ========================================================
   FOOTER
   ======================================================== */
.m3-footer { 
    background-color: var(--md-sys-color-surface-variant); 
    color: var(--md-sys-color-on-surface-variant); 
    padding: 64px 24px 24px; 
    border-top: 1px solid var(--md-sys-color-outline); 
    margin-top: 64px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.m3-footer-container { 
    max-width: var(--header-max-width); 
    margin: 0 auto; 
    display: grid; 
    grid-template-columns: 2fr 1fr 1fr; 
    gap: 48px; 
}

.m3-footer-brand p {
    line-height: 1.6;
}

.m3-footer-logo { 
    display: flex; 
    align-items: center; 
    text-decoration: none; 
    color: var(--md-sys-color-on-surface); 
    font-weight: bold; 
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.m3-footer-logo img { width: 40px; margin-right: 12px; }

.m3-footer-column h3 {
    color: var(--md-sys-color-on-surface);
    margin: 0 0 16px 0;
}

.m3-footer-links { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
    display: flex; 
    flex-direction: column; 
}

.m3-footer-links a { 
    text-decoration: none; 
    color: var(--md-sys-color-on-surface-variant); 
    min-height: 48px; 
    display: inline-flex; 
    align-items: center; 
}
.m3-footer-links a:hover { color: var(--md-sys-color-primary); }

.m3-footer-bottom { 
    max-width: var(--header-max-width); 
    margin: 64px auto 0; 
    padding-top: 24px; 
    border-top: 1px solid var(--md-sys-color-outline); 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.m3-footer-legal-links a {
    text-decoration: none;
    color: var(--md-sys-color-on-surface-variant);
    margin-left: 16px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
}
.m3-footer-legal-links a:hover { text-decoration: underline; }

.m3-dashboard-grid-two-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* ========================================================
   MOBILE ANPASSUNGEN (Samsung Galaxy A16 5G)
   ======================================================== */
@media (max-width: 768px) {
    .m3-dashboard-grid-two-col {
        grid-template-columns: 1fr;
    }
    .m3-hero { 
        flex-direction: column-reverse; 
        text-align: center; 
        padding: 32px 24px;
        gap: 24px;
    }
    .m3-footer-container { 
        grid-template-columns: 1fr; 
        gap: 32px;
    }
    .m3-footer-bottom { 
        flex-direction: column; 
        text-align: center; 
    }
    .m3-footer-legal-links a {
        margin: 0 8px;
    }
}