/**
 * Haupt-Stylesheet für Landing Page & Blog
 * =========================================
 * 
 * Dieses Stylesheet enthält alle Styles für:
 * - Landing Page (Hero, Projects, Contact)
 * - Blog-Seiten (Listing, Detail, Admin)
 * - Glassmorphism-Design-System
 * - Light/Dark Mode Theme-Switching
 * - Responsive Design (Mobile-First)
 * - Accessibility-Features
 * - Animations & Transitions
 * 
 * Struktur:
 * 1. Reset & Base Styles
 * 2. CSS Variables (Themes, Colors, Glass)
 * 3. Typography
 * 4. Layout Components
 * 5. Landing Page Components
 * 6. Blog Components
 * 7. Forms & Modals
 * 8. Responsive Breakpoints
 * 
 * Mobile-Optimierungen:
 * - Touch-Targets: Mindestens 44x44px für alle klickbaren Elemente
 * - Performance: will-change für animierte Elemente, transform statt top/left
 * - Reduced Motion: Unterstützung für prefers-reduced-motion
 * 
 * Autor: Jakob Leibel
 * Letzte Aktualisierung: 2025-12-13
 */

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

/**
 * Global Reset
 * Entfernt Standard-Margins/Paddings und setzt Box-Sizing auf border-box.
 * Tap-Highlight auf transparent für bessere Mobile-Erfahrung.
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/**
 * Screen Reader Only
 * Versteckt Elemente visuell, bleibt aber für Screen Reader zugänglich.
 * Wichtig für Accessibility (z.B. Skip-Links, Labels).
 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/**
 * Focus Visibility
 * Zeigt nur bei Tastatur-Navigation einen Focus-Ring (nicht bei Maus).
 * Verbessert Accessibility ohne visuelle Störung bei Maus-Nutzung.
 */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/**
 * HTML Root
 * Scroll-Snap mit 'proximity' für weicheres Snapping.
 * Smooth Scrolling für bessere UX.
 */
html {
    height: 100%;
    scroll-snap-type: y proximity; /* Weicheres Snapping als 'mandatory' */
    scroll-behavior: smooth;
}

/**
 * CSS Variables - Dark Theme (Default)
 * ====================================
 * Alle Design-Tokens für das Dark Theme.
 * Light Theme wird über html[data-theme="light"] überschrieben.
 */
:root {
    /* Browser UI Dark Mode erzwingen (Light Mode wird manuell gesteuert) */
    color-scheme: dark;
    
    /* Brand Colors */
    --primary-color: #818cf8;      /* Indigo 400 */
    --primary-dark: #6366f1;       /* Indigo 500 */
    --accent-dark: #312e81;         /* Indigo 800 */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    
    /* Glass System (Dark Default) */
    --glass-bg: rgba(30, 30, 40, 0.75);
    --glass-bg-navbar: rgba(30, 30, 40, 0.45); /* Transparentere Navbar */
    --glass-bg-hover: rgba(40, 40, 50, 0.65);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-blur: blur(40px);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    /* Spotlight Colors (für Hover-Effekte) */
    --spotlight-color: rgba(129, 140, 248, 0.25);
    --spotlight-grid-color: rgba(129, 140, 248, 0.15);
    
    /* Layout Tokens */
    --radius-l: 28px;      /* Large Radius (Cards) */
    --radius-m: 20px;      /* Medium Radius (Buttons) */
    --radius-s: 12px;      /* Small Radius (Tags) */
    --navbar-radius: 20px;
    --gap: 24px;           /* Standard Grid Gap */
}

/**
 * CSS Variables - Light Theme
 * ===========================
 * Überschreibt Dark Theme Variablen für Light Mode.
 * Aktiviert durch html[data-theme="light"].
 */
html[data-theme="light"] {
    /* Brand Colors (Light) */
    --primary-color: #4f46e5;      /* Kräftigeres Indigo 600 */
    --primary-dark: #4338ca;       /* Indigo 700 */
    --accent-dark: #e0e7ff;         /* Helles Blau für Badges */
    --text-primary: #1e293b;        /* Slate 800 - Weicheres Schwarz */
    --text-secondary: rgba(71, 85, 105, 0.8); /* Slate 600 */
    
    /* Glass System (Light) - Mehr Kontrast für bessere Sichtbarkeit */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-bg-navbar: rgba(255, 255, 255, 0.5); /* Mehr Deckkraft für Navbar */
    --glass-bg-hover: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(99, 102, 241, 0.25);    /* Stärkere Kanten-Definition für Kontrast */
    
    /* Farbige Schatten statt Grau/Schwarz für modernen Look */
    --glass-shadow: 0 12px 40px rgba(79, 70, 229, 0.12), 0 4px 12px rgba(79, 70, 229, 0.05);
    
    /* Spotlight Colors (Light) - Farbiger Nebel statt Licht */
    --spotlight-color: rgba(79, 70, 229, 0.2);      /* Etwas dunkler & mehr Indigo */
    --spotlight-grid-color: rgba(79, 70, 229, 0.12);
}

/**
 * Body Base Styles
 * ================
 * Statischer Hintergrund (keine Animation), Text-Selection deaktiviert
 * für bessere UX (kein versehentliches Selektieren beim Scrollen).
 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    /* Statischer Hintergrund - Dark Theme (schwarz/dunkelgrau) */
    background-color: #0a0a0a;
    /* Gepunkteter Hintergrund - Test */
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    background-attachment: fixed;
    height: 100%;
    overflow-y: scroll;
    /* Text-Selection deaktiviert für bessere UX (kein versehentliches Selektieren) */
    -webkit-user-select: none;
    user-select: none;
    cursor: default;
}

/**
 * Input Fields - Text Selection aktivieren
 * ========================================
 * Text-Selection für Input-Felder wieder aktivieren (benötigt für Formulare).
 */
input, textarea {
    -webkit-user-select: text;
    user-select: text;
    cursor: text;
}

/**
 * Light Mode Background
 * =====================
 * Statisches helles Lila/Blau für Light Theme.
 */
html[data-theme="light"] body {
    background-color: #f0f4ff;
    /* Gepunkteter Hintergrund - Test (dunklere Punkte für Light Mode) */
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    background-attachment: fixed;
}

/**
 * Light Mode - Navbar Link Hover
 * ===============================
 * Spezielle Hover-Styles für Navbar-Links im Light Mode.
 */
html[data-theme="light"] .nav-link:hover {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.05);
}

/**
 * Light Mode - Social Card Hover
 * ==============================
 * Spezielle Hover-Styles für Social-Links im Light Mode.
 */
html[data-theme="light"] .social-link-item:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(99, 102, 241, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

/**
 * Reduced Motion Support - Accessibility
 * ======================================
 * Respektiert prefers-reduced-motion für Nutzer mit Motion-Sensitivität.
 * Deaktiviert Animationen und Transitions fast vollständig.
 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    html {
        scroll-behavior: auto !important;
    }
}

/**
 * Performance-Optimierung für Mobile
 * ===================================
 * will-change für animierte Elemente aktivieren (GPU-Beschleunigung).
 * Wichtig: Nur für Elemente, die tatsächlich animiert werden.
 */
.project-card,
.social-link-item,
.floating-navbar,
.nav-link {
    will-change: transform;
}

/* ============================================================================
   CUSTOM SCROLLBAR
   ============================================================================ */

/**
 * Custom Scrollbar Styling
 * ========================
 * Minimale, transparente Scrollbar für modernes Design.
 */
::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

::-webkit-scrollbar-track {
    background-color: transparent;
    border: none;
    margin: 0;
}

::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.25); /* Etwas dunkler für Sichtbarkeit */
}

html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

/* ============================================================================
   LAYOUT & SECTIONS
   ============================================================================ */

/**
 * Section Styling mit Scroll Snap
 * ================================
 * Alle Sections haben volle Viewport-Höhe für Scroll-Snap.
 * Bottom-Padding berücksichtigt die Floating Navbar.
 */
section.scroll-area {
    min-height: 100vh; /* Immer volle Höhe für Snap */
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 1.5rem calc(4rem + 70px); /* Bottom padding für Navbar */
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    scroll-snap-align: start; /* Snap-Punkt für Scroll-Snap */
    scroll-snap-stop: always;
}

/**
 * Hero Section
 * ===========
 * Zentrierte Hero-Section mit großem Namen-Titel.
 */
.hero {
    align-items: center;
    text-align: center;
}

/**
 * Name Title (Hero)
 * ================
 * Responsiver Text mit einfacher Farbe (kein Gradient).
 */
.name-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin-bottom: 1rem;
}

/**
 * Light Mode - Name Title
 * =======================
 * Dunkle Farbe für Light Theme.
 */
html[data-theme="light"] .name-title {
    color: #1e293b;
}

/* ============================================================================
   SPOTLIGHT EFFECT
   ============================================================================ */

/**
 * Spotlight Effect - Shared Base
 * ===============================
 * Basis-Styling für Spotlight-Effekt (Hover-Licht-Effekt).
 * Position relative für Pseudo-Elemente, unterschiedliche Overflow-Behandlung
 * je nach Element-Typ (Grids brauchen Overflow nicht für Schatten).
 */
.subtitle, .social-link-item, .floating-navbar, .projects-grid, .about-grid {
    position: relative;
}

/**
 * Small Elements - Overflow Hidden
 * ================================
 * Overflow hidden für kleine Elemente, damit Spotlight sauber maskiert wird.
 */
.subtitle, .social-link-item, .floating-navbar {
    overflow: hidden; /* Spotlight-Maskierung */
    z-index: 1;
}

/**
 * Grid Elements - Kein Overflow Hidden
 * ====================================
 * Grids brauchen kein Overflow hidden, damit Schatten sichtbar bleiben.
 */
.projects-grid {
    z-index: 0; 
}

/**
 * Spotlight Pseudo-Element
 * =========================
 * Basis-Pseudo-Element für alle Spotlight-Effekte.
 * Wird per JavaScript mit --mouse-x und --mouse-y positioniert.
 */
.subtitle::before,
.social-link-item::before,
.floating-navbar::before,
.projects-grid::before,
.about-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    pointer-events: none;
}

/**
 * Small Spotlights (80px Radius)
 * ===============================
 * Kleine Spotlight-Effekte für einzelne Elemente (Subtitle, Social Links, Navbar).
 */
.subtitle::before,
.social-link-item::before,
.floating-navbar::before {
    background: radial-gradient(
        80px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        var(--spotlight-color),
        transparent 100%
    );
}

/**
 * Medium Grid Spotlight (120px Radius)
 * ====================================
 * Kleinere Spotlight-Effekte für Grid-Container (Projects, About) - ähnlich Social Links.
 */
.about-grid::before {
    background: radial-gradient(
        120px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        var(--spotlight-color),
        transparent 100%
    );
    z-index: -1;
    border-radius: inherit;
}

.projects-grid::before {
    background: radial-gradient(
        120px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
        var(--spotlight-color), 
        transparent 100%
    );
    z-index: -1;
    border-radius: inherit; /* Radius vom Container übernehmen */
}

/**
 * Spotlight Hover State
 * ====================
 * Spotlight wird bei Hover sichtbar (opacity: 1).
 */
.subtitle:hover::before,
.social-link-item:hover::before,
.floating-navbar:hover::before,
.projects-grid:hover::before,
.about-grid:hover::before {
    opacity: 1;
}

/**
 * Spotlight Border Highlight
 * ==========================
 * Border-Farbe ändert sich bei Hover für visuelles Feedback.
 */
.subtitle:hover {
    border-color: var(--primary-color);
    background: rgba(129, 140, 248, 0.2);
    box-shadow: 0 0 20px rgba(129, 140, 248, 0.2);
}

.social-link-item:hover {
    border-color: var(--primary-color);
}

.floating-navbar:hover {
    border-color: var(--primary-color);
}

/* Subtitle Styles (Rest) */
.subtitle {
    font-size: clamp(1.2rem, 3vw, 2rem);
    font-weight: 400;
    opacity: 0.9;
    padding: 0.5rem 1.5rem;
    /* Lila Akzentfarbe für Software Engineer Feld */
    background: rgba(129, 140, 248, 0.15);
    backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 12px;
    transition: all 0.3s ease;
}

/* Cleanup old subtitle spotlight code block if it exists separately to avoid duplicates... 
   (I am replacing the previous .subtitle block completely with the above shared logic) 
*/

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

/* Mobile Footer (Hidden on Desktop) */
.mobile-footer {
    display: none;
    text-align: center;
    padding: 2rem 0 6rem 0; /* Viel Padding unten für Scroll-Space */
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 5rem; /* Viel Abstand zu Socials damit Navbar Platz hat */
}

.mobile-footer .copyright {
    display: block;
    margin-bottom: 0.5rem;
}

/* Project Card Default (Desktop) Structure adjustments */
.card-header {
    /* Desktop: Normal flow inside card */
    display: block;
    cursor: default;
}

.header-content {
    /* Desktop: Stacked */
    display: block;
}

.toggle-icon {
    display: none; /* Hidden on Desktop */
}

.card-content {
    display: block; /* Visible on Desktop */
    margin-top: 0;
}

/* ============================================================================
   PROJECTS SECTION
   ============================================================================ */

/**
 * Projects Grid
 * =============
 * Responsives Grid-Layout für Projekt-Cards.
 * Auto-fit mit minmax(300px, 1fr) für flexible Spaltenanzahl.
 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap);
    width: 100%;
    border-radius: 32px; /* Radius für Spotlight-Container */
    position: relative;   /* Für Spotlight Pseudo-Element */
    z-index: 0;
}

/**
 * Glass Panel Utility
 * ===================
 * Wiederverwendbare Glassmorphism-Komponente für Cards und Forms.
 * Verwendet CSS Variables für Theme-Konsistenz.
 */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

/**
 * Project Card
 * ============
 * Glassmorphism-Card für Projekte mit subtilem lila Akzent.
 */
.project-card {
    background: rgba(129, 140, 248, 0.08);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: var(--radius-l);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

/**
 * Light Mode - Project Card
 * =========================
 * Mehr Kontrast im Light Theme.
 */
html[data-theme="light"] .project-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

/**
 * Project Card Hover
 * ==================
 * Lift-Effekt bei Hover mit lila Akzent für Design-Konsistenz.
 */
.project-card:hover {
    transform: translateY(-6px);
    background: rgba(129, 140, 248, 0.15);
    border-color: rgba(129, 140, 248, 0.35);
    box-shadow: 0 12px 40px rgba(129, 140, 248, 0.2), var(--glass-shadow);
}

/**
 * Project Icon Container
 * ======================
 * Container für Projekt-Icons/Bilder.
 * Neutraler Hintergrund für transparente PNGs und SVGs.
 */
.project-icon {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.3); /* Dark Mode: Dunkler als Card */
    border-radius: var(--radius-m);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    overflow: hidden;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05); /* Subtile Kante */
}

/**
 * Light Mode - Project Icon
 * =========================
 * Heller Hintergrund für Light Theme.
 */
html[data-theme="light"] .project-icon {
    background: rgba(255, 255, 255, 0.6); /* Helles Grau/Weiß */
    border-color: rgba(0, 0, 0, 0.05);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Changed to contain to respect aspect ratio and padding */
}

.project-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.project-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tech-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/**
 * Project Link
 * ============
 * Link zu Projekt-URL (falls vorhanden).
 * Touch-freundlich mit mindestens 44px Höhe.
 */
.project-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 1rem;
    transition: all 0.3s ease;
    min-height: 44px; /* Touch-Freundlichkeit */
    padding: 0.5rem 0;
}

.project-link:hover {
    color: var(--primary-dark);
    transform: translateX(4px);
}

.project-card-link {
    position: relative;
}

/* ============================================================================
   ABOUT SECTION
   ============================================================================ */

/**
 * About Grid
 * ==========
 * Container für About-Card mit Spotlight-Effekt.
 */
.about-grid {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 850px;
    margin: 2rem auto 0;
    border-radius: 32px;
    position: relative;
    z-index: 0;
}

/**
 * About Card
 * ==========
 * Glassmorphism-Card für About-Section mit Blog-Link.
 * Lila Akzent für Design-Konsistenz.
 */
.about-card {
    background: rgba(129, 140, 248, 0.1);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(129, 140, 248, 0.25);
    border-radius: var(--radius-l);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
    width: 100%;
}

/**
 * Light Mode - About Card
 * =======================
 * Mehr Kontrast im Light Theme.
 */
html[data-theme="light"] .about-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/**
 * About Card Hover
 * ================
 * Lift-Effekt bei Hover mit lila Akzent (wie Subtitle).
 */
.about-card:hover {
    transform: translateY(-4px);
    background: rgba(129, 140, 248, 0.2);
    border-color: rgba(129, 140, 248, 0.4);
    box-shadow: 0 0 30px rgba(129, 140, 248, 0.25);
}

.about-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.about-content {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.about-content p {
    margin-bottom: 1.25rem;
}

.about-content p:last-child {
    margin-bottom: 0;
}

.about-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.about-blog-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.about-blog-link:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-color);
}

/* Mobile: About Card */
@media (max-width: 749px) {
    .about-grid {
        margin-top: 1.5rem;
        padding: 0 1rem;
        max-width: 100%;
    }

    .about-card {
        padding: 1.5rem;
    }

    .about-content {
        font-size: 0.9rem;
    }
}

/* ============================================================================
   BLOG LAYOUT
   ============================================================================ */

/**
 * Blog Page Layout
 * ================
 * Flexbox-Layout mit fixer Navbar oben und Footer unten.
 * Content-Bereich ist scrollbar.
 */
body.blog-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/**
 * Blog Navbar (Top)
 * =================
 * Sticky Navbar am oberen Rand der Blog-Seite.
 */
.blog-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--glass-bg-navbar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.blog-navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.blog-nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-m);
    transition: all 0.3s ease;
}

.blog-nav-link:hover {
    background: var(--glass-bg-hover);
    color: var(--primary-color);
}

.blog-navbar-spacer {
    flex-grow: 1;
}

.blog-theme-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.blog-theme-btn:hover {
    transform: scale(1.1);
    background: var(--glass-bg-hover);
}

html[data-theme="light"] .blog-theme-btn {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(99, 102, 241, 0.2);
}

/**
 * Blog Content Wrapper
 * ===================
 * Scrollbarer Content-Bereich zwischen Navbar und Footer.
 * Custom Scrollbar für besseres Design.
 */
.blog-content-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem 1.5rem;
    /* Custom Scrollbar für Blog-Content */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.blog-content-wrapper::-webkit-scrollbar {
    width: 8px;
}

.blog-content-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.blog-content-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.blog-content-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

html[data-theme="light"] .blog-content-wrapper {
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

html[data-theme="light"] .blog-content-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] .blog-content-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
}

/**
 * Blog Section Layout
 * ===================
 * 3-Spalten-Grid: Sidebar links | Main Content | Sidebar rechts.
 * Sidebars für AdSense-Werbung (nur Desktop).
 */
.blog-section {
    max-width: 1400px;
    margin: 0 auto;
    text-align: left;
    padding-bottom: 2rem;
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: 2rem;
    position: relative;
}

/**
 * Blog Sidebar
 * ============
 * Sticky Sidebar für AdSense-Werbung (links/rechts).
 * Wird auf Mobile ausgeblendet.
 */
.blog-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.blog-sidebar-left {
    grid-column: 1;
}

.blog-sidebar-right {
    grid-column: 3;
}

/**
 * Blog Main Content
 * ================
 * Haupt-Content-Bereich zwischen den Sidebars.
 */
.blog-main-content {
    grid-column: 2;
    min-width: 0; /* Verhindert Grid-Overflow */
}

/**
 * Blog Sidebar Ads
 * ================
 * Glasige AdSense-Container in Sidebars.
 * Unsichtbar bis AdSense geladen.
 */
.blog-sidebar .ads-container {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    margin: 0;
    min-height: 250px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.blog-sidebar .ads-container.loaded {
    opacity: 1;
}

/* Mobile: Sidebars ausblenden */
@media (max-width: 1200px) {
    .blog-section {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        display: none;
    }
    
    .blog-main-content {
        grid-column: 1;
    }
}

/**
 * Blog Welcome Card
 * =================
 * Header-Card mit Willkommensnachricht.
 */
.blog-welcome-card {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    margin-bottom: 0;
}

/* Blog Sidebar Ads Styling */
.blog-sidebar-ads {
    width: 100%;
    margin: 0;
    min-height: 250px;
}

.blog-sidebar-ads.loaded {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.blog-welcome-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

html[data-theme="light"] .blog-welcome-title {
    background: linear-gradient(135deg, #1e293b 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.blog-welcome-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.blog-empty-state {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.blog-empty-state p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.blog-empty-hint {
    font-size: 0.9rem;
    opacity: 0.8;
}

/**
 * Blog Posts Grid
 * ==============
 * Responsives Grid für Blog-Post-Cards.
 */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--gap);
    width: 100%;
}

/**
 * Blog Post Card
 * ==============
 * Glassmorphism-Card für einzelne Blog-Posts in der Übersicht.
 */
.blog-post-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

/**
 * Blog Post Card Hover
 * ====================
 * Lift-Effekt bei Hover.
 */
.blog-post-card:hover {
    transform: translateY(-6px);
    background: var(--glass-bg-hover);
    border-color: rgba(255, 255, 255, 0.3);
}

.blog-post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-m);
    margin-bottom: 1.5rem;
}

.blog-post-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.blog-post-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.blog-post-preview {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.blog-post-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: auto;
}

.blog-post-link:hover {
    color: var(--primary-dark);
    transform: translateX(4px);
}

.blog-loading,
.blog-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    box-shadow: var(--glass-shadow);
}

/**
 * Blog AdSense Container
 * ======================
 * AdSense-Container zwischen Blog-Posts.
 * Unsichtbar bis AdSense geladen.
 */
.blog-ads-container {
    grid-column: 1 / -1;
    margin: 1.5rem 0;
    /* Standardmäßig unsichtbar bis AdSense geladen */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.blog-ads-container.loaded {
    opacity: 1;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* ============================================================================
   BLOG POST DETAIL
   ============================================================================ */

/**
 * Blog Post Detail Layout
 * =======================
 * 3-Spalten-Grid für Detail-Seite: Sidebar links | Content | Sidebar rechts.
 */
.blog-post-detail {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 0;
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    gap: 2rem;
    position: relative;
}

/**
 * Blog Post Sidebar
 * ================
 * Sticky Sidebar für AdSense-Werbung in Post-Details.
 */
.blog-post-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.blog-post-sidebar-left {
    grid-column: 1;
}

.blog-post-sidebar-right {
    grid-column: 3;
}

/* Blog Post Main Content */
.blog-post-main {
    grid-column: 2;
    min-width: 0; /* Verhindert Overflow */
}

/**
 * Blog Post Sidebar Ads
 * =====================
 * Glasige AdSense-Container in Post-Detail-Sidebars.
 */
.blog-post-sidebar .ads-container {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    margin: 0;
    min-height: 250px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.blog-post-sidebar .ads-container.loaded {
    opacity: 1;
}

/* Mobile: Sidebars ausblenden */
@media (max-width: 1200px) {
    .blog-post-detail {
        grid-template-columns: 1fr;
    }
    
    .blog-post-sidebar {
        display: none;
    }
    
    .blog-post-main {
        grid-column: 1;
    }
}

.blog-post-detail-card {
    padding: 0;
    overflow: hidden;
}

.blog-post-detail-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.blog-post-detail-header {
    padding: 2.5rem 2.5rem 1.5rem;
}

.blog-post-detail-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.blog-post-detail-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.blog-post-detail-date,
.blog-post-detail-updated {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.blog-post-detail-content {
    padding: 0 2.5rem 2rem;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.blog-post-detail-content h1,
.blog-post-detail-content h2,
.blog-post-detail-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 700;
}

.blog-post-detail-content h1 {
    font-size: 2rem;
}

.blog-post-detail-content h2 {
    font-size: 1.75rem;
}

.blog-post-detail-content h3 {
    font-size: 1.5rem;
}

.blog-post-detail-content p {
    margin-bottom: 1.25rem;
}

.blog-post-detail-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.blog-post-detail-content a:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-color);
}

.blog-post-detail-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.blog-post-detail-content em {
    font-style: italic;
}

.blog-post-detail-footer {
    padding: 1.5rem 2.5rem;
    border-top: 1px solid var(--glass-border);
    background: var(--glass-bg);
}

.blog-post-back-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    /* Touch-Freundlichkeit: Mindestens 44px Höhe für Touch-Targets */
    min-height: 44px;
    padding: 0.5rem 0;
}

.blog-post-back-link:hover {
    color: var(--primary-dark);
    transform: translateX(-4px);
}

.blog-post-loading,
.blog-post-error {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    box-shadow: var(--glass-shadow);
}

.blog-post-ads {
    margin-top: 2rem;
}

/* Mobile: Blog Post Detail */
@media (max-width: 749px) {
    .blog-post-detail {
        padding: 1rem 0;
    }

    .blog-post-detail-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .blog-post-detail-title {
        font-size: 1.75rem;
    }

    .blog-post-detail-content {
        padding: 0 1.5rem 1.5rem;
        font-size: 1rem;
    }

    .blog-post-detail-footer {
        padding: 1rem 1.5rem;
    }
}

/* Blog Admin Styles */
.blog-admin-container {
    max-width: 800px;
    margin: 0 auto;
}

.blog-admin-form {
    margin-top: 2rem;
}

.blog-admin-form .form-group {
    margin-bottom: 1.5rem;
}

.blog-admin-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.blog-admin-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.blog-admin-form .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.blog-admin-form small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/**
 * Blog Footer
 * ===========
 * Sticky Footer am unteren Rand der Blog-Seite.
 */
.blog-footer {
    position: sticky;
    bottom: 0;
    z-index: 1000;
    background: var(--glass-bg-navbar);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.blog-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

/* Mobile: Blog Layout */
@media (max-width: 749px) {
    body.blog-page {
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height für Mobile */
    }

    .blog-navbar {
        padding: 0.75rem 1rem;
    }

    .blog-navbar-content {
        gap: 0.5rem;
    }

    .blog-nav-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }

    .blog-theme-btn {
        width: 40px;
        height: 40px;
    }

    .blog-content-wrapper {
        padding: 1.5rem 1rem;
    }

    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .blog-post-card {
        padding: 1.5rem;
    }

    .blog-post-image {
        height: 150px;
    }

    .blog-footer {
        padding: 0.75rem 1rem;
    }

    .blog-footer-content {
        font-size: 0.8rem;
        gap: 0.5rem;
        flex-direction: column;
        text-align: center;
    }
}

/* AdSense Container Styling */
.ads-container {
    margin-top: 3rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03); /* Dezent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-l);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    text-align: center;
    min-height: 100px;
    /* Standardmäßig unsichtbar bis AdSense geladen */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Container sichtbar machen nach AdSense-Load */
.ads-container.loaded {
    opacity: 1;
}

/* Nach dem Laden: nur Werbung, kein Container-Rahmen */
.ads-container.loaded {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.ads-container ins {
    display: block;
    margin: 0 auto;
}

.ads-placeholder {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    opacity: 0.9;
    /* Platzhalter ausblenden nach Load */
    display: none;
}

.ads-container.loaded .ads-placeholder {
    display: none;
}

html[data-theme="light"] .tech-tag {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   CONTACT & SOCIALS
   ============================================================================ */

/**
 * Contact Grid
 * ============
 * 2-Spalten-Grid: Contact Form | Social Links.
 */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
    width: 100%;
}

/**
 * Contact Form
 * ============
 * Formular für Kontaktanfragen.
 */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

/**
 * Checkbox Label
 * ==============
 * Styling für Opt-In-Checkbox im Kontaktformular.
 */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
}

.checkbox-label input[type="checkbox"] {
    /* Checkbox komplett verstecken und durch Custom-Design ersetzen */
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

/* Custom Checkbox Box - immer sichtbar */
.checkbox-label input[type="checkbox"] + span::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    margin-right: 0.75rem;
    margin-top: 2px;
    border: 2px solid var(--glass-border);
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
    transition: all 0.2s ease;
}

/* Checked State - Häkchen anzeigen */
.checkbox-label input[type="checkbox"]:checked + span::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px 14px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Hover State */
.checkbox-label:hover input[type="checkbox"] + span::before {
    border-color: var(--primary-color);
    background-color: rgba(129, 140, 248, 0.1);
}

.checkbox-label input[type="checkbox"]:focus-visible + span::before {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Invalid State */
.checkbox-label input[type="checkbox"][aria-invalid="true"] + span::before {
    border-color: #ef4444;
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

.checkbox-label:hover {
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.required-indicator {
    color: var(--primary-color);
    font-weight: 600;
}

.checkbox-label input[type="checkbox"][aria-invalid="true"] {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
    border-color: #ef4444;
}

/* Light Mode Checkbox */
html[data-theme="light"] .checkbox-label input[type="checkbox"] + span::before {
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(99, 102, 241, 0.4);
}

html[data-theme="light"] .checkbox-label input[type="checkbox"]:checked + span::before {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

html[data-theme="light"] .checkbox-label:hover input[type="checkbox"] + span::before {
    background-color: rgba(255, 255, 255, 1);
    border-color: var(--primary-color);
}

.glass-input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-s);
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.glass-input:focus-visible {
    outline: none; /* Custom focus style below */
    box-shadow: 0 0 0 2px var(--primary-color), 0 0 0 4px rgba(129, 140, 248, 0.2);
}

html[data-theme="light"] .glass-input {
    background: rgba(255, 255, 255, 0.5);
}

.glass-input:focus {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.3);
}

.submit-btn {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: var(--radius-s);
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.3s ease;
    opacity: 0.5; /* Visuell deutlich inaktiv */
    pointer-events: none; /* Keine Interaktion */
}

.submit-btn.active {
    background: var(--accent-dark);
    color: white;
    cursor: pointer;
    opacity: 1;
    pointer-events: auto;
}

.submit-btn.active:hover {
    background: #4338ca; /* Etwas heller als accent-dark */
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.form-status,
#dsgvoStatus {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Light Mode Submit Button Override */
/* Default (Disabled) State - OHNE .active Klasse */
html[data-theme="light"] .submit-btn:not(.active) {
    background: rgba(0, 0, 0, 0.06) !important;
    color: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: none !important;
    cursor: not-allowed;
    pointer-events: none; /* Klick verhindern */
    opacity: 0.6;
}

/* Active State - MIT .active Klasse */
html[data-theme="light"] .submit-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3) !important;
    cursor: pointer;
    pointer-events: auto;
}

html[data-theme="light"] .submit-btn.active:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px);
}

/**
 * Social Links Grid
 * =================
 * Linktree-Style Grid für Social-Media-Links.
 */
.social-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2x3 Layout */
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.social-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem; /* Reduced padding */
    /* Touch-Freundlichkeit: Mindestens 44x44px für Touch-Targets */
    min-height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-m);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.social-link-item:hover {
    /* Dezentere Aufhellung */
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.social-link-item .icon-svg {
    width: 28px; /* Slightly smaller icons */
    height: 28px;
    margin-bottom: 0.4rem;
    transition: all 0.3s ease;
}

.social-link-item .label {
    font-size: 0.85rem; /* Slightly smaller text */
}

.social-link-item:hover .icon-svg {
    transform: scale(1.1);
}

/* Impressum Link Light Mode Override */
html[data-theme="light"] .impressum-link:hover {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.05);
}

/* Expandable Navbar */
.floating-navbar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg-navbar); /* Use specific variable */
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1.25rem;
    border-radius: var(--navbar-radius);
    display: flex;
    align-items: center;
    /* WICHTIG: Center für perfekte Mitte im Default State */
    justify-content: center; 
    gap: 0; /* Kein Gap im Default State */
    box-shadow: var(--glass-shadow);
    z-index: 1000;
    width: auto;
    min-width: 350px; /* Etwas breiter für 4 Links */
    max-width: 90vw;
    transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/**
 * Nav Spacer
 * ==========
 * Flex-Spacer für Animation beim Expandieren.
 */
.nav-spacer {
    flex-grow: 0;
    transition: flex-grow 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/**
 * Nav Content
 * ===========
 * Container für Navbar-Links.
 */
.nav-content {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    justify-content: center;
    flex-shrink: 0;
}

/**
 * Nav Footer Content
 * ==================
 * Footer-Content in Navbar (initial versteckt, wird beim Expandieren sichtbar).
 */
.nav-footer-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    max-width: 0;
    padding: 0; 
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    /* Max-width transition für Slide-In */
    transition: 
        max-width 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.4s ease 0.2s; /* Opacity delayed */
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/**
 * Navbar Expanded State
 * =====================
 * Erweiterte Navbar mit Footer-Content sichtbar.
 */
.floating-navbar.expanded {
    width: 95%;
    max-width: 1200px;
    padding: 0.9rem 2.4rem;
    /* Wir ändern justify-content NICHT, sondern nutzen spacer */
}

.floating-navbar.expanded .nav-spacer {
    flex-grow: 1; /* Drückt Content nach links und Footer nach rechts */
}

.floating-navbar.expanded .nav-footer-content {
    opacity: 1;
    max-width: 650px;
    gap: 0.75rem;
    font-size: 0.82rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 12px; /* Kleinerer Radius für Buttons */
    transition: all 0.3s ease;
    font-size: 0.9rem;
    /* Fix für "tanzende" Navbar: Platz für Border reservieren */
    border: 1px solid transparent;
    /* Touch-Freundlichkeit: Mindestens 44px Höhe für Touch-Targets */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.divider {
    opacity: 0.3;
}

.impressum-link {
    color: var(--text-secondary); /* Wie nav-link */
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1.2rem; /* Identisch zu nav-link */
    border-radius: 12px;
    font-size: 0.9rem;
    letter-spacing: normal; /* Reset letter-spacing */
    transition: all 0.3s ease;
    border: 1px solid transparent;
    background: transparent; /* Kein Background im Default */
    cursor: pointer; /* Ensures it looks clickable even as a button */
}

.impressum-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    /* Border bleibt transparent oder optional anpassen */
}

/* ============================================================================
   THEME SWITCHER
   ============================================================================ */

/**
 * Design Switcher
 * ===============
 * Theme-Switcher Button (Bottom Right).
 * Wechselt zwischen Light und Dark Mode.
 */
.design-switcher {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.design-switcher-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(30, 30, 40, 0.25); /* Fixe niedrige Transparenz im Dark Mode */
    backdrop-filter: var(--glass-blur);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glass-shadow);
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.design-switcher-btn:hover {
    transform: scale(1.1);
}

/* Light Mode Theme Switcher Override */
html[data-theme="light"] .design-switcher-btn {
    background: rgba(255, 255, 255, 0.25); /* Fixe niedrige Transparenz im Light Mode */
    border-color: rgba(99, 102, 241, 0.2); /* Angepasst an Light Mode Border */
}

    /* Tablet Optimierungen (750px - 1024px) */
    @media (min-width: 750px) and (max-width: 1024px) {
    /* Standard-Position des Switchers explizit auf Desktop-Level setzen */
    .design-switcher {
        bottom: 2rem; 
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), bottom 0.4s ease; /* Bottom Transition hinzufügen */
    }

    /* 
       Tablet nutzt Desktop-ähnliche Navbar (Erweiterbar), 
       aber der Theme Switcher muss ausweichen, wenn Navbar expandiert.
    */
    .floating-navbar.expanded ~ .design-switcher {
        bottom: 7rem; /* Nach oben schieben auf Mobile-Position */
    }
}

/* Mobile Optimierungen (Smartphones) */
@media (max-width: 749px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Navbar Anpassungen für Mobile */
    .floating-navbar {
        /* Einfache Navbar auf Mobile erzwingen */
        width: auto;
        min-width: auto;
        max-width: 90vw;
        padding: 0.75rem 1.25rem;
        border-radius: var(--navbar-radius);
        justify-content: center;
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); /* Erlaubt Lift-Animation */
    }

    .floating-navbar.expanded {
        /* Expansion-Styles auf Mobile deaktivieren */
        width: auto;
        max-width: 90vw;
        padding: 0.75rem 1.25rem;
        flex-direction: row; /* Reihe beibehalten */
        gap: 0;
        border-radius: var(--navbar-radius);
    }
    
    .floating-navbar .nav-footer-content {
        display: none !important; /* Footer Content in Navbar auf Mobile ausblenden */
    }

    .floating-navbar .nav-spacer {
        display: none;
    }

    .floating-navbar .nav-content {
        width: auto;
        justify-content: center;
        gap: 0.5rem;
    }

    /* Navbar "Lift" Animation (bei Scroll zum Footer) */
    .floating-navbar.lifted {
        transform: translateX(-50%) translateY(-90px); /* Navbar nach oben verschieben */
    }

    /* Switcher auf Mobile - Fixe Position & Sichtbarkeit */
    .design-switcher {
        bottom: 7rem; /* Deutlich über der Navbar (Navbar ist ca 2rem + 60px hoch) */
        right: 1.5rem; 
        z-index: 2000; 
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1); 
    }

    /* Synchrone Lift-Animation für Switcher */
    .design-switcher.lifted {
        transform: translateY(-90px); /* Switcher synchron mit Navbar anheben */
    }

    /**
     * Contact Section Mobile - Padding anpassen
     * ==========================================
     * Das calc(4rem + 70px) Padding von .scroll-area überschreiben.
     * Reduziertes Padding unten, damit Footer näher an Socials ist.
     */
    section.contact-section {
        padding-bottom: 1rem; /* Reduziertes Padding statt calc(4rem + 70px) */
    }

    /**
     * Footer Mobile sichtbar machen
     * =============================
     * Footer mit genug Abstand oben, damit Navbar zwischen Socials und Footer Platz hat.
     * Navbar bleibt unten fixiert, daher brauchen wir genug margin-top.
     */
    .mobile-footer {
        display: block;
        margin-top: 5.5rem; /* Reduziert: Genug Platz für Navbar (ca. 60-70px + etwas Luft) */
        padding-top: 2.15rem;
        padding-bottom: 0; /* Kein Padding unten - verhindert zu viel Scroll-Space */
    }

    /* Projekt-Karten als Akkordeon auf Mobile */
    .projects-grid {
        grid-template-columns: 1fr; /* Einspaltig */
        gap: 1rem;
    }


    .project-card {
        padding: 1rem;
        /* Flex Layout für Header */
        display: flex;
        flex-direction: column;
    }

    .card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        width: 100%;
    }

    .header-content {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .project-icon {
        width: 60px;
        height: 60px;
        padding: 4px;
        margin-bottom: 0; /* Desktop Margin zurücksetzen */
        flex-shrink: 0;
    }
    
    .project-icon svg {
        width: 28px;
        height: 28px;
    }

    .project-title {
        font-size: 1.1rem;
        margin-bottom: 0; /* Desktop Margin zurücksetzen */
    }

    .toggle-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        color: var(--text-secondary);
        transition: transform 0.3s ease;
    }

    /* Akkordeon Logik */
    .card-content {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
        margin-top: 0;
    }

    .project-card.open .card-content {
        max-height: 500px; /* Genug Platz für Content */
        opacity: 1;
        margin-top: 1rem;
    }

    .project-card.open .toggle-icon {
        transform: rotate(180deg);
    }
}

/* ============================================================================
   MODALS
   ============================================================================ */

/**
 * Glass Modal
 * ===========
 * Glassmorphism-Modal für Impressum, Datenschutz, etc.
 * Verwendet native HTML5 <dialog> Element.
 */
dialog.glass-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    box-shadow: var(--glass-shadow);
    color: var(--text-primary);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    padding: 0;
    z-index: 5000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Standard Dialog styles reset */
    margin: 0;
    overflow: hidden;
}

dialog.glass-modal:focus {
    outline: none;
}

dialog.glass-modal::backdrop {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

dialog.glass-modal[open] {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

dialog.glass-modal[open]::backdrop {
    opacity: 1;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Touch-Freundlichkeit: Mindestens 44x44px für Touch-Targets */
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.modal-content {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 80px); /* Header abziehen */
}

.modal-content p, .modal-content ul {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-content h4 {
    margin: 1.5rem 0 0.75rem 0;
    color: var(--text-primary);
}

.modal-content strong {
    color: var(--text-primary);
}

html[data-theme="light"] .close-modal:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}
