/* Font Imports */
@font-face {
    font-family: 'GOODTIME';
    src: url('../fonts/GOODTIME.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Good Times Heavy';
    src: url('../fonts/Good Times W00 Heavy.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

/* Roboto (Fliesstext) wird in templates/base.html per <link> geladen –
   ein @import an dieser Stelle (nach @font-face) wuerde ignoriert. */

/* CSS Variables */
:root[data-theme="dark"] {
    --bg-primary: #040008;
    --bg-secondary: #040008;
    --bg-card: rgba(4, 0, 8, 0.9);
    --bg-card-light: rgba(4, 0, 8, 0.8);
    --bg-hover: rgba(164, 164, 164, 0.1);
    --text-primary: #FEFEFF;
    --text-secondary: #A4A4A4;
    --text-muted: #A4A4A4;
    --accent: #E42C0C;
    --accent-rgb: 228, 44, 12;
    --accent-hover: rgba(228, 44, 12, 0.8);
    --accent-secondary: #E42C0C;
    --accent-glow: rgba(228, 44, 12, 0.5);
    --accent-glow-strong: rgba(228, 44, 12, 0.8);
    --border: #A4A4A4;
    --shadow: rgba(4, 0, 8, 0.9);
    --shadow-strong: rgba(4, 0, 8, 0.7);
    --gradient-start: #040008;
    --gradient-end: #040008;
    --gradient-accent: linear-gradient(135deg, var(--accent), var(--accent-hover));
    --success-color: #A4A4A4;
    --success-glow: rgba(164, 164, 164, 0.5);
    --warning-color: #E42C0C;
    --warning-glow: rgba(228, 44, 12, 0.5);
}

:root[data-theme="light"] {
    --bg-primary: #FEFEFF;
    --bg-secondary: #FEFEFF;
    --bg-card: #FEFEFF;
    --bg-card-light: #FEFEFF;
    --bg-hover: rgba(164, 164, 164, 0.1);
    --text-primary: #040008;
    /* Dunkler als das fruehere #A4A4A4, damit der Kontrast auf hellem Hintergrund
       WCAG AA (>= 4.5:1) erfuellt. */
    --text-secondary: #5A5A5A;
    --text-muted: #6B6B6B;
    /* Minimal dunkler als die #E42C0C des Dark-Themes: auf hellem Grund kam
       der Originalton nur auf 4.47:1 und verfehlte WCAG AA (>= 4.5) knapp –
       sowohl als Textfarbe als auch mit weisser Schrift auf Akzentflaechen.
       #E02A0B liegt bei 4.62 bzw. 4.66 und ist optisch nicht unterscheidbar. */
    --accent: #E02A0B;
    --accent-rgb: 224, 42, 11;
    /* Im Dark-Theme ist das ein transparentes Rot, das ueber dem dunklen Grund
       nachdunkelt. Ueber hellem Grund passiert das Gegenteil: es hellt zu
       rgb(230,84,60) auf, und weisse Schrift auf dem hellen Ende des
       Akzent-Verlaufs kommt nur noch auf 3.68:1. Deshalb hier deckend. */
    --accent-hover: #C9260A;
    --accent-secondary: #E02A0B;
    --accent-glow: rgba(228, 44, 12, 0.3);
    --accent-glow-strong: rgba(228, 44, 12, 0.6);
    --border: #A4A4A4;
    --shadow: rgba(4, 0, 8, 0.15);
    --shadow-strong: rgba(4, 0, 8, 0.25);
    --gradient-start: #FEFEFF;
    --gradient-end: #FEFEFF;
    --gradient-accent: linear-gradient(135deg, var(--accent), var(--accent-hover));
    --success-color: #A4A4A4;
    --success-glow: rgba(164, 164, 164, 0.3);
    --warning-color: #E42C0C;
    --warning-glow: rgba(228, 44, 12, 0.3);
}

/* Bootstrap-Defaults auf die Markenfarbe (Orange-Rot) umbiegen –
   ersetzt das blaue Bootstrap-Primary/Link/Focus überall. */
:root {
    /* Verlauf ueber den Hintergrundbildern der Sambal-Kacheln (Startseite und
       Uebersicht). Bewusst eigene Werte statt --shadow: das ist die Farbe fuer
       Schlagschatten und liegt im Darkmode bei 90 % Deckkraft – als Bild-
       ueberlagerung verschluckt sie das Motiv fast vollstaendig.
       Absichtlich hier im gemeinsamen :root und nicht in den Theme-Bloecken:
       die Werte sind in beiden Themes gleich, und waeren sie nur in einem
       definiert, verwuerfe der Browser im anderen die komplette
       background-image-Angabe – samt Bild-URL. */
    --card-scrim-top: rgba(0, 0, 0, 0.3);
    --card-scrim-bottom: rgba(0, 0, 0, 0.6);
    /* An die Theme-Variable haengen, sonst wuerde im Light-Theme weiterhin der
       hellere Dark-Ton greifen und den Kontrast wieder unter AA druecken. */
    --bs-primary: var(--accent);
    --bs-primary-rgb: var(--accent-rgb);
    --bs-link-color: var(--accent);
    --bs-link-color-rgb: var(--accent-rgb);
    --bs-link-hover-color: #b81f06;
    --bs-link-hover-color-rgb: 184, 31, 6;
    --bs-focus-ring-color: rgba(var(--accent-rgb), 0.35);
    /* Bootstrap setzt auf .card ein `color: var(--bs-body-color)` – das ist
       per Default #212529 (Dunkelgrau) und damit im Darkmode auf der dunklen
       Karte praktisch unlesbar. Betroffen ist jeder Text in einer Karte, der
       keine eigene Farbklasse hat (z.B. die h3 in Impressum/Datenschutz).
       Auf die Themefarbe umbiegen, dann stimmt es in beiden Themes. */
    --bs-body-color: var(--text-primary);
    --bs-emphasis-color: var(--text-primary);
    --bs-secondary-color: var(--text-secondary);
}

/* Markenakzent-Farbe. War bisher nur im extra_css der Startseite definiert und
   damit auf allen anderen Seiten wirkungslos, obwohl 7 Templates sie nutzen. */
.text-accent {
    color: var(--accent) !important;
}

/* Generische Inhaltslinks: Markenfarbe statt Bootstrap-Blau.
   Navbar-/Footer-/Button-Links haben spezifischere Regeln und bleiben unberührt. */
a {
    color: var(--accent);
}

a:hover {
    color: var(--accent-hover);
}

/* Bootstrap-Utilities, die sonst blau wären */
.btn-link {
    color: var(--accent);
}

/* Bootstrap-Buttons: Die .btn-*-Varianten haben ihre Farben als eigene
   --bs-btn-*-Variablen fest verdrahtet (das blaue #0d6efd fuer Hover/Active,
   #3184fd fuer den Focus-Ring) und lesen --bs-primary NICHT. Ohne diese
   Overrides faerbt `.btn:hover { background-color: var(--bs-btn-hover-bg) }`
   den Button blau ein und ueberdeckt dabei das rote ::before-Gradient. */
.btn {
    --bs-btn-focus-shadow-rgb: 228, 44, 12;
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--accent-hover);
    --bs-btn-hover-border-color: var(--accent-secondary);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--accent-hover);
    --bs-btn-active-border-color: var(--accent-secondary);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
    --bs-btn-focus-shadow-rgb: 228, 44, 12;
}

.btn-outline-primary {
    --bs-btn-color: var(--accent);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--accent);
    --bs-btn-hover-border-color: var(--accent-secondary);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--accent);
    --bs-btn-active-border-color: var(--accent-secondary);
    --bs-btn-disabled-color: var(--accent);
    --bs-btn-disabled-border-color: var(--accent);
    --bs-btn-focus-shadow-rgb: 228, 44, 12;
}

/* Neutrale Zweit-Buttons (z.B. "Website"/"Schliessen" auf /kaufen/) auf das
   Grau der Palette statt Bootstrap-Grau. */
.btn-outline-secondary {
    --bs-btn-color: var(--text-secondary);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--border);
    --bs-btn-hover-color: var(--bg-primary);
    --bs-btn-hover-bg: var(--border);
    --bs-btn-hover-border-color: var(--border);
    --bs-btn-active-color: var(--bg-primary);
    --bs-btn-active-bg: var(--border);
    --bs-btn-active-border-color: var(--border);
    --bs-btn-focus-shadow-rgb: 164, 164, 164;
}

.btn-link {
    --bs-btn-color: var(--accent);
    --bs-btn-hover-color: var(--accent-hover);
    --bs-btn-active-color: var(--accent-hover);
    --bs-btn-focus-shadow-rgb: 228, 44, 12;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
}

/* Typography */
h1 {
    font-family: 'Good Times Heavy', 'GOODTIME', sans-serif;
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-size: clamp(2.5rem, 6vw, 4rem);
    text-transform: uppercase;
}

/* Brand-specific text colors */
.text-primary {
    color: var(--accent) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

/* Improved badge contrast for dark theme */
.badge.bg-secondary {
    background-color: var(--bg-card-light) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border);
}

/* Better placeholder backgrounds */
.bg-secondary {
    background-color: var(--bg-card-light) !important;
    color: var(--text-secondary) !important;
}

h2 {
    font-family: 'Good Times Heavy', 'GOODTIME', sans-serif;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    font-size: clamp(2rem, 4.5vw, 3rem);
    text-transform: uppercase;
}

h3, h4, h5, h6 {
    font-family: 'GOODTIME', sans-serif;
    font-weight: normal;
    letter-spacing: 0.05em;
    line-height: 1.3;
    margin-bottom: 1rem;
}

/* Letzte Sicherung: lieber ein unschoener Wortumbruch als abgeschnittener
   Text. Die Display-Schriften sind sehr breit laufend, einzelne Komposita
   passen sonst auf schmalen Geraeten nicht in ihren Container. */
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* Titel mit .js-fit-word (z.B. Marktnamen) werden stattdessen von
   static/js/fit-text.js verkleinert, bis sie passen. Dazu muss der Ueberlauf
   messbar bleiben (kein break-word), und in Flex-Zeilen darf das Element
   schmaler werden als sein Inhalt (min-width: 0). */
.js-fit-word {
    overflow-wrap: normal;
    word-break: normal;
    min-width: 0;
}

h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h5 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
h6 { font-size: clamp(1rem, 1.5vw, 1.25rem); }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Navbar Styles */
.navbar {
    /* Die Leiste ist in beiden Themes dunkel. Bei 0.85 schlug im Light-Theme
       aber der weisse Seitenhintergrund durch (ergab rgb(51,51,51)) und der
       Akzent-Schriftzug fiel auf 2.72:1. Mit 0.92 bleibt der Glaseffekt
       erhalten und der Kontrast stimmt in beiden Themes. */
    background: rgba(15, 15, 15, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 45, 45, 0.2);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(25px);
    border-bottom-color: var(--accent);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 0.75rem 0;
}

.navbar-brand {
    font-family: 'GOODTIME', sans-serif;
    color: var(--accent) !important;
    font-size: 1.6rem;
    font-weight: normal;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    text-shadow: 0 0 20px var(--accent-glow);
}

.navbar-brand:hover {
    transform: scale(1.05);
    text-shadow: 0 0 30px var(--accent-glow);
}

.navbar-nav .nav-link {
    color: var(--text-primary) !important;
    font-family: 'GOODTIME', sans-serif;
    font-weight: normal;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0 0.75rem;
    position: relative;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    padding: 0.75rem 0 !important;
    min-height: 44px; /* Touch target minimum */
    display: flex;
    align-items: center;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
    width: 100%;
}

.navbar-nav .nav-link:hover {
    color: var(--accent) !important;
    transform: translateY(-2px);
}

/* Navbar bleibt in beiden Themes dunkel – Links weiss, Marke im Akzent
   (konsistent mit dem Dark-Mode, behebt die Hell/Dunkel-Unstimmigkeit). */
[data-theme="light"] .navbar-nav .nav-link {
    color: #ffffff !important;
}

[data-theme="light"] .navbar-brand {
    color: var(--accent) !important;
}

/* Mobile Menu Hamburger Styles */
.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    padding: 0.25rem 0.5rem;
    transition: all 0.3s ease;
}

.navbar-toggler:hover {
    border-color: var(--accent) !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Mobile Menu Dropdown Styles */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(15, 15, 15, 0.95);
        backdrop-filter: blur(20px);
        margin-top: 0.5rem;
        padding: 0.75rem;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .navbar-nav .nav-link {
        padding: 0.4rem 0 !important;
        margin: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 0.9rem;
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    .navbar-nav .nav-item:last-child {
        margin-top: 0.5rem;
        margin-left: 0 !important; /* ms-3 (Desktop-Abstand) im Stack-Menue zuruecksetzen */
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Button Styles */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.9rem;
    min-height: 44px; /* Touch target minimum */
    min-width: 44px;
}

.btn-primary {
    background: var(--gradient-accent);
    border: none;
    color: white;
    font-family: 'GOODTIME', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 8px 25px var(--accent-glow), 0 0 0 1px var(--accent);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px var(--accent-glow-strong), 0 0 0 2px var(--accent-secondary);
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-secondary));
}

.btn-outline-primary {
    border: 2px solid var(--accent);
    color: var(--accent);
    background: transparent;
    font-family: 'GOODTIME', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    overflow: hidden;
}

.btn-outline-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    transition: left 0.4s ease;
    z-index: -1;
}

.btn-outline-primary:hover::before {
    left: 0;
}

.btn-outline-primary:hover {
    color: white;
    border-color: var(--accent-secondary);
    box-shadow: 0 8px 25px var(--accent-glow);
    transform: translateY(-3px) scale(1.02);
}

/* Card Styles */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-12px) scale(1.03) rotateY(2deg);
    box-shadow: 0 25px 50px var(--shadow-strong), 0 0 0 2px var(--accent);
    border-color: var(--accent);
}

.card-img-top {
    height: 250px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover .card-img-top {
    transform: scale(1.1);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-family: 'Roboto', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

/* ===== Instagram-Feed (Startseite) =====
   Markup in templates/core/home.html; Bilder kommen aus dem DB-Cache
   (core/instagram.py) und sind max. 640px, daher object-fit: cover. */
.instagram-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.instagram-tile:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 15px 35px var(--shadow-strong), 0 0 20px var(--accent-glow);
}

.instagram-tile-media {
    position: relative;
    display: block;
    /* Quadratisch wie auf Instagram – egal welches Format das Original hat */
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.instagram-tile-media img,
.instagram-tile-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.instagram-tile:hover .instagram-tile-media img,
.instagram-tile:hover .instagram-tile-media video {
    transform: scale(1.07);
}

/* Play-Badge markiert Video-Kacheln, solange das Video nicht laeuft */
.instagram-tile-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 1;
    color: #fff;
    font-size: 0.95rem;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.instagram-tile-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.instagram-tile:hover .instagram-tile-overlay {
    opacity: 1;
}

.instagram-tile-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.85rem 1rem 1rem;
}

.instagram-tile-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.instagram-tile-meta .fa-instagram {
    color: var(--accent);
    font-size: 1rem;
}

.instagram-tile-date {
    margin-left: auto;
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.instagram-tile-caption {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.45;
    /* Lange Bildunterschriften auf zwei Zeilen kappen – der ganze Text
       steht ja einen Klick entfernt auf Instagram */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 576px) {
    .instagram-tile-body {
        padding: 0.6rem 0.75rem 0.75rem;
    }

    .instagram-tile-caption {
        font-size: 0.78rem;
    }
}

/* Fallback-Karte, wenn keine gecachten Beitraege vorliegen */
.instagram-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.instagram-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 15px 35px var(--shadow-strong), 0 0 20px var(--accent-glow);
}

.instagram-card-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.instagram-card-handle {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.instagram-card-text {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Hero Section with Video Background */
.hero-section {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
}

/* Invert video colors only in light mode */
[data-theme="light"] .hero-video-bg {
    filter: invert(1);
}

@keyframes slowMotion {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.4) 50%,
        rgba(0, 0, 0, 0.6) 100%
    );
    z-index: 2;
}

.hero-section .container {
    position: relative;
    z-index: 3;
}

/* Hero Logo Animation */
.hero-logo-container {
    text-align: center;
}

.hero-logo {
    max-width: 780px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 0 30px var(--accent-glow));
    transition: filter 0.3s ease;
    animation: heroLogoFadeIn 3s ease-out;
    margin-bottom: 2rem;
    transform-origin: center;
}

@keyframes heroLogoFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.6);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes heroLogoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}


.hero-subtitle {
    font-family: 'Roboto', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 3.2s;
    animation-fill-mode: both;
    font-style: italic;
    text-shadow: 
        1px 1px 3px rgba(0, 0, 0, 0.8),
        0 0 15px rgba(0, 0, 0, 0.7);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Heat Indicator */
.heat-indicator {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px var(--accent-glow));
    animation: flicker 2s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Form Styles */
.form-control, .form-select {
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    background: var(--bg-hover);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

/* Theme Toggle */
#theme-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1.2rem;
    min-height: 44px; /* Touch target minimum */
    min-width: 44px;
}

#theme-toggle:hover {
    transform: rotate(180deg);
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Footer */
.footer {
    background: linear-gradient(to bottom, var(--bg-primary), var(--bg-secondary));
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 5rem;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Badge Styles */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.badge.bg-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.badge.bg-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.3);
}

/* Alert Styles */
.alert {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 2rem;
    font-family: 'GOODTIME', sans-serif;
    font-weight: normal;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    opacity: 0.8;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
    text-decoration: none;
    font-family: 'GOODTIME', sans-serif;
    font-weight: normal;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.breadcrumb-item a:hover {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-family: 'GOODTIME', sans-serif;
    font-weight: normal;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .hero-section {
        height: 100vh;
        min-height: 600px;
        padding: 10px 15px;
    }
    
    .hero-section .container {
        padding-top: 42px; /* 30% less than 60px */
        padding-bottom: 30px;
    }
    
    .hero-video-bg {
        object-position: center center;
    }
    
    .hero-overlay {
        background: linear-gradient(
            45deg,
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.6) 50%,
            rgba(0, 0, 0, 0.7) 100%
        );
    }
    
    .hero-logo {
        max-width: 640px;
        width: 85%;
        margin-bottom: 1rem;
    }
    
    .navbar-nav {
        text-align: center;
        padding: 1rem 0;
    }
    
    .navbar-nav .nav-link {
        margin: 0.5rem 0;
    }
    
    .navbar-logo {
        height: 30px;
    }
    
    
    /* Hero buttons mobile optimization */
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem !important;
        width: 100%;
        padding: 0 15px;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.3rem) !important;
        margin-bottom: 1.5rem !important;
        padding: 0 20px;
    }
    
    /* Feste Groessen liessen lange Woerter in der breiten Display-Schrift aus
       dem Container laufen (z.B. "Markttermine" bei 360px, "Handwerkskunst"
       bei 320px). body{overflow-x:hidden} hat den Ueberlauf nur kaschiert –
       der Text wurde abgeschnitten. Unten fluid, bei 768px identisch wie zuvor. */
    h1 { font-size: clamp(1.5rem, 7vw, 2rem); }
    h2 { font-size: clamp(1.25rem, 5.5vw, 1.5rem); }
    
    .card {
        margin-bottom: 1.5rem;
    }
    
    /* Better card spacing on mobile */
    .row.g-4 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1.5rem;
    }
    
    .col-lg-4, .col-md-6 {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Mobile optimizations for smaller screens */
@media (max-width: 480px) {
    .hero-section {
        height: 100vh;
        min-height: 568px;
        padding: 10px;
    }
    
    .hero-section .container {
        padding-top: 35px; /* 30% less than 50px */
        padding-bottom: 25px;
    }
    
    .hero-overlay {
        background: rgba(0, 0, 0, 0.75);
    }
    
    .hero-logo {
        max-width: 520px;
        width: 80%;
        margin-bottom: 0.75rem;
    }
    
    .navbar-logo {
        height: 28px;
    }
    
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    
    .hero-subtitle {
        font-size: clamp(0.9rem, 2.5vw, 1.1rem) !important;
        margin-bottom: 1.25rem !important;
    }
    
    .hero-buttons .btn {
        max-width: 260px;
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    /* Improved card spacing for small screens */
    .row.g-4 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 1.25rem;
    }
    
    .col-lg-4, .col-md-6 {
        padding-left: 0.375rem;
        padding-right: 0.375rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
}

/* iPhone SE, 8, etc. */
@media (max-width: 375px) {
    .navbar-logo {
        height: 25px;
    }
    
    .hero-section .container {
        padding-top: 28px; /* 30% less than 40px */
        padding-bottom: 20px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .hero-logo {
        max-width: 480px;
        width: 75%;
        margin-bottom: 0.5rem;
    }
    
    
    .hero-subtitle {
        font-size: clamp(0.85rem, 2.3vw, 1rem) !important;
    }
    
    .hero-buttons {
        gap: 0.6rem !important;
    }
    
    .hero-buttons .btn {
        max-width: 240px;
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Even tighter card spacing */
    .row.g-4 {
        --bs-gutter-x: 0.5rem;
        --bs-gutter-y: 1rem;
    }
    
    .col-lg-4, .col-md-6 {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Extra small screens */
@media (max-width: 320px) {
    .navbar-logo {
        height: 22px;
    }
    
    .hero-section .container {
        padding-top: 21px; /* 30% less than 30px */
        padding-bottom: 18px;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .hero-logo {
        max-width: 440px;
        width: 70%;
        margin-bottom: 0.5rem;
    }
    
    
    .hero-subtitle {
        font-size: clamp(0.75rem, 2vw, 0.9rem) !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-buttons .btn {
        max-width: 240px;
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    /* Minimal card spacing for very small screens */
    .card-body {
        padding: 0.75rem;
    }
    
    .card-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .card-text {
        font-size: 0.9rem;
    }
}

/* Reduce padding on sambal section for mobile */
@media (max-width: 768px) {
    .sambal-section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
}

@media (max-width: 480px) {
    .sambal-section {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
}

@media (max-width: 375px) {
    .sambal-section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    background: linear-gradient(
        90deg,
        var(--bg-card) 0%,
        var(--bg-hover) 50%,
        var(--bg-card) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Special Effects */
.glow-text {
    text-shadow: 0 0 20px var(--accent-glow);
    filter: drop-shadow(0 0 20px var(--accent-glow));
    -webkit-filter: drop-shadow(0 0 20px var(--accent-glow));
}

.bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Video Intro Animation Styles */
.video-intro-container {
    position: fixed;
    top: 0;
    left: 0;
    /* 100% statt 100vw: 100vw enthaelt die Scrollbar-Breite und erzeugt auf
       Mobile sonst horizontales Scrollen. */
    width: 100%;
    height: 100vh;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    overflow: hidden;
    transition: opacity 1.5s ease-out; /* Verlängert von 1s auf 1.5s */
}

.video-intro-container.fade-out {
    opacity: 0;
    pointer-events: none;
}

#intro-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 768px) {
    #intro-video {
        object-fit: cover;
        transform: scale(1.1);
        background: #000;
    }
}

@media (max-width: 480px) {
    #intro-video {
        transform: scale(1.2);
    }
}

@media (max-width: 375px) {
    #intro-video {
        transform: scale(1.3);
    }
}

.intro-logo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 20px;
}

.intro-logo {
    max-width: 780px; /* Same as hero-logo */
    width: auto;
    height: auto;
    opacity: 0;
    transform: scale(0.1);
    transition: all 2.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 30px rgba(255, 45, 45, 1)) 
            drop-shadow(0 0 60px rgba(255, 45, 45, 0.8)) 
            drop-shadow(0 0 90px rgba(255, 45, 45, 0.6));
}

.intro-logo.animate {
    opacity: 1;
    transform: scale(1); /* Full size matching hero-logo */
}

.intro-logo.final-scale {
    transform: scale(1); /* Full size matching hero-logo */
    filter: drop-shadow(0 0 5px rgba(255, 45, 45, 0.3))
            drop-shadow(0 0 10px rgba(255, 45, 45, 0.2))
            drop-shadow(0 0 15px rgba(255, 45, 45, 0.1));
    transition: filter 2.5s ease-out; /* Longer fade for glow effect */
}

/* Auf grossen Displays wirkt der dreifache Glow zu wuchtig – abschwächen. */
@media (min-width: 1400px) {
    .intro-logo {
        filter: drop-shadow(0 0 20px rgba(255, 45, 45, 0.7))
                drop-shadow(0 0 35px rgba(255, 45, 45, 0.4));
    }
}

.main-content-hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease-in, visibility 0s linear 1s;
}

.main-content-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 1s ease-in;
}

/* Responsive adjustments for intro logo */
@media (max-width: 768px) {
    .intro-logo {
        max-width: 640px; /* Same as hero-logo */
        width: 85%;
        filter: none !important; /* Remove glow on mobile */
    }
    
    .intro-logo.animate {
        transform: scale(1); /* Full size */
        filter: none !important; /* Remove glow on mobile */
    }
    
    .intro-logo.final-scale {
        transform: scale(1);
        filter: none !important; /* Remove glow on mobile */
    }
}

@media (max-width: 480px) {
    .intro-logo {
        max-width: 520px; /* Same as hero-logo */
        width: 80%;
        filter: none !important; /* Remove glow on mobile */
    }
    
    .intro-logo.animate {
        transform: scale(1); /* Full size */
        filter: none !important; /* Remove glow on mobile */
    }
    
    .intro-logo.final-scale {
        transform: scale(1);
        filter: none !important; /* Remove glow on mobile */
    }
}

@media (max-width: 375px) {
    .intro-logo {
        max-width: 480px; /* Same as hero-logo */
        width: 75%;
        filter: none !important; /* Remove glow on mobile */
    }
    
    .intro-logo.animate {
        transform: scale(1); /* Full size */
        filter: none !important; /* Remove glow on mobile */
    }
    
    .intro-logo.final-scale {
        transform: scale(1);
        filter: none !important; /* Remove glow on mobile */
    }
}

@media (max-width: 320px) {
    .intro-logo {
        max-width: 440px; /* Same as hero-logo */
        width: 70%;
        filter: none !important; /* Remove glow on mobile */
    }
    
    .intro-logo.animate {
        transform: scale(1); /* Full size */
        filter: none !important; /* Remove glow on mobile */
    }
    
    .intro-logo.final-scale {
        transform: scale(1);
        filter: none !important; /* Remove glow on mobile */
    }
}

/* Navbar Logo Styles */
.navbar-logo {
    height: 35px;
    width: auto;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 5px var(--accent-glow));
    min-height: 44px; /* Touch target minimum */
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.navbar-logo:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px var(--accent-glow));
}

/* Aufmerksamkeits-Hinweis: macht klar, dass das Logo klickbar ist
   (spielt das Intro erneut ab). Pulsiert nur ein paar Mal nach dem Laden. */
@keyframes replayHint {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px var(--accent-glow)); }
    50% { transform: scale(1.12); filter: drop-shadow(0 0 16px var(--accent-glow-strong)); }
}

.navbar-logo {
    animation: replayHint 1.6s ease-in-out 3;
}

@media (prefers-reduced-motion: reduce) {
    .navbar-logo { animation: none; }
}

/* Footer Styles */
.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-family: 'GOODTIME', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.footer-link:hover {
    color: var(--accent);
    text-decoration: none;
    transform: translateY(-1px);
}

.footer-link.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-family: 'GOODTIME', sans-serif;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.footer-link.btn-link:hover {
    color: var(--accent);
    transform: translateY(-1px);
}

/* Link-Zeile im Footer: gleichmaessiger Abstand, umbruchfaehig.
   Mobil zentriert, ab Tablet (>=768px) rechtsbuendig. */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.5rem;
}

@media (min-width: 768px) {
    .footer-links {
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 1rem 0;
        margin-top: 2rem;
    }

    .footer .col-md-6:last-child {
        margin-top: 1rem;
    }

    .footer-link {
        font-size: 0.8rem;
    }

    .footer p {
        font-size: 0.85rem;
    }
    
    .footer .small {
        font-size: 0.75rem;
    }
}

/* Loading Screen Styles */
.loading-screen-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a0000 0%, #000000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    transition: opacity 0.5s ease-out;
}

.loading-content {
    text-align: center;
    animation: fadeInScale 0.8s ease-out;
}

.loading-logo {
    width: 120px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 30px rgba(255, 45, 45, 0.8));
    animation: pulse 2s ease-in-out infinite;
}

.loading-spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 45, 45, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
    /* Eigene Compositor-Ebene: waehrend der Ladescreen laeuft, laedt und
       dekodiert der Browser gleichzeitig das Intro-Video. Ohne eigene Ebene
       ruckelt/steht die Rotation, sobald der Hauptthread beschaeftigt ist. */
    will-change: transform;
}

.loading-text {
    font-family: 'Good Times Heavy', sans-serif;
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    animation: glow 2s ease-in-out infinite alternate;
}

.video-content-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Loading Screen Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 30px rgba(255, 45, 45, 0.8));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 50px rgba(255, 45, 45, 1));
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px rgba(255, 45, 45, 0.5);
        filter: drop-shadow(0 0 10px rgba(255, 45, 45, 0.5));
    }
    to {
        text-shadow: 0 0 20px rgba(255, 45, 45, 0.8), 0 0 30px rgba(255, 45, 45, 0.6);
        filter: drop-shadow(0 0 20px rgba(255, 45, 45, 0.8)) drop-shadow(0 0 30px rgba(255, 45, 45, 0.6));
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile Adjustments for Loading Screen */
@media (max-width: 768px) {
    .loading-logo {
        width: 100px;
    }
    
    .loading-spinner-container {
        width: 60px;
        height: 60px;
    }
    
    .loading-text {
        font-size: 0.85rem;
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .loading-logo {
        width: 80px;
        margin-bottom: 1.5rem;
    }
    
    .loading-spinner-container {
        width: 50px;
        height: 50px;
        margin-bottom: 1.5rem;
    }
    
    .loading-text {
        font-size: 0.75rem;
    }
}

