/* app/static/css/main.css */

/* === Zentrales Styling für GarageSales === */

/* Grundlayout */
body {
    font-family: "Segoe UI", sans-serif;
    background-color: #f9f9f9;
    line-height: 1.6;
    color: #333;
}

/* === Headerbild-Styling === */
.site-header img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
}
@media (max-width: 768px) {
    .site-header img {
        max-height: 250px;
    }
}

/* === Navigation === */
.navbar-custom .container-fluid {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-brand {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    margin-right: 1rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar-collapse {
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.navbar-nav {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0.15rem;
    min-width: 0;
}

.navbar-nav .nav-item {
    flex: 0 1 auto;
    min-width: 0;
}

.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 0.97rem;
    font-weight: 500;
    line-height: 1.2;

    padding: 0.45rem 0.7rem;
    margin-right: 0;

    border-radius: 0.7rem;
    white-space: nowrap;

    transition: background-color 0.2s ease, color 0.2s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: #007bff;
    background-color: rgba(13, 110, 253, 0.08);
}

.navbar .dropdown-menu {
    border-radius: 0.9rem;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    padding: 0.5rem;
}

.navbar .dropdown-item {
    border-radius: 0.7rem;
    padding: 0.55rem 0.8rem;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
    background-color: rgba(13, 110, 253, 0.08);
    color: #007bff;
}

.navbar-toggler {
    border-radius: 0.8rem;
    padding: 0.45rem 0.7rem;
    border-color: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Login-/Logout-Bereich */
.login-form {
    display: flex;
    gap: 0.5rem;
}

.login-form input {
    height: 38px;
    min-width: 165px;
}

.navbar form,
.navbar .text-end {
    flex-shrink: 0;
}

/* ===== Feinabstufung vor dem Burger-Menü ===== */
@media (max-width: 1399.98px) {
    .navbar-brand {
        font-size: 1.75rem;
    }

    .navbar-nav {
        gap: 0.05rem;
    }

    .navbar-nav .nav-link {
        font-size: 0.92rem;
        padding: 0.42rem 0.55rem;
    }

    .login-form input {
        min-width: 150px;
    }
}

/* ===== Burger-Menü / Mobile ===== */
@media (max-width: 1199.98px) {
    .navbar-collapse {
        margin-top: 1rem;
        align-items: stretch;
    }

    .navbar-nav {
        flex-wrap: wrap;
        justify-content: flex-start;
        width: 100%;
        gap: 0.35rem;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-nav .nav-link {
        justify-content: flex-start;
        width: 100%;
        font-size: 1rem;
        padding: 0.6rem 0.85rem;
    }

    .navbar form,
    .navbar .text-end {
        width: 100%;
        margin-top: 1rem;
    }

    .login-form {
        flex-direction: column;
        align-items: stretch;
    }

    .login-form input {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1.55rem;
    }

    .navbar-custom {
        padding: 1rem !important;
    }
}

/* === Formular & Buttons === */
.login-form {
    display: flex;
    gap: 0.5rem;
}
.login-form input {
    height: 38px;
}
.btn-primary {
    transition: background-color 0.3s, transform 0.3s;
}
.btn-primary:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

/* Accordion */
.accordion-button {
    font-weight: 600;
}

.accordion-body {
    padding: 1.5rem;
}

/* Karten-Overlay */
/* Karten-Overlay */
.map-overlay {
    pointer-events: auto; /* ✅ Mausinteraktionen zulassen */
    cursor: pointer;

    background-color: rgba(255, 255, 255, 0.20);

    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;

    z-index: 500; /* über der Karte, aber unter Hinweis-Boxen */
    transition: opacity 0.3s ease-in-out;
}

.bounce {
    animation: bounce 1s infinite alternate;
}
@keyframes bounce {
    from { transform: translateY(0); }
    to   { transform: translateY(-5px); }
}

/* Shadow-Cards */
.custom-card-shadow {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
}
/* Hover-Cards */
.custom-card-shadow:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

/* 📍 Marker-Hervorhebung (Standard-Klasse aus deinen Templates/JS) */
.leaflet-marker-icon.marker-highlight {
  transform: scale(1.3);
  filter: drop-shadow(0 0 5px gold);
  z-index: 1000;
}

/* 📍 Alias: falls irgendwo noch leaflet-marker-highlight genutzt wird */
.leaflet-marker-icon.leaflet-marker-highlight {
  transform: scale(1.3);
  filter: drop-shadow(0 0 5px gold);
  z-index: 1000;
}

/* Pagination */
.pagination .page-link {
    color: #333;
}
.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* Formulare */
.form-label {
    font-weight: 500;
}
.form-control {
    border-radius: 0.375rem;
}

/* Kartenplatzhalter */
.map-placeholder {
    height: 500px;
    background: #f0f0f0;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Newsletter Accordion Box */
.newsletter-box {
    font-size: 0.9rem;
    color: #666;
}

/* Fehlermeldung unter Checkboxen */
.form-text.text-danger {
    font-size: 0.875em;
    margin-top: 0.25rem;
}

/* Allgemein */
h1, h2, h3 {
    font-weight: 700;
}

/* ===== NAVBAR FIX (Browser-stabil) ===== */

.navbar-collapse {
    justify-content: space-between;
}

/* Navigation mittig "balancieren" */
.navbar-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.3rem;
}

/* rechte Seite (Login / Logout) */
.navbar form,
.navbar .text-end {
    flex-shrink: 0;
}

/* Brand sauber links halten */
.navbar-brand {
    margin-right: 1rem;
    font-size: 1.6rem;
    font-weight: 700;
}

/* Inputs stabilisieren (wichtig für Firefox!) */
.login-form input {
    min-width: 180px;
}

/* ===== Responsive ===== */

@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 1rem;
    }

    .navbar-nav {
        justify-content: flex-start;
        width: 100%;
    }

    .navbar-nav .nav-item {
        width: 100%;
    }

    .navbar-nav .nav-link {
        justify-content: flex-start;
        width: 100%;
    }

    .navbar form,
    .navbar .text-end {
        width: 100%;
        margin-top: 1rem;
    }

    .login-form {
        flex-direction: column;
        align-items: stretch;
    }

    .login-form input {
        width: 100%;
    }
}

/* ===== Mobile Schnellnavigation unter dem Banner ===== */

.mobile-top-shortcuts {
    display: none;
}

@media (max-width: 767.98px) {
    .mobile-bottom-nav {
        display: none !important;
    }

    body.is-pwa-mode .mobile-top-shortcuts {
        display: block;
        margin-top: -0.75rem;
        margin-bottom: 1rem;
    }

    .mobile-top-shortcuts__inner {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding: 0.75rem;

        border-radius: 1.25rem;
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.10);

        -webkit-overflow-scrolling: touch;
    }

    .mobile-top-shortcuts__item {
        flex: 0 0 auto;
        padding: 0.55rem 0.85rem;

        border-radius: 999px;
        background: rgba(13, 110, 253, 0.08);

        color: #333;
        font-size: 0.88rem;
        font-weight: 600;
        text-decoration: none;
        white-space: nowrap;
    }

    .mobile-top-shortcuts__item:hover,
    .mobile-top-shortcuts__item:focus {
        color: #0d6efd;
        background: rgba(13, 110, 253, 0.14);
        text-decoration: none;
    }
}

/* Nur in installierter PWA anzeigen */
.pwa-only {
    display: none !important;
}

body.is-pwa-mode .pwa-only {
    display: block !important;
}

/* ===== PWA: Interessenten-Dashboard kompakter machen ===== */

.pwa-only {
    display: none !important;
}

body.is-pwa-mode .pwa-only {
    display: block !important;
}

body.is-pwa-mode .web-only-in-pwa {
    display: none !important;
}

@media (max-width: 767.98px) {
    body.is-pwa-mode #interessentMap {
        height: 420px !important;
    }

    body.is-pwa-mode .tab-content .card-body {
        padding: 1rem !important;
    }

    body.is-pwa-mode #favoritenTabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

    body.is-pwa-mode #favoritenTabs .nav-link {
        font-size: 0.9rem;
    }
}

/* ===== Nachrichten: App-UI ===== */

.message-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 1rem;
    background: #fff;
    overflow: hidden;
}

.message-card--unread {
    border-color: rgba(220, 53, 69, 0.35);
    background: linear-gradient(180deg, #fff 0%, #fff8f8 100%);
}

.message-card__main {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 1rem;
}

.message-card__topline {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.35rem;
}

.message-card__subject {
    font-weight: 700;
    color: #333;
}

.message-card__date {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: #6c757d;
}

.message-card__preview {
    color: #6c757d;
    font-size: 0.92rem;
}

.message-card__hint {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: #0d6efd;
    font-weight: 600;
}

.message-card__body {
    padding: 0 1rem 1rem 1rem;
}

.empty-state {
    padding: 2rem 1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.03);
    border: 1px dashed rgba(0, 0, 0, 0.12);
}

.empty-state__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 767.98px) {
    body.is-pwa-mode .message-card__topline {
        flex-direction: column;
        gap: 0.15rem;
    }

    body.is-pwa-mode .message-card__main {
        padding: 0.9rem;
    }

    body.is-pwa-mode .message-card__preview {
        font-size: 0.88rem;
    }
}

/* ===== Stand-Favoriten: kompaktere App-Karten ===== */

.stand-fav-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.stand-fav-card__main {
    flex: 1 1 auto;
    min-width: 0;
}

.stand-fav-card__remove {
    flex: 0 0 auto;
}

@media (max-width: 767.98px) {
    body.is-pwa-mode .stand-fav-card {
        display: block;
        border-radius: 1rem !important;
        margin-bottom: 0.75rem;
        border: 1px solid rgba(0, 0, 0, 0.08);
    }

    body.is-pwa-mode .stand-fav-card__remove {
        margin-top: 0.75rem;
    }

    body.is-pwa-mode .stand-fav-card__remove .btn {
        width: 100%;
    }

    body.is-pwa-mode .stand-fav-card .intent-btn {
        width: 100%;
    }

    body.is-pwa-mode .stand-fav-card .intent-note {
        font-size: 0.92rem;
    }
}

/* ===== Favoriten-Export kompakter ===== */

.export-dropdown .dropdown-menu {
    border-radius: 1rem;
    padding: 0.5rem;
}

.export-dropdown .dropdown-item {
    border-radius: 0.75rem;
    padding: 0.65rem 0.85rem;
}

@media (max-width: 767.98px) {
    body.is-pwa-mode .export-dropdown {
        width: 100%;
    }

    body.is-pwa-mode .export-dropdown > .btn {
        width: 100%;
    }

    body.is-pwa-mode .export-dropdown .dropdown-menu {
        width: 100%;
    }
}

/* ===== Anfrage-Zusammenfassung ===== */

.request-summary-card {
    background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
    border: 1px solid rgba(255, 193, 7, 0.22) !important;
}

.request-summary-card--answered {
    background: linear-gradient(180deg, #ffffff 0%, #f4fbf7 100%);
    border-color: rgba(25, 135, 84, 0.22) !important;
}

.request-summary-card__icon {
    font-size: 1.5rem;
    line-height: 1;
}

.request-summary-card:hover,
.request-summary-card:focus {
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1.2rem rgba(0, 0, 0, 0.10);
}

@media (max-width: 767.98px) {
    body.is-pwa-mode .request-summary-card .card-body {
        padding: 0.85rem !important;
    }

    body.is-pwa-mode .request-summary-card .h3 {
        font-size: 1.4rem;
    }
}

/* CSP: verbindlich versteckte Elemente.
   Sichtbarkeit wird ausschließlich über das Hinzufügen bzw.
   Entfernen dieser Klasse gesteuert. !important verhindert,
   dass layout- oder komponentenspezifische display-Regeln den
   versteckten Zustand unbeabsichtigt überschreiben. */
.csp-hidden {
    display: none !important;
}

/* CSP: Scroll-Sperre bei geöffneter Bild-Lightbox */
.csp-no-scroll {
    overflow: hidden;
}

/* CSP: migrierte statische Inline-Styles */
.csp-pre-wrap {
    white-space: pre-wrap;
}

.csp-mt-8 {
    margin-top: 8px;
}

/* CSP: weitere migrierte statische Inline-Styles */
.csp-pointer {
    cursor: pointer;
}

.csp-bg-danger-soft {
    background: rgba(220, 53, 69, 0.06);
}

/* CSP: Markt-Popup-Komponenten */
.csp-popup-description {
    max-height: 100px;
    overflow-y: auto;
    font-size: 0.9em;
    margin-top: 6px;
}

.csp-popup-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

/* CSP: 60px-Standbild-Thumbnails */
.csp-thumb-60 {
    height: 60px;
    width: auto;
}

.csp-thumb-border-light {
    border-radius: 6px;
    border: 1px solid #ddd;
}

.csp-thumb-border-gray {
    border-radius: 6px;
    border: 1px solid #ccc;
}

.csp-thumb-border-map {
    border-radius: 0;
    border: 1px solid #bbb;
}

.csp-thumb-border-event {
    border: 1px solid #444;
}

.csp-thumb-border-ticket {
    border: 2px solid #1d1b16;
}

.csp-mt-4 {
    margin-top: 4px;
}

/* CSP: statische Breitenbegrenzungen */
.csp-compact-info-tile {
    min-width: 200px;
    max-width: 250px;
}

.csp-max-w-320 {
    max-width: 320px;
}

.csp-max-w-520 {
    max-width: 520px;
}

/* CSP: statische Abstände und Informationsflächen */
.csp-sticky-offset {
    top: 5.5rem;
}

.csp-fav-hint-margin {
    margin: 4px 0 8px;
}

.csp-fav-block-margin {
    margin: 8px 0;
}

.csp-route-margin {
    margin: 0 0 10px;
}

.csp-mt-0 {
    margin-top: 0;
}

.csp-bg-primary-soft {
    background: rgba(13, 110, 253, 0.05);
}

.csp-bg-success-soft {
    background: rgba(25, 135, 84, 0.06);
}

/* CSP: migrierte Bildgrößen */
.csp-dashboard-thumb-90 {
    height: 90px;
    width: auto;
    object-fit: cover;
}

.csp-carousel-max-520 {
    max-height: 520px;
    object-fit: cover;
}

.csp-carousel-h-340 {
    height: 340px;
    object-fit: cover;
}

/* CSP: statische Layout-Grenzen */
.csp-min-w-260 {
    min-width: 260px;
}

.csp-newsletter-scroll {
    min-height: 520px;
    overflow: auto;
}

.csp-max-w-360 {
    max-width: 360px;
}

.csp-max-w-420 {
    max-width: 420px;
}

.csp-min-h-260 {
    min-height: 260px;
}

.csp-min-h-220 {
    min-height: 220px;
}

.csp-max-w-900 {
    max-width: 900px;
}

.csp-max-w-800 {
    max-width: 800px;
}

/* CSP: migrierte visuelle Einzelstyles */
.csp-fs-1em {
    font-size: 1em;
}

.csp-atlas-popup {
    min-width: 190px;
}

.csp-fs-1rem {
    font-size: 1rem;
}

.csp-mt-7 {
    margin-top: 7px;
}

.csp-atlas-address {
    margin-top: 7px;
    color: #666;
}

.csp-mb-10 {
    margin-bottom: 10px;
}

.csp-map-prompt-event {
    font-size: 30px;
    font-weight: 500;
}

.csp-mt-24 {
    margin-top: 24px;
}

.csp-mb-18 {
    margin-bottom: 18px;
}

.csp-mb-24 {
    margin-bottom: 24px;
}

.csp-mb-8 {
    margin-bottom: 8px;
}

.csp-map-prompt-mapfocus {
    font-size: 24px;
    font-weight: 600;
    text-transform: uppercase;
}

.csp-mt-18 {
    margin-top: 18px;
}

.csp-story-fav-margin {
    margin: 8px 0 4px;
}

.csp-story-fav-title {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--ka-dim);
}

.csp-fs-22 {
    font-size: 22px;
}

.csp-ticket-accent {
    color: var(--tk-acc-d);
}

.csp-fs-24 {
    font-size: 24px;
}

.csp-bg-warning-soft-18 {
    background: rgba(255,193,7,0.18);
}

.csp-bg-warning-soft-16 {
    background: rgba(255,193,7,0.16);
}

.csp-bg-primary-soft-06 {
    background: rgba(13,110,253,0.06);
}

/* CSP: statische Größen und Bilddarstellung */
.csp-h-220 {
    height: 220px;
}

.csp-img-h80-muted {
    height: 80px;
    width: auto;
    object-fit: cover;
    opacity: 0.82;
}

.csp-h-500 {
    height: 500px;
}

.csp-w-44 {
    width: 44px;
}

.csp-h-260 {
    height: 260px;
}

.csp-img-220x140 {
    width: 220px;
    height: 140px;
    object-fit: cover;
}

.csp-img-full-h140 {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.csp-h-750 {
    height: 750px;
}

.csp-img-maxh-150 {
    max-height: 150px;
    object-fit: cover;
}

.csp-h-320 {
    height: 320px;
}

.csp-img-90 {
    width: 90px;
    height: 90px;
    object-fit: cover;
}

.csp-map-h600 {
    height: 600px;
    border-radius: 8px;
}

.csp-img-event-62vh {
    height: 62vh;
    object-fit: cover;
}

.csp-img-h440 {
    height: 440px;
    object-fit: cover;
}

/* CSP: statische Hilfsklassen Gruppe 12A */
.csp-cursor-grab {
    cursor: grab;
}

.csp-h-1 {
    height: 1px;
}

.csp-w-100 {
    width: 100%;
}


/* CSP: Troedel-Karte Gruppe 12B */
.csp-h-540 {
    height: 540px;
}

/* CSP: Karten-Aktivierungs-Overlays Gruppe 12C */
.csp-map-overlay-soft {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.85);
    cursor: pointer;
}

.csp-map-overlay-transparent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0);
    cursor: pointer;
}

.csp-map-overlay-transparent-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0);
    z-index: 999;
    cursor: pointer;
}

/* CSP: Honeypot-Felder Gruppe 12D */
.csp-honeypot-contact {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.csp-honeypot-register {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
