/* assets/css/main.css */

/* Globale Links: kein Browser-Standard (z. B. Lila) bei :visited */
a,
a:visited {
    color: inherit;
    text-decoration: none;
}

/* „Mehr erfahren“ / MEHR ERFAHREN: Akzent #4bb6f5, Hover weiß (überschreibt globales a { color: inherit } und text-inherit auf Karten-Links) */
a.link-mehr-erfahren,
.link-mehr-erfahren {
    color: #4bb6f5 !important;
    transition: color 150ms ease;
}
a.link-mehr-erfahren:hover,
a.link-mehr-erfahren:focus-visible,
.group:hover .link-mehr-erfahren,
.group:focus-visible .link-mehr-erfahren {
    color: #ffffff !important;
}

.nav-link,
.nav-link:visited {
    color: white !important;
}

/* Nav-Logo: feste Stufen — verhindert Layout-Sprung; mobil/tablet größer für bessere Lesbarkeit */
nav img[src*="logo"] {
    height: 80px !important; /* mobil: von 64px erhöht */
    width: auto;
    object-fit: contain;
    transition: height 0.3s ease;
}
@media (min-width: 768px) {
    nav img[src*="logo"] {
        height: 100px !important; /* tablet: von 80px erhöht */
    }
}
@media (min-width: 1024px) {
    nav img[src*="logo"] {
        height: 120px !important; /* desktop unverändert */
    }
}

/* Nav-Innenabstand: größeres Logo nicht am Rand kleben lassen (überschreibt Tailwind py-4) */
#main-header nav > div {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
}
@media (min-width: 768px) {
    #main-header nav > div {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}
@media (min-width: 1024px) {
    #main-header nav > div {
        padding-top: 1.75rem !important;
        padding-bottom: 1.75rem !important;
    }
}

/* FOUC: inline SVGs before Tailwind / utility CSS applies */
svg {
    display: inline-flex !important;
    vertical-align: middle;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    max-width: 100%;
    box-sizing: border-box;
    fill: currentColor;
}

header svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    color: inherit;
}

/* Header utility row: keep icons visible (no clipping, inherit link color) */
header > div:first-child {
    overflow: visible;
}

footer svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
    color: inherit;
}

/* Footer „Kontakt & Recht“: WhatsApp (externer Link) sonst oft weiß durch :visited / inherit */
footer .flex.items-center.gap-5 a[aria-label="WhatsApp"] svg {
    color: #4bb6f5;
}

/* Footer social strip uses w-5 (20px) in markup */
footer .flex.items-center.gap-4 svg {
    width: 20px;
    height: 20px;
}

/* Footer: Copyright-Zeile gut lesbar (Tailwind text-white/40 war auf Schwarz zu schwach); Abstand zum festen Cookie-Button */
footer > div:last-child {
    position: relative;
    z-index: 120;
    padding-bottom: max(5rem, calc(3.5rem + env(safe-area-inset-bottom, 0px)));
}
footer > div:last-child p {
    color: rgba(255, 255, 255, 0.62) !important;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    background-color: #131313;
}

body {
    opacity: 0;
    animation: fadeIn 0.22s ease-out forwards;
}

/* In-App-Navigation (Turbo): kein erneutes Aus-/Einblenden des gesamten body */
html.turbo-in-app body {
    opacity: 1 !important;
    animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
    body {
        opacity: 1;
        animation: none;
    }
}

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

/* Material Symbols */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: block;
    user-select: none;
}

/* Kontaktformular: eigene Validierung (form novalidate) */
form[name="contact"] .contact-form-control.contact-field-invalid {
    border-color: rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.25);
}
form[name="contact"] .contact-form-control.contact-field-invalid:focus {
    border-color: rgba(248, 113, 113, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.35);
}
form[name="contact"] input[type="checkbox"].contact-form-control.contact-field-invalid {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.45);
}
form[name="contact"] input[type="checkbox"].contact-form-control.contact-field-invalid:focus {
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.55);
}

/* Hintergründe & Glows */
.hero-gradient {
    background: radial-gradient(circle at center, rgba(75, 182, 245, 0.15) 0%, rgba(19, 19, 19, 1) 70%);
}

.particle-bg {
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1' fill='%234bb6f5' fill-opacity='0.2'/%3E%3C/svg%3E");
}

.cta-glow {
    background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.15) 0%, rgba(75, 182, 245, 0) 70%);
}

/* Mobile Menu — dunkler Grund (kein weißer FOUC); passt zu bg-background/95 im Markup */
#mobile-menu {
    transition: transform 0.3s ease-in-out;
    background-color: rgba(19, 19, 19, 0.95);
    /* Über Hero / Canvas (z-0–z-10); ID-Regel bleibt unabhängig von Tailwind-Reihenfolge */
    z-index: 10000;
}
#mobile-menu.hidden-menu {
    transform: translateY(-100%);
}

/* Mobile Nav: Accordion (Leistungen / Branchen) */
.mobile-nav-accordion-panel {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    width: 100%;
}

.mobile-nav-accordion.is-open .mobile-nav-accordion-panel {
    max-height: 2000px;
    opacity: 1;
}

.mobile-nav-accordion .mobile-nav-chevron {
    transition: transform 0.3s ease;
}

.mobile-nav-accordion.is-open .mobile-nav-chevron {
    transform: rotate(180deg);
}

button.mobile-nav-accordion-trigger.nav-link-active {
    color: #4bb6f5 !important;
}

/* Acrylic Cards */
.acrylic-card {
    background: linear-gradient(135deg, #1f242b 0%, #08090a 100%);
    border-top: 1.5px solid rgba(255, 255, 255, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-right: 0.5px solid rgba(255, 255, 255, 0.05);
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.5);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}
.acrylic-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none; z-index: 1;
}
.acrylic-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 40px 80px -12px rgba(0, 0, 0, 0.9), 0 0 20px rgba(75, 182, 245, 0.1);
}

/* Navigation active states */
.nav-link-active {
    color: #4bb6f5 !important;
    font-weight: 600;
}

.dropdown-item-active {
    background: rgba(75, 182, 245, 0.1);
}

/* Aktives Untermenü: Icons + Typo in Primärfarbe (Tailwind-Klassen im Markup) */
.dropdown-item-active .material-symbols-outlined {
    color: #4bb6f5 !important;
}

.dropdown-item-active .text-white {
    color: #4bb6f5 !important;
}

.dropdown-item-active .text-white\/40 {
    color: rgba(75, 182, 245, 0.72) !important;
}

.dropdown-item-active .text-sky-400 {
    color: #4bb6f5 !important;
}

.dropdown-item-active > div.rounded-lg {
    color: #4bb6f5;
}

/* Nav dropdown panels: keep acrylic look without hover lift */
.acrylic-card.acrylic-card--menu-panel:hover {
    transform: none;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8);
}

/* termin.html: Google Kalender-Embed — kein negativer margin-top + overflow:hidden:
   Buchungs-Modale („Kontaktdaten“, Bestätigung) sitzen oben im Iframe und würden sonst abgeschnitten. */
.calendar-crop-container {
    position: relative;
    overflow: visible;
}

.calendar-crop-container .calendar-crop-iframe {
    width: 100%;
    height: 960px;
    min-height: 960px;
    margin-top: 0;
    border: 0;
    filter: invert(90%) hue-rotate(180deg);
}

/* Mobile: Embed aus — siehe .cursorrules §13; kein separates Crop-CSS nötig */

/* —— Cookie Consent (§12): kein 100vw — Overlay = fixed + inset: 0; Karte = w-full max-w-lg —— */
#alkun-consent-trigger {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background: #4bb6f5;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease;
}
#alkun-consent-trigger:hover {
    transform: scale(1.05);
}
#alkun-consent-trigger:focus-visible {
    outline: 2px solid #4bb6f5;
    outline-offset: 2px;
}
#alkun-consent-trigger .material-symbols-outlined {
    color: #fff;
    font-size: 26px;
}

.alkun-consent-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
        max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
    background: rgba(19, 19, 19, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: opacity 0.5s ease-out;
}
.alkun-consent-overlay.opacity-0 {
    opacity: 0;
}
.alkun-consent-overlay.opacity-100 {
    opacity: 1;
}
.alkun-consent-overlay.invisible {
    visibility: hidden;
}
.alkun-consent-overlay.pointer-events-none {
    pointer-events: none;
}

.alkun-consent-panel-wrap {
    width: 100%;
    max-width: 32rem;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.alkun-consent-shell {
    width: 100%;
    max-width: 32rem;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease-out;
}
.alkun-consent-overlay.opacity-0 .alkun-consent-shell,
.alkun-consent-overlay.invisible .alkun-consent-shell {
    opacity: 0;
    transform: translateY(1rem);
}
.alkun-consent-overlay.opacity-100 .alkun-consent-shell {
    opacity: 1;
    transform: translateY(0);
}

.alkun-consent-body-scroll {
    max-height: 70vh;
}

.alkun-consent-tab {
    background: transparent;
    cursor: pointer;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(255, 255, 255, 0.5);
}
.alkun-consent-tab.is-active {
    border-bottom-color: #4bb6f5;
    color: #4bb6f5;
}

.alkun-consent-switch-track {
    pointer-events: none;
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.2);
}
.alkun-consent-switch-track.is-on {
    background: #4bb6f5;
}
.alkun-consent-switch-knob {
    pointer-events: none;
    position: absolute;
    left: 0.25rem;
    top: 0.25rem;
    z-index: 10;
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}
.alkun-consent-switch-knob.is-on {
    transform: translateX(1.25rem);
}

.alkun-consent-btn-primary {
    min-height: 44px;
    border-radius: 9999px;
    background: #4bb6f5;
    color: #131313;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    font-weight: 600;
    transition: opacity 0.2s ease;
}
.alkun-consent-btn-primary:hover {
    opacity: 0.95;
}
.alkun-consent-btn-primary:focus-visible {
    outline: 2px solid #4bb6f5;
    outline-offset: 2px;
}

.alkun-consent-btn-ghost {
    min-height: 44px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #fff;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.alkun-consent-btn-ghost:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
}
.alkun-consent-btn-ghost:focus-visible {
    outline: 2px solid #4bb6f5;
    outline-offset: 2px;
}

.alkun-consent-save-link {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: rgba(255, 255, 255, 0.25);
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.alkun-consent-save-link:hover {
    color: #4bb6f5;
    text-decoration-color: rgba(75, 182, 245, 0.5);
}
.alkun-consent-save-link:focus-visible {
    outline: 2px solid #4bb6f5;
    border-radius: 4px;
}

.alkun-consent-privacy-link {
    color: #4bb6f5;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.alkun-consent-privacy-link:hover {
    opacity: 0.9;
}

.alkun-consent-footer-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
}
.alkun-consent-footer-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}
.alkun-consent-footer-actions .alkun-consent-btn-primary,
.alkun-consent-footer-actions .alkun-consent-btn-ghost {
    width: 100%;
    box-sizing: border-box;
}
@media (min-width: 768px) {
    .alkun-consent-footer-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 1rem;
    }
    .alkun-consent-footer-actions {
        flex-direction: row;
        flex-wrap: wrap;
        width: auto;
        justify-content: flex-end;
    }
    .alkun-consent-footer-actions .alkun-consent-btn-primary,
    .alkun-consent-footer-actions .alkun-consent-btn-ghost {
        width: auto;
    }
}

.acrylic-card.acrylic-card--consent {
    background: linear-gradient(135deg, rgba(31, 36, 43, 0.88) 0%, rgba(8, 9, 10, 0.92) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.acrylic-card.acrylic-card--consent:hover {
    transform: none;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.8);
}

/* Animationen */
@keyframes float { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-15px); } }
.animate-float { animation: float 6s ease-in-out infinite; }

@keyframes pulse-glow { 0%, 100% { opacity: 0.4; transform: scale(1.2); } 50% { opacity: 0.7; transform: scale(1.6); } }
.animate-pulse-slow { animation: pulse-glow 5s ease-in-out infinite; }

/* Hero-Obenabstand: pt-40 md:pt-52 lg:pt-60 als Utility auf .subpage-hero / Startseiten-Hero im Markup */

/* ─── Desktop-Dropdown-Panels: Verhalten ohne Tailwind CDN ──────────────────
   Das Tailwind-CDN-Script hat das Attribut "defer" und wird erst nach dem
   HTML-Parsing ausgeführt. Bis dahin haben die Utility-Klassen opacity-0 /
   invisible / group-hover:opacity-100 usw. KEINE CSS-Wirkung – die Panels wären
   kurz sichtbar (Browser-Default: opacity:1, visibility:visible).
   Wir replizieren das Hover-Verhalten hier in main.css, das synchron geladen
   wird und sofort greift. */
#main-header nav .relative.group > div.absolute {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    /* Tailwind duration-300 / transition-all nachgebildet */
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}
#main-header nav .relative.group:hover > div.absolute {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Expand-Icon-Rotation beim Hover (Tailwind group-hover:rotate-180 nachgebildet) */
#main-header nav .relative.group > a .material-symbols-outlined {
    transition: transform 0.3s ease;
}
#main-header nav .relative.group:hover > a .material-symbols-outlined {
    transform: rotate(180deg);
}

/* Nach Turbo-Navigation kurz Hover sperren, damit das Dropdown nicht sofort
   erscheint, wenn die Maus noch über einem Trigger liegt (nav-no-hover-Klasse
   wird per JS für ~400 ms gesetzt, passend zur main-Einblend-Transition). */
#main-header nav.nav-no-hover .relative.group:hover > div.absolute {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(8px) !important;
}
#main-header nav.nav-no-hover .relative.group:hover > a .material-symbols-outlined {
    transform: rotate(0deg) !important;
}

/* ─── Turbo-Navigation: Nav und Dropdown-Panels während Seitenwechsel sperren ─
   JS (nav-page-active.js) setzt zusätzlich Inline-Styles mit !important für
   sofortige Wirkung noch im selben Paint-Frame. */
body.turbo-loading #main-header nav {
    pointer-events: none !important;
}
body.turbo-loading #main-header nav .relative.group > div.absolute {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: none !important;
}

/* Mobile-Menü: wird per JS geschlossen (mobile-menu.js), hier zusätzliche Absicherung */
body.turbo-loading #mobile-menu {
    display: none !important;
}

/* FOUC: nur <main> kurz verstecken, persistenter Header (#main-header) bleibt sichtbar */
main {
    visibility: visible !important;
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.36s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Während Turbo-Navigation: weicher Ausblend + leichter Parallax (reduziert bei prefers-reduced-motion) */
body.turbo-loading main {
    opacity: 0;
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    body.turbo-loading main {
        transform: translateY(10px);
    }
}

/* Turbo 8: optische Rückmeldung während der Anfrage (obere Leiste, Markenblau) */
@keyframes turbo-route-shimmer {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

body.turbo-loading::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 99999;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        #131313 0%,
        #4bb6f5 35%,
        #93d7ff 50%,
        #4bb6f5 65%,
        #131313 100%
    );
    background-size: 220% 100%;
    animation: turbo-route-shimmer 0.95s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(75, 182, 245, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    main {
        transition: opacity 0.18s ease-out;
    }

    body.turbo-loading main {
        transform: none;
    }

    body.turbo-loading::after {
        animation: none;
        background: #4bb6f5;
        background-size: 100% 100%;
        opacity: 0.85;
    }
}