/**
 * ═══════════════════════════════════════════════════════════════
 * TripTiles - Hero + Discovery Styles
 * Karte: 100% breit UNTER ALLEM. Marker rechts zentriert (via JS).
 * Default: Kacheln volle Breite, Karte hidden.
 * Toggle: Kacheln 50% links, Karte durchscheinend.
 * Developed by Toni Sciacca - mail@tonisciacca.com
 * ═══════════════════════════════════════════════════════════════
 */

/* ═══════════════ HEADER TRANSPARENT ═══════════════ */
.header.transparent { background:transparent !important; border-bottom:1px solid transparent !important; transition:background 0.35s ease,border-color 0.35s ease; }
.header.transparent .logo-icon { color:#fff !important; }
.header.transparent .logo-text { color:#fff !important; }
.header.transparent .btn-ai-concierge { background:rgba(255,255,255,0.15) !important; backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); border:1px solid rgba(255,255,255,0.25) !important; box-shadow:0 2px 12px rgba(0,0,0,0.15) !important; }
.header.transparent .btn-ai-concierge:hover { background:rgba(255,255,255,0.25) !important; }
.header.transparent #userMenuBtn { border-color:rgba(255,255,255,0.3) !important; background:rgba(255,255,255,0.12) !important; }
.header.transparent #userMenuBtn i[data-lucide] { color:#fff !important; }

/* ═══════════════ HEADER SCROLLED ═══════════════ */
.header.scrolled { background:var(--bg-primary) !important; border-bottom:1px solid var(--border-color) !important; transition:background 0.35s ease,border-color 0.35s ease; }
.header.scrolled .logo-icon { color:var(--primary) !important; }
.header.scrolled .logo-text { color:var(--primary) !important; }
.header.scrolled .btn-ai-concierge { background:linear-gradient(135deg,#FF385C,#FF1744) !important; border:none !important; box-shadow:0 2px 8px rgba(255,56,92,0.3) !important; backdrop-filter:none; -webkit-backdrop-filter:none; }
.header.scrolled #userMenuBtn { border-color:var(--sh-border,#e8e8e8) !important; background:var(--sh-border,#e8e8e8) !important; }
.header.scrolled #userMenuBtn i[data-lucide] { color:var(--sh-text3,#9a9a9a) !important; }

/* ═══════════════ HERO ═══════════════ */
.hero-section { position:relative; width:100%; height:100vh; overflow:hidden; display:flex; align-items:center; justify-content:center; z-index:500; background:#1a1a2e; }
.hero-video { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:1; }
.hero-fallback-img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:1; }
.hero-overlay { position:absolute; inset:0; background:linear-gradient(180deg,rgba(0,0,0,0.6) 0%,rgba(0,0,0,0.45) 40%,rgba(0,0,0,0.4) 60%,rgba(0,0,0,0.65) 100%); z-index:2; }
.hero-content { position:relative; z-index:3; text-align:center; color:#fff; max-width:800px; padding:0 24px; margin-top:-40px; }
.hero-title { font-family:'Outfit',sans-serif; font-size:52px; font-weight:700; line-height:1.15; color:#fff; margin:0 0 16px; text-shadow:0 2px 20px rgba(0,0,0,0.3); }
.hero-subtitle { font-family:'Outfit',sans-serif; font-size:20px; font-weight:400; color:rgba(255,255,255,0.85); margin:0 0 40px; text-shadow:0 1px 10px rgba(0,0,0,0.2); }
.hero-search { display:flex; align-items:center; justify-content:center; margin-bottom:20px; }
.hero-search-pill {
    display:flex; align-items:center; gap:8px;
    padding:4px 4px 4px 16px;
    border-radius:50px;
    background:#fff;
    box-shadow:0 4px 24px rgba(0,0,0,0.18);
    max-width:480px; width:100%;
    transition:box-shadow 0.25s ease, transform 0.2s ease;
}
.hero-search-pill:hover { box-shadow:0 6px 32px rgba(0,0,0,0.25); transform:translateY(-1px); }
.hero-search-pill:focus-within { box-shadow:0 6px 32px rgba(0,0,0,0.25); }
.hero-search-input {
    flex:1; border:none; outline:none; background:transparent;
    font-family:'Outfit',sans-serif; font-size:14px; font-weight:400;
    color:var(--text-primary); padding:0;
}
.hero-search-input::placeholder { color:var(--text-secondary); }
.hero-search-btn {
    display:flex; align-items:center; justify-content:center;
    width:32px; height:32px; flex-shrink:0;
    border-radius:50%; background:var(--primary); border:none; cursor:pointer;
    transition:background 0.2s ease, transform 0.15s ease;
}
.hero-search-btn:hover { background:var(--primary-dark); transform:scale(1.05); }
.hero-search-icon { width:16px; height:16px; color:#fff; stroke-width:2.5; }
.hero-categories { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; max-width:640px; margin:0 auto; }
.hero-category-pill { display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border-radius:50px; background:rgba(255,255,255,0.12); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); border:1px solid rgba(255,255,255,0.25); color:#fff; font-family:'Outfit',sans-serif; font-size:13px; font-weight:500; cursor:pointer; transition:all 0.2s ease; }
.hero-category-pill:hover { background:rgba(255,255,255,0.22); border-color:rgba(255,255,255,0.4); transform:translateY(-1px); }
.hero-category-pill.active { background:rgba(255,255,255,0.95); color:var(--text-primary); border-color:transparent; }
.hero-category-pill i[data-lucide] { width:15px; height:15px; stroke-width:2; }
.hero-scroll-indicator { position:absolute; bottom:32px; left:50%; transform:translateX(-50%); z-index:3; display:flex; flex-direction:column; align-items:center; gap:6px; cursor:pointer; opacity:0.7; transition:opacity 0.3s ease; }
.hero-scroll-indicator:hover { opacity:1; }
.hero-scroll-indicator i[data-lucide] { width:28px; height:28px; color:#fff; animation:heroScrollBounce 2s ease-in-out infinite; }
.hero-scroll-label { font-family:'Outfit',sans-serif; font-size:11px; font-weight:500; color:rgba(255,255,255,0.7); text-transform:uppercase; letter-spacing:1px; }
@keyframes heroScrollBounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(8px)} }

/* ═══════════════ TILE-STRIP: rund, vertikal, links ═══════════════ */
.hero-tile-strip {
    position: absolute;
    bottom: 80px;
    left: 28px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-tile {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: visible;
    cursor: pointer;
    position: relative;
    opacity: 0.55;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.hero-tile:hover {
    opacity: 1;
    transform: scale(1.1);
}

.hero-tile.active {
    opacity: 1;
}

.hero-tile img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.hero-tile.active img {
    border-color: #fff;
}

/* Hover-Label rechts neben der Tile */
.hero-tile-label {
    position: absolute;
    left: 58px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 6px 14px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(-50%) translateX(-6px);
    text-shadow: none;
}

.hero-tile:hover .hero-tile-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Timer: Ring um die aktive Tile */
.hero-tile .hero-tile-timer {
    position: absolute;
    top: -3px;
    left: -3px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: rgba(255, 56, 92, 0.8);
    opacity: 0;
    pointer-events: none;
}

.hero-tile.active .hero-tile-timer {
    opacity: 1;
    animation: tileTimerSpin 6s linear forwards;
}

@keyframes tileTimerSpin {
    0% { transform: rotate(0deg); border-color: rgba(255,56,92,0.8) transparent transparent transparent; }
    25% { border-color: rgba(255,56,92,0.8) rgba(255,56,92,0.8) transparent transparent; }
    50% { border-color: rgba(255,56,92,0.8) rgba(255,56,92,0.8) rgba(255,56,92,0.8) transparent; }
    75% { border-color: rgba(255,56,92,0.8) rgba(255,56,92,0.8) rgba(255,56,92,0.8) rgba(255,56,92,0.6); }
    100% { transform: rotate(360deg); border-color: rgba(255,56,92,0.8); }
}


/* ═══════════════ PINKE MARKER (wie rahmen.php) ═══════════════ */
.tt-poi-marker { background: none !important; border: none !important; }

.tt-pm {
    border-radius: 50%;
    background: var(--primary, #FF385C);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(255, 56, 92, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.tt-pm:hover,
.tt-pm.active,
.marker-highlight .tt-pm {
    transform: scale(1.2);
    box-shadow: 0 0 0 4px rgba(255, 56, 92, 0.2), 0 6px 20px rgba(255, 56, 92, 0.45);
    z-index: 100;
}

/* Alte Tropfen-Marker verstecken */
.custom-marker .marker-pin { display: none !important; }


/* ═══════════════ TILE POPUP (wie rahmen.php) ═══════════════ */
.tt-tile-popup .leaflet-popup-content-wrapper {
    border-radius: 14px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

.tt-tile-popup .leaflet-popup-content {
    margin: 0 !important;
    padding: 0 !important;
    width: 220px !important;
}

.tt-tile-popup .leaflet-popup-tip {
    background: white;
    box-shadow: none;
}

.tt-tile-popup .leaflet-popup-close-button {
    top: 6px !important;
    right: 6px !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    color: white !important;
    font-size: 14px !important;
    line-height: 24px !important;
    text-align: center !important;
    padding: 0 !important;
    z-index: 10;
}

.tt-tile-popup .leaflet-popup-close-button:hover {
    background: rgba(0, 0, 0, 0.7) !important;
}


/* ═══════════════ HERO: Karte weg ═══════════════ */
body.in-hero #mapContainer { visibility:hidden !important; }
body.in-hero .map-toggle-pill, body.in-hero .mobile-map-toggle-floating { opacity:0 !important; pointer-events:none !important; }
body.in-hero .category-nav { visibility:hidden !important; }
body.in-hero .search-section { visibility:hidden !important; }
body.in-hero .search-backdrop { display:none !important; }

/* ═══════════════ DISCOVERY ═══════════════ */
html { overflow-y: scroll; }
body { overflow-x: hidden; }
#discoverySection { position:relative; z-index:2; min-height:100vh; background:var(--bg-primary); display:flex; flex-direction:column; }
#discoverySection .search-section { position:sticky; top:calc(var(--header-height) + var(--category-height)); z-index:997; order:2; }
#discoverySection .category-nav { position:sticky; top:var(--header-height); z-index:998; order:1; }
#discoverySection #mainLayout { margin-top:0 !important; order:3; }
#discoverySection #listContainer { padding-top:24px !important; }
body.in-discovery .map-toggle-pill, body.in-discovery .mobile-map-toggle-floating { opacity:1; pointer-events:auto; transition:opacity 0.3s ease; }

/* Alten Map-Toggle-Pill verstecken */
#discoverySection .map-toggle-pill { display:none !important; }

/* ═══════════════ ZOOM-HINT OVERLAY ═══════════════ */
.map-zoom-hint {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.map-zoom-hint-inner {
    position: absolute;
    top: 50%;
    right: 25%;
    transform: translate(50%, -50%);
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 500;
}

.map-zoom-hint.visible {
    opacity: 1;
}

/* ═══════════════ NEUER MAP-TOGGLE: rechte Kante, Pulse ═══════════════ */
.hero-map-toggle {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px 14px 16px;
    background: var(--primary, #FF385C);
    color: #fff;
    border: none;
    border-radius: 16px 0 0 16px;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: -4px 0 20px rgba(255, 56, 92, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    writing-mode: horizontal-tb;
    opacity: 0;
    pointer-events: none;
}

body.in-discovery .hero-map-toggle {
    opacity: 1;
    pointer-events: auto;
}

body.in-hero .hero-map-toggle {
    opacity: 0;
    pointer-events: none;
}

.hero-map-toggle:hover {
    padding-right: 28px;
    box-shadow: -6px 0 28px rgba(255, 56, 92, 0.45);
}

.hero-map-toggle i[data-lucide] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Pulse Ring */
.hero-map-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: mapTogglePulse 2s ease-out infinite;
}

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

/* Map offen: Button wechselt */
.hero-map-toggle.map-active {
    background: #222;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
}

.hero-map-toggle.map-active::before {
    animation: none;
    opacity: 0;
}

.hero-map-toggle.map-active:hover {
    background: #000;
}

/* "Wohin soll es gehen?" Mobile-Bar ausblenden */
#discoverySection .filter-bar-mobile { display:none !important; }


/* ═══════════════════════════════════════════════════════════════
   DEFAULT: Kacheln volle Breite, Karte hidden
   ═══════════════════════════════════════════════════════════════ */
body.in-discovery #mainLayout #mapContainer {
    visibility: hidden !important;
    pointer-events: none !important;
}

body.in-discovery #mainLayout #listContainer {
    width: 100% !important;
    padding-right: var(--container-padding) !important;
}


/* ═══════════════════════════════════════════════════════════════
   MAP-VISIBLE: Karte 100% UNTER ALLEM, Kacheln 50% links
   ═══════════════════════════════════════════════════════════════ */

/* Karte: 100% vollflaechig, HINTER den Kacheln aber UEBER discoverySection background */
body.in-discovery #mainLayout.map-visible #mapContainer {
    visibility: visible !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    z-index: 1 !important;
    pointer-events: auto !important;
}

body.in-discovery #mainLayout.map-visible #mapContainer #map {
    pointer-events: auto;
}

body.in-discovery #mainLayout.map-visible #mapContainer .map-close-btn {
    display: none !important;
}

/* Kacheln: 50% breit links, transparent — Map scheint durch */
body.in-discovery #mainLayout.map-visible #listContainer {
    width: 50% !important;
    padding-right: 24px !important;
    background: transparent !important;
    position: relative !important;
    z-index: 10 !important;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Einzelne Kacheln brauchen eigenen Hintergrund */
body.in-discovery #mainLayout.map-visible .route-card,
body.in-discovery #mainLayout.map-visible .trip-card,
body.in-discovery #mainLayout.map-visible .tt-card {
    background: var(--bg-primary) !important;
    border-radius: var(--border-radius-lg);
}

/* Discovery-Section transparent bei Karte offen */
body.in-discovery.map-open #discoverySection {
    background: transparent !important;
}

body.in-discovery.map-open #mainLayout {
    background: transparent !important;
}

body.in-discovery.map-open #listContainer {
    padding-bottom: 0 !important;
}

/* ═══════════════════════════════════════════════════════════════
   PARALLAX: Map fixed im HG, Content scrollt darueber.
   Nach "Mehr Reisen laden" schiebt sich solider Bereich ueber Map.
   ═══════════════════════════════════════════════════════════════ */

/* Load-More: volle Breite, solider BG, ueberlagert Map */
body.in-discovery #mainLayout.map-visible .load-more {
    position: relative;
    z-index: 1001;
    padding: 40px 0 0 0;
    text-align: center;
    width: 100vw !important;
    margin-left: calc(-1 * var(--container-padding)) !important;
    background: transparent;
}

/* Mehr Reisen laden — pink mit weisser Schrift */
.load-more-pill {
    background: var(--primary, #FF385C) !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 28px;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}
.load-more-pill:hover {
    background: var(--primary-dark, #e31c5f) !important;
    transform: translateY(-1px);
}

/* Footer: ueber der Map, volle Breite */
#siteFooter {
    position: relative;
    z-index: 1001;
}

/* Zweiten Footer aus modal-route-builder.php verstecken */
footer.footer:not(#siteFooter) {
    display: none !important;
}

/* Kein Overscroll nach dem Footer */
/* overflow handled above */


/* ═══════════════ TT-CARD STYLES (wie rahmen.php) ═══════════════ */

#discoverySection .routes-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
    gap: 20px !important;
}

.tt-card {
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #e8e8e8);
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.tt-card:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.tt-card-img {
    aspect-ratio: 4/3;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.tt-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.tt-card:hover .tt-card-img img {
    transform: scale(1.03);
}

.tt-card-body {
    padding: 12px 14px 14px;
}

.tt-card-location {
    font-size: 12px;
    color: #6b6b6b;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
}

.tt-card-flag {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
}

.tt-card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
    color: var(--text-primary, #222);
}

.tt-card-meta {
    font-size: 11px;
    color: #9a9a9a;
}

.tt-card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.tt-card-social {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Auth-only: Default versteckt, sichtbar wenn eingeloggt */
.tt-auth-only {
    display: none !important;
}

body.tt-logged-in .tt-auth-only {
    display: flex !important;
}

.tt-card-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.tt-score-pill {
    display: inline-flex !important;
    align-items: center;
    gap: 3px;
    padding: 3px 8px !important;
    border-radius: 50px !important;
    font-size: 10px !important;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    border: none !important;
}

.tt-score-pill [data-lucide], .tt-score-pill svg { width: 10px !important; height: 10px !important; }
.tt-score-pill.kultur { background: rgba(139,92,246,0.12) !important; color: #7c3aed !important; }
.tt-score-pill.natur { background: rgba(34,197,94,0.12) !important; color: #16a34a !important; }
.tt-score-pill.genuss { background: rgba(245,158,11,0.12) !important; color: #d97706 !important; }
.tt-score-pill.aktiv { background: rgba(59,130,246,0.12) !important; color: #2563eb !important; }
.tt-score-pill.ruhe { background: rgba(6,182,212,0.12) !important; color: #0891b2 !important; }
.tt-score-pill.familie { background: rgba(236,72,153,0.12) !important; color: #db2777 !important; }
.tt-score-pill.kultur [data-lucide],.tt-score-pill.kultur svg { color: #7c3aed !important; stroke: #7c3aed !important; }
.tt-score-pill.natur [data-lucide],.tt-score-pill.natur svg { color: #16a34a !important; stroke: #16a34a !important; }
.tt-score-pill.genuss [data-lucide],.tt-score-pill.genuss svg { color: #d97706 !important; stroke: #d97706 !important; }
.tt-score-pill.aktiv [data-lucide],.tt-score-pill.aktiv svg { color: #2563eb !important; stroke: #2563eb !important; }
.tt-score-pill.ruhe [data-lucide],.tt-score-pill.ruhe svg { color: #0891b2 !important; stroke: #0891b2 !important; }
.tt-score-pill.familie [data-lucide],.tt-score-pill.familie svg { color: #db2777 !important; stroke: #db2777 !important; }

/* Reise-Typ Badge oben links im Bild */
.tt-card-img .tt-rtyp-badge [data-lucide], .tt-card-img .tt-rtyp-badge svg {
    color: #1a1a1a !important;
    stroke: #1a1a1a !important;
}


/* ═══════════════ MOBILE ═══════════════ */
@media (max-width:768px) {
    .hero-title { font-size:32px; }
    .hero-subtitle { font-size:16px; margin-bottom:28px; }
    .hero-search-pill { max-width:100%; }
    .hero-search-section { padding:10px 16px; }
    .hero-search-section:nth-child(5) { display:none; }
    .hero-search-divider:nth-child(4) { display:none; }
    .hero-categories { gap:8px; }
    .hero-category-pill { font-size:12px; padding:6px 12px; }
    .hero-content { padding:0 16px; }
}
@media (max-width:480px) {
    .hero-title { font-size:26px; }
    .hero-subtitle { font-size:14px; }
    .hero-search-section:nth-child(3), .hero-search-divider:nth-child(2) { display:none; }
}
