/* =============================================================================
   styles.css – Basis-Styles · Fam. Götze Privat
   Strukturelle Basis, Farb-Variablen, Layout, Typografie
   
   3-Layer-Architektur:
   1. styles.css  → Strukturelle Basis (Spacing, Farben, Layout)
   2. theme.css   → Visuelle Identität (Primärfarbe, Glassmorphism, Radius)
   3. Components  → Konkrete Implementierung (Partials, Module)
   
   Ersetzt style.css (konsolidiert 05/2026)
   ============================================================================= */

/* -----------------------------------------------------------------------------
   CSS Custom Properties
   ----------------------------------------------------------------------------- */
:root {
    /* Glassmorphism – Oberflächen */
    --color-background-2:       rgba(255, 255, 255, 0.65);  /* Glassmorphe Elemente */
    --color-background-3:       rgba(255, 255, 255, 0.85);  /* Hover states */
    --color-glass:              rgba(255, 255, 255, 0.12);  /* Login-Karte / dunkle Kontexte */
    --color-glass-hover:        rgba(255, 255, 255, 0.20);
    --color-glass-focus:        rgba(255, 255, 255, 0.22);

    /* Text */
    --color-foreground-1:       #1a1a1a;                    /* Haupt-Text */
    --color-foreground-2:       #5f6368;                    /* Sekundär-Text */
    --color-foreground-inverse: #ffffff;                    /* Text auf dunklem Hintergrund */
    --color-text-muted:         rgba(255, 255, 255, 0.70);  /* Login-Kontext */
    --color-text-faint:         rgba(255, 255, 255, 0.45);  /* Login-Kontext */
    --color-text-label:         rgba(255, 255, 255, 0.75);  /* Login-Kontext */

    /* Rahmen (Light Mode: dunkle Borders für Sichtbarkeit) */
    --color-border:             rgba(0, 0, 0, 0.12);
    --color-border-focus:       rgba(0, 0, 0, 0.25);
    --glass-border:             1px solid rgba(0, 0, 0, 0.15);

    /* Schatten (Light Mode: stärker für bessere Tiefe) */
    --color-shadow:             rgba(0, 0, 0, 0.15);
    --color-shadow-light:       rgba(0, 0, 0, 0.08);

    /* Status-Farben */
    --color-warning:            #ff9500;
    --color-error:              #ff3b30;
    --color-success:            #1a7a3a;
    --color-success-bg:         rgba(52, 168, 83, 0.12);
    --color-success-border:     rgba(52, 168, 83, 0.35);
    --color-success-text:       #fbbf24;        /* Text auf Success-Hintergrund (Toast) */
    --color-danger:             #b93025;
    --color-danger-bg:          rgba(234, 67, 53, 0.10);
    --color-danger-border:      rgba(234, 67, 53, 0.30);
    --color-info:               #38bdf8;        /* Info-Status (Toast) */
    --color-info-text:          #0c2a3a;        /* Text auf Info-Hintergrund */
    --color-primary-subtle:     rgba(0, 113, 227, 0.08);  /* Primärfarbe mit Transparenz */

    /* Blur */
    --blur-strength:            20px;
    --blur:                     blur(20px) saturate(180%);

    /* Layout */
    --footer-height:            46px;
    --header-height:            110px;
    --sidebar-width:            210px;
    
    /* Spacing Scale – Hierarchisches 5-Stufen-System (strukturell) */
    /* Border Radius -> siehe theme.css (visuelles Element) */
    --spacing-xs:               4px;     /* Mini-Abstände (Inline-Elemente) */
    --spacing-sm:               8px;     /* Kleine Abstände (Buttons, Chips) */
    --spacing-md:               12px;    /* Mittlere Abstände (Cards) */
    --spacing-lg:               16px;    /* Große Abstände (Sections) */
    --spacing-xl:               20px;    /* Extra-große Abstände (Page-Padding) */
    --spacing-2xl:              24px;    /* Container-Paddings */
    --spacing-3xl:              32px;    /* Modal-Paddings */
    
    /* Interaktionszustände (Light Mode: dunkle Overlays) */
    --color-hover:              rgba(0, 0, 0, 0.05);
    --color-surface:            rgba(0, 0, 0, 0.02);
    --color-overlay:            rgba(0, 0, 0, 0.45);
}

/* -----------------------------------------------------------------------------
   Dark Mode (automatisch via Betriebssystem)
   ----------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
    :root {
        --color-background-2:       rgba(30, 35, 50, 0.6);
        --color-background-3:       rgba(45, 50, 70, 0.7);
        --color-foreground-1:       #e8eaed;
        --color-foreground-2:       #9aa0a6;
        --color-border:             rgba(255, 255, 255, 0.1);
        --color-shadow:             rgba(0, 0, 0, 0.3);
        --blur-strength:            30px;
        --blur:                     blur(30px) saturate(180%);
        --glass-border:             1px solid rgba(255, 255, 255, 0.1);
        --color-success:            #81c995;
        --color-success-bg:         rgba(52, 168, 83, 0.15);
        --color-success-border:     rgba(52, 168, 83, 0.35);
        --color-danger:             #f28b82;
        --color-danger-bg:          rgba(234, 67, 53, 0.12);
        --color-danger-border:      rgba(234, 67, 53, 0.3);
        --color-primary-subtle:     rgba(0, 113, 227, 0.12);  /* Primärfarbe mit Transparenz (Dark) */
        
        /* Interaktionszustände (Dark Mode) */
        --color-hover:              rgba(255, 255, 255, 0.12);
        --color-surface:            rgba(255, 255, 255, 0.05);
        --color-overlay:            rgba(0, 0, 0, 0.65);
    }
}

/* -----------------------------------------------------------------------------
   Explizite Theme-Übersteuerung via data-theme auf <html>
   ----------------------------------------------------------------------------- */
html[data-theme="light"] {
    --color-background-2:       rgba(255, 255, 255, 0.65);
    --color-background-3:       rgba(255, 255, 255, 0.85);
    --color-foreground-1:       #1a1a1a;
    --color-foreground-2:       #5f6368;
    --color-border:             rgba(0, 0, 0, 0.12);
    --color-border-focus:       rgba(0, 0, 0, 0.25);
    --color-shadow:             rgba(0, 0, 0, 0.15);
    --color-shadow-light:       rgba(0, 0, 0, 0.08);
    --blur-strength:            20px;
    --blur:                     blur(20px) saturate(180%);
    --glass-border:             1px solid rgba(0, 0, 0, 0.15);
    --color-success:            #1a7a3a;
    --color-success-bg:         rgba(52, 168, 83, 0.12);
    --color-success-border:     rgba(52, 168, 83, 0.35);
    --color-danger:             #b93025;
    --color-danger-bg:          rgba(234, 67, 53, 0.10);
    --color-danger-border:      rgba(234, 67, 53, 0.30);
    --color-primary-subtle:     rgba(0, 113, 227, 0.08);  /* Primärfarbe mit Transparenz */
    
    /* Interaktionszustände (Light Mode) */
    --color-hover:              rgba(0, 0, 0, 0.05);
    --color-surface:            rgba(0, 0, 0, 0.02);
    --color-overlay:            rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] {
    --color-background-2:       rgba(30, 35, 50, 0.6);
    --color-background-3:       rgba(45, 50, 70, 0.7);
    --color-foreground-1:       #e8eaed;
    --color-foreground-2:       #9aa0a6;
    --color-border:             rgba(255, 255, 255, 0.1);
    --color-shadow:             rgba(0, 0, 0, 0.3);
    --blur-strength:            30px;
    --blur:                     blur(30px) saturate(180%);
    --glass-border:             1px solid rgba(255, 255, 255, 0.1);
    --color-success:            #81c995;
    --color-success-bg:         rgba(52, 168, 83, 0.15);
    --color-success-border:     rgba(52, 168, 83, 0.35);
    --color-danger:             #f28b82;
    --color-danger-bg:          rgba(234, 67, 53, 0.12);
    --color-danger-border:      rgba(234, 67, 53, 0.3);
    --color-primary-subtle:     rgba(0, 113, 227, 0.12);  /* Primärfarbe mit Transparenz (Dark) */
    
    /* Interaktionszustände (Dark Mode) */
    --color-hover:              rgba(255, 255, 255, 0.12);
    --color-surface:            rgba(255, 255, 255, 0.05);
    --color-overlay:            rgba(0, 0, 0, 0.65);
}

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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(0.875rem, 1vw + 0.5rem, 1rem);
    background: var(--color-background-1);
    background-attachment: fixed;
    color: var(--color-foreground-1);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: var(--color-primary-hover);
}

/* -----------------------------------------------------------------------------
   Fluid Typography – Responsive Schriftgrößen
   ----------------------------------------------------------------------------- */
/* Formel: clamp(MIN, PREFERRED, MAX)
   PREFERRED = calc(BASE_VW + BASE_REM)
   Skaliert automatisch zwischen Viewports 320px-1400px */

h1 {
    font-size: clamp(1.8rem, 4vw + 1rem, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-foreground-1);
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.5rem, 3vw + 0.8rem, 2rem);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-foreground-1);
    margin-bottom: 0.875rem;
}

h3 {
    font-size: clamp(1.3rem, 2.5vw + 0.6rem, 1.75rem);
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-foreground-1);
    margin-bottom: 0.75rem;
}

h4 {
    font-size: clamp(1.1rem, 2vw + 0.5rem, 1.5rem);
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-foreground-1);
    margin-bottom: 0.625rem;
}

h5 {
    font-size: clamp(1rem, 1.5vw + 0.4rem, 1.25rem);
    font-weight: 600;
    line-height: 1.5;
    color: var(--color-foreground-1);
    margin-bottom: 0.5rem;
}

h6 {
    font-size: clamp(0.95rem, 1vw + 0.4rem, 1.1rem);
    font-weight: 600;
    line-height: 1.5;
    color: var(--color-foreground-1);
    margin-bottom: 0.5rem;
}

p {
    color: var(--color-foreground-1);
    line-height: 1.8;
    margin-bottom: 1rem;
}

small, .text-small {
    font-size: clamp(0.75rem, 0.8vw + 0.4rem, 0.875rem);
    line-height: 1.5;
}

/* -----------------------------------------------------------------------------
   Top Navigation
   ----------------------------------------------------------------------------- */
.top-nav {
    background: var(--color-background-2);
    backdrop-filter: blur(var(--blur-strength)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur-strength)) saturate(180%);
    border-bottom: var(--glass-border);
    border-radius: 0;
    padding: 10px 20px;
    position: relative;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 16px var(--color-shadow);
}

/* -----------------------------------------------------------------------------
   Container Layout
   ----------------------------------------------------------------------------- */
.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
    width: 100%;
}

/* -----------------------------------------------------------------------------
   Main Content
   ----------------------------------------------------------------------------- */
main {
    flex: 1;
    padding: 0 0 20px 0;
    background-color: transparent;
    position: relative;
}

.content-area {
    padding-top: 10px;
    margin: 0 30px;
}

/* Glassmorphism-Karten */
.intro-section,
.content-box {
    background: var(--color-background-2);
    backdrop-filter: blur(var(--blur-strength)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur-strength)) saturate(180%);
    border: var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    position: relative;
    box-shadow: 0 8px 32px var(--color-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.intro-section:hover,
.content-box:hover {
    transform: translateY(-5px);
    background: var(--color-background-3);
    box-shadow: 0 12px 48px var(--color-shadow);
}

/* -----------------------------------------------------------------------------
   Typografie (Legacy-Overrides entfernt - siehe Fluid Typography oben)
   ----------------------------------------------------------------------------- */

.content-box ul li strong a,
.content-box ol li strong a {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

.content-box ul li strong a:hover,
.content-box ol li strong a:hover {
    cursor: pointer;
}

.content-box ol,
.content-box ul,
.intro-section ol,
.intro-section ul {
    color: var(--color-foreground-1);
    line-height: 2;
}

.content-box img,
.intro-section img {
    float: right;
    height: 48px;
    width: auto;
    margin-left: 20px;
}

.content-box p.note,
.intro-section p.note {
    margin-top: 15px;
}

.content-box p.info,
.intro-section p.info {
    margin-top: 10px;
}

/* -----------------------------------------------------------------------------
   Download-Button
   ----------------------------------------------------------------------------- */
.download-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: var(--color-primary);
    color: var(--color-foreground-inverse);
    padding: 8px 5px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    margin: 2px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    min-height: 56px;
}

.download-button:hover {
    background-color: var(--color-primary-hover);
    text-decoration: none;
    transform: translateY(-2px);
}

.download-button .os-icon {
    width: 48px;
    height: 48px;
    margin: 5px;
    padding: 0;
    flex-shrink: 0;
    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg);
}

.download-button .button-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex: 1;
}

.download-button .button-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.download-button .button-version {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.85;
    font-style: italic;
}

.download-button .button-icon {
    width: 24px;
    height: 24px;
    margin: 5px;
    margin-left: auto;
    padding: 0;
    flex-shrink: 0;
    filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(0%) hue-rotate(0deg);
}

/* Login-Layout → auth.css */

/* -----------------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------------- */
footer.site-footer {
    height: var(--footer-height);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

footer.site-footer a {
    color: var(--color-text-muted);
}

footer.site-footer a:hover {
    color: var(--color-foreground-inverse);
}

/* -----------------------------------------------------------------------------
   Responsive – Mobile Navigation
   ----------------------------------------------------------------------------- */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }

    .container {
        flex-direction: column;
        padding: 0;
    }

    .sidebar {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 60px !important;
        padding: 0 !important;
        border-right: none !important;
        border-top: var(--glass-border) !important;
        background: var(--color-background-2);
        backdrop-filter: blur(var(--blur-strength)) saturate(180%);
        -webkit-backdrop-filter: blur(var(--blur-strength)) saturate(180%);
        z-index: 1000 !important;
        box-shadow: 0 -4px 16px var(--color-shadow);
    }

    .sidebar.collapsed {
        width: 100% !important;
        height: 60px !important;
        padding: 0 !important;
    }

    .sidebar-content {
        padding: 0 !important;
        height: 100%;
    }

    .sidebar-header {
        display: none !important;
    }

    .nav-menu {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 10px !important;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 8px;
        align-items: center;
    }

    .nav-menu::-webkit-scrollbar {
        display: none;
    }

    .nav-menu > li {
        flex: 0 0 auto !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center;
        min-width: 80px;
    }

    .nav-menu > li > a {
        flex-direction: column !important;
        justify-content: center !important;
        gap: 4px !important;
        padding: 6px 8px !important;
        text-align: center;
        min-height: 50px;
        border-radius: 8px;
        width: 100%;
    }

    .nav-menu .icon {
        width: 22px !important;
        height: 22px !important;
        margin: 0;
        flex-shrink: 0;
    }

    .nav-menu .menu-text {
        display: block !important;
        font-size: 11px;
        font-weight: normal !important;
        white-space: nowrap;
    }

    .nav-menu > li.active > a {
        background-color: var(--color-primary-light) !important;
        font-weight: normal !important;
    }

    .nav-menu > li.active .icon {
        width: 22px !important;
        height: 22px !important;
    }

    main {
        padding: 0 0 20px 0;
        width: 100%;
    }

    .top-nav {
        margin: 0 0 15px 0;
        padding: 8px 15px;
        flex-wrap: wrap;
    }

    .content-area {
        margin: 0 15px;
        padding-top: 5px;
    }

    .intro-section,
    .content-box {
        padding: 20px;
        margin-bottom: 20px;
        border-radius: 12px;
    }

    .content-box img,
    .intro-section img {
        float: none;
        display: block;
        margin: 0 auto 15px auto;
        height: auto;
        max-width: 100%;
    }

    h3 {
        font-size: 18px;
    }
}

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

/* =============================================================================
   Basis-Komponenten (Wiederverwendbar)
   ============================================================================= */

/* --- Card-Komponente ------------------------------------------------------- */
.card {
    background: var(--color-background-2);
    backdrop-filter: blur(var(--blur-strength)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur-strength)) saturate(180%);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px var(--color-shadow);
    padding: var(--spacing-lg);
}

/* Card mit Hover-Effekt */
.card-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--color-shadow);
    border-color: var(--color-primary);
}

/* --- Button-Komponenten ---------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 8px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-foreground-2);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    background: var(--color-hover);
    color: var(--color-foreground-1);
    text-decoration: none;
}

/* Primary Button (gefüllt) */
.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-foreground-inverse);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    color: var(--color-foreground-inverse);
}

/* Danger Button */
.btn-danger {
    background: var(--color-danger-bg);
    border-color: var(--color-danger-border);
    color: var(--color-danger);
}

.btn-danger:hover {
    background: var(--color-danger-border);
    color: var(--color-foreground-inverse);
}

/* Pill Variant (rounded) */
.btn-pill {
    border-radius: var(--radius-pill);
}

/* Icon-Only Button */
.btn-icon {
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
}

/* Active State */
.btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-foreground-inverse);
}

/* --- Page Header ----------------------------------------------------------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.page-headline {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-foreground-1);
    margin: 0;
    white-space: nowrap;
}

.page-headline i {
    color: var(--color-primary);
    margin-right: var(--spacing-sm);
}

/* =============================================================================
   12-Spalten Grid-System
   ============================================================================= */

.grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--spacing-lg);
}

/* Spalten-Klassen */
.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

/* Auto-Fill Grid (responsive, mit CSS-Variable für Mindestbreite) */
.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--grid-min, 240px), 1fr));
    gap: var(--spacing-lg);
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        grid-column: span 12;
    }
}
