/**
 * Beispiel Portal - Zentrale Design-Datei
 * Alle Design-Variablen und Styles für das gesamte Portal
 * Version: 1.0
 */

/* ============================================
   CSS VARIABLES - Design Tokens
   ============================================ */
:root {
    --bg-body: #f0fdf4;
    --bg-gradient: radial-gradient(circle at 30% 20%, #ffffff 0%, #f0fdf4 33%, #dcfce7 66%, #bbf7d0 100%);
    --text-main: #1a1a1a;
    --text-muted: #4a4a4a;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-soft: rgba(255, 255, 255, 0.54);
    --glass-border: rgba(255, 255, 255, 0.85);
    --glass-border-strong: rgba(255, 255, 255, 0.98);
    --glass-blur: 26px;
    --glass-radius: 28px;
    --accent: #22c55e;
    --accent-strong: #16a34a;
    --accent-rgb: 34, 197, 94;
    --accent-strong-rgb: 22, 163, 74;
    --shadow-soft: 0 35px 80px rgba(34, 197, 94, 0.15);
    --shadow-strong: 0 45px 110px rgba(34, 197, 94, 0.2);
    --grain-opacity: 0.18;
    --accent-05: rgba(34, 197, 94, 0.05);
    --accent-08: rgba(34, 197, 94, 0.08);
    --accent-10: rgba(34, 197, 94, 0.1);
    --accent-15: rgba(34, 197, 94, 0.15);
    --accent-18: rgba(34, 197, 94, 0.18);
    --accent-20: rgba(34, 197, 94, 0.2);
    --accent-22: rgba(34, 197, 94, 0.22);
    --accent-25: rgba(34, 197, 94, 0.25);
    --accent-28: rgba(34, 197, 94, 0.28);
    --accent-30: rgba(34, 197, 94, 0.3);
    --accent-35: rgba(34, 197, 94, 0.35);
    --accent-40: rgba(34, 197, 94, 0.4);
    --accent-45: rgba(34, 197, 94, 0.45);
}

/* Dark Theme */
:root[data-theme="dark"] {
    --bg-body: #0a1a0f;
    --bg-gradient: radial-gradient(circle at top, #0f2417 0%, #0a1a0f 55%, #000000 100%);
    --text-main: #dcfce7;
    --text-muted: rgba(220, 252, 231, 0.75);
    --glass-bg: rgba(15, 36, 23, 0.68);
    --glass-bg-soft: rgba(20, 40, 28, 0.4);
    --glass-border: rgba(34, 197, 94, 0.15);
    --glass-border-strong: rgba(34, 197, 94, 0.25);
    --glass-blur: 24px;
    --shadow-soft: 0 30px 60px rgba(34, 197, 94, 0.2);
    --shadow-strong: 0 40px 100px rgba(34, 197, 94, 0.3);
    --accent: #22c55e;
    --accent-strong: #4ade80;
    --accent-rgb: 34, 197, 94;
    --accent-strong-rgb: 74, 222, 128;
    --grain-opacity: 0.35;
    --accent-05: rgba(34, 197, 94, 0.05);
    --accent-08: rgba(34, 197, 94, 0.08);
    --accent-10: rgba(34, 197, 94, 0.1);
    --accent-15: rgba(34, 197, 94, 0.15);
    --accent-18: rgba(34, 197, 94, 0.18);
    --accent-20: rgba(34, 197, 94, 0.2);
    --accent-22: rgba(34, 197, 94, 0.22);
    --accent-25: rgba(34, 197, 94, 0.25);
    --accent-28: rgba(34, 197, 94, 0.28);
    --accent-30: rgba(34, 197, 94, 0.3);
    --accent-35: rgba(34, 197, 94, 0.35);
    --accent-40: rgba(34, 197, 94, 0.4);
    --accent-45: rgba(34, 197, 94, 0.45);
}

/* Dark Mode: Alle schwarzen Texte zu weiß */
[data-theme="dark"] {
    color: var(--text-main);
}

[data-theme="dark"] * {
    color: inherit;
}

/* Light Mode: Überschreibungen für hardcodierte graue/schwarze Farben zu Blau */
:root:not([data-theme="dark"]) [style*="color: #3a3a3a"],
:root:not([data-theme="dark"]) [style*="color:#3a3a3a"],
:root:not([data-theme="dark"]) [style*="color: #2c2c2c"],
:root:not([data-theme="dark"]) [style*="color:#2c2c2c"],
:root:not([data-theme="dark"]) [style*="color: #000"],
:root:not([data-theme="dark"]) [style*="color:#000"],
:root:not([data-theme="dark"]) [style*="color: #000000"],
:root:not([data-theme="dark"]) [style*="color:#000000"],
:root:not([data-theme="dark"]) [style*="color: #1a1a1a"],
:root:not([data-theme="dark"]) [style*="color:#1a1a1a"] {
    color: var(--text-main) !important;
}

:root:not([data-theme="dark"]) [style*="color: #6a6a6a"],
:root:not([data-theme="dark"]) [style*="color:#6a6a6a"],
:root:not([data-theme="dark"]) [style*="color: #8a8a8a"],
:root:not([data-theme="dark"]) [style*="color:#8a8a8a"] {
    color: var(--text-muted) !important;
}

/* Dark Mode: Spezifische Überschreibungen für hardcodierte schwarze Farben */
[data-theme="dark"] [style*="color: #3a3a3a"],
[data-theme="dark"] [style*="color:#3a3a3a"],
[data-theme="dark"] [style*="color: #2c2c2c"],
[data-theme="dark"] [style*="color:#2c2c2c"],
[data-theme="dark"] [style*="color: #000"],
[data-theme="dark"] [style*="color:#000"],
[data-theme="dark"] [style*="color: #000000"],
[data-theme="dark"] [style*="color:#000000"],
[data-theme="dark"] [style*="color: #1a1a1a"],
[data-theme="dark"] [style*="color:#1a1a1a"] {
    color: var(--text-main) !important;
}

[data-theme="dark"] [style*="color: #6a6a6a"],
[data-theme="dark"] [style*="color:#6a6a6a"],
[data-theme="dark"] [style*="color: #8a8a8a"],
[data-theme="dark"] [style*="color:#8a8a8a"] {
    color: var(--text-muted) !important;
}

/* Light Mode: Alle Standard-Elemente verwenden schwarze Textfarbe */
:root:not([data-theme="dark"]) h1,
:root:not([data-theme="dark"]) h2,
:root:not([data-theme="dark"]) h3,
:root:not([data-theme="dark"]) h4,
:root:not([data-theme="dark"]) h5,
:root:not([data-theme="dark"]) h6,
:root:not([data-theme="dark"]) span,
:root:not([data-theme="dark"]) div,
:root:not([data-theme="dark"]) label,
:root:not([data-theme="dark"]) button:not([style*="color"]),
:root:not([data-theme="dark"]) strong,
:root:not([data-theme="dark"]) li {
    color: var(--text-main);
}

:root:not([data-theme="dark"]) p {
    color: var(--text-muted);
}

:root:not([data-theme="dark"]) .text-muted,
:root:not([data-theme="dark"]) [class*="muted"] {
    color: var(--text-muted) !important;
}

/* Dark Mode: Überschreibungen für Elemente mit schwarzer Textfarbe */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div,
[data-theme="dark"] a:not([style*="color"]),
[data-theme="dark"] label,
[data-theme="dark"] button:not([style*="color"]) {
    color: var(--text-main);
}

[data-theme="dark"] .text-muted,
[data-theme="dark"] [class*="muted"] {
    color: var(--text-muted) !important;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    background: var(--bg-gradient);
    background-color: var(--bg-body);
    background-attachment: fixed;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

/* Light Mode: Body und alle Kindelemente verwenden schwarze Textfarbe */
:root:not([data-theme="dark"]) body,
:root:not([data-theme="dark"]) body * {
    color: var(--text-main);
}

:root:not([data-theme="dark"]) body .text-muted,
:root:not([data-theme="dark"]) body [class*="muted"],
:root:not([data-theme="dark"]) body p {
    color: var(--text-muted);
}

/* Background Blobs */
body::before,
body::after {
    content: "";
    position: fixed;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.7;
    z-index: 0;
    pointer-events: none;
    animation: floatBlob 18s ease-in-out infinite alternate;
}

body::before {
    top: -140px;
    left: -60px;
    background: rgba(240, 253, 244, 0.85);
}

body::after {
    bottom: -180px;
    right: -80px;
    background: rgba(220, 252, 231, 0.75);
    animation-delay: 3s;
    width: 460px;
    height: 460px;
    filter: blur(110px);
}

/* Grain Overlay */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="160" height="160"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="160" height="160" filter="url(%23n)" opacity="0.12"/%3E%3C/svg%3E');
    mix-blend-mode: soft-light;
    opacity: var(--grain-opacity);
}

/* Background Canvas */
.background-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.background-canvas .beige-spot {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.75;
    transform: translateZ(0);
}

.background-canvas .beige-spot-one {
    width: 65vw;
    height: 65vw;
    top: -15vw;
    left: -10vw;
    background: rgba(255, 255, 255, 0.95);
}

.background-canvas .beige-spot-two {
    width: 55vw;
    height: 55vw;
    bottom: -20vw;
    right: -10vw;
    background: rgba(220, 252, 231, 0.8);
}

.background-canvas .beige-spot-three {
    width: 35vw;
    height: 35vw;
    top: 25vh;
    right: 15vw;
    background: rgba(240, 253, 244, 0.55);
    filter: blur(110px);
}

/* Page Shell */
.page-shell {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   GLASSMORPHISM COMPONENTS
   ============================================ */
.glass-panel {
    background: var(--glass-bg);
    border-radius: var(--glass-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    position: relative;
    color: var(--text-main);
}

.glass-pane {
    overflow: hidden;
}

.glass-pane .glass-glare {
    position: absolute;
    inset: -40% 15%;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.1) 60%);
    opacity: 0.3;
    transform: rotate(8deg);
    mix-blend-mode: screen;
    pointer-events: none;
    animation: glassSweep 14s linear infinite;
}

@supports (backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px)) {
    .glass-panel,
    .glass-pane,
    .dashboard-header,
    .dashboard-column,
    .card,
    .header-bar {
        backdrop-filter: blur(var(--glass-blur)) saturate(140%);
        -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    }
}

/* ============================================
   HEADER COMPONENTS
   ============================================ */
.header-bar {
    margin: 0 !important;
    width: 100% !important;
    padding: 16px 32px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-radius: 0 !important;
    box-shadow: 0 20px 60px rgba(34, 197, 94, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    border-left: none !important;
    border-right: none !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    background: rgba(255, 255, 255, 0.18) !important;
    margin-bottom: 0 !important;
    padding-bottom: 16px !important;
    border-bottom: none !important;
}

.header-logo {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
    flex-shrink: 0;
}

/* Logo-Text Container */
.header-logo .logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

/* Wenn Breadcrumb innerhalb von header-logo ist, dann horizontal ausrichten (Fallback für alte Struktur) */
.header-logo:has(.header-breadcrumb) {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

/* Breadcrumb außerhalb von header-logo (neue Struktur) */
.header-bar > .header-breadcrumb {
    margin-left: 20px;
    flex: 0 0 auto;
}

.company-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
}

.company-description {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(34, 197, 94, 0.45);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: var(--accent);
}

.theme-toggle:hover {
    border-color: var(--accent-strong);
    background: rgba(255, 255, 255, 0.95);
}

/* Dark Mode Header Bar */
[data-theme="dark"] .header-bar {
    background: rgba(10, 30, 15, 0.6);
    border-color: rgba(34, 197, 94, 0.15);
    box-shadow: 0 18px 40px rgba(34, 197, 94, 0.2);
}

/* Dashboard Header - Full Width */
.dashboard-header {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    background: rgba(255, 255, 255, 0.32);
    padding: 40px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    margin-bottom: 30px;
    box-shadow: 0 40px 80px rgba(34, 197, 94, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
}

.dashboard-header::before,
.dashboard-header::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.6;
    pointer-events: none;
}

.dashboard-header::before {
    width: 240px;
    height: 240px;
    top: -120px;
    right: -20px;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 65%);
}

.dashboard-header::after {
    width: 180px;
    height: 180px;
    bottom: -90px;
    left: -30px;
    background: radial-gradient(circle, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0) 60%);
}

/* ============================================
   AUTH COMPONENTS
   ============================================ */
.auth-shell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 30px;
}

.auth-card {
    width: min(460px, 100%);
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    box-shadow: var(--shadow-strong);
}

.auth-card-header {
    text-align: center;
}

.auth-card-header .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.08);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

.auth-card-header h1 {
    margin: 18px 0 8px;
    font-size: 2rem;
    color: var(--text-main);
}

.auth-card-header p {
    margin: 0;
    color: var(--text-muted);
}

.auth-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 20px;
    line-height: 1.6;
}

.auth-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    margin: 0 10px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   FORM COMPONENTS
   ============================================ */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    background: rgba(255, 255, 255, 1);
}

.form-input::placeholder {
    color: rgba(106, 106, 106, 0.7);
}

/* ============================================
   BUTTON COMPONENTS
   ============================================ */
.btn-login {
    width: 100%;
    padding: 15px 22px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    box-shadow: 0 12px 30px rgba(34, 197, 94, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(34, 197, 94, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

/* ============================================
   ALERT COMPONENTS
   ============================================ */
.errors,
.timeout-notice {
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.errors {
    border-color: rgba(220, 53, 69, 0.3);
    background: rgba(255, 235, 238, 0.95);
    color: #b02a37;
}

.errors ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.errors li {
    margin-bottom: 4px;
}

.timeout-notice {
    border-color: rgba(255, 193, 7, 0.25);
    background: rgba(255, 248, 225, 0.9);
    color: #856404;
}

.request {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 0.92rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.request:hover {
    color: var(--accent-strong);
    text-decoration: underline;
}

/* ============================================
   CARD COMPONENTS
   ============================================ */
.card {
    background: var(--glass-bg);
    border-radius: var(--glass-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    position: relative;
    color: var(--text-main);
}

.dashboard-column {
    background: var(--glass-bg);
    border-radius: var(--glass-radius);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    padding: 24px;
    margin-bottom: 24px;
}

/* Dashboard Content - Full Width */
.dashboard-content {
    width: 100%;
    max-width: 100%;
    padding: 0 60px 40px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes floatBlob {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(30px, -20px, 0) scale(1.08);
    }
}

@keyframes glassSweep {
    0% {
        transform: translateX(-120%) rotate(8deg);
        opacity: 0;
    }
    25% {
        opacity: 0.35;
    }
    75% {
        opacity: 0.2;
    }
    100% {
        transform: translateX(120%) rotate(8deg);
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .header-bar {
        flex-direction: column;
        gap: 12px;
        border-radius: 24px;
        padding: 20px;
    }

    .auth-card {
        padding: 34px 24px;
    }

    body::before,
    body::after {
        width: 360px;
        height: 360px;
    }

    .dashboard-header {
        padding: 24px 20px;
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .dashboard-content {
        padding: 0 20px 30px;
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 100%;
    }
}

