/* Rota Detay Sayfası: Numaralı Harita Pinleri, Kampçı Karikatürü & Hikaye Eşleşmesi */

#route-map-section {
    scroll-margin-top: 84px;
}

.route-map-stage {
    position: relative;
    border-radius: var(--radius-lg, 20px);
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    background: #0b1220;
    box-shadow: 0 14px 34px rgba(2, 6, 23, 0.45);
}

.route-map-stage #route-map {
    border: none;
    border-radius: 0;
}

/* Özel Leaflet Pane Katman Sırası: Glow (410) < Çizgi (420) < Numaralı Duraklar (470) < Karikatür Kampçı (520) */
.leaflet-pane.leaflet-routeGlow-pane {
    z-index: 410;
    pointer-events: none;
}

.leaflet-pane.leaflet-routeLine-pane {
    z-index: 420;
    pointer-events: none;
}

.leaflet-pane.leaflet-routeStop-pane {
    z-index: 470;
}

.leaflet-pane.leaflet-routeCamper-pane {
    z-index: 520;
}

/* Numaralı Durak Pinleri */
.route-stop-pin-wrapper {
    background: transparent;
    border: none;
}

.route-stop-pin {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    color: #ffffff;
    border: 2.5px solid #ffffff;
    box-shadow: 0 4px 12px rgba(2, 6, 23, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transform: translate(var(--pin-dx, 0px), var(--pin-dy, 0px));
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.route-stop-pin:hover {
    transform: translate(var(--pin-dx, 0px), var(--pin-dy, 0px)) scale(1.14);
}

.route-stop-pin-wrapper.is-visited-stop .route-stop-pin {
    border-color: #34d399;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.32), 0 4px 12px rgba(2, 6, 23, 0.55);
}

.route-stop-pin-wrapper.is-active-stop .route-stop-pin {
    transform: translate(var(--pin-dx, 0px), var(--pin-dy, 0px)) scale(1.22);
    background: linear-gradient(135deg, var(--route-char-color, #10b981) 0%, #0284c7 100%);
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.3), 0 6px 18px rgba(2, 6, 23, 0.68);
    animation: routeStopPulse 1.8s ease-in-out infinite;
}

.route-stop-pin-wrapper.is-selected-stop .route-stop-pin {
    transform: translate(var(--pin-dx, 0px), var(--pin-dy, 0px)) scale(1.26);
    border-color: #fde047;
    box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.35), 0 6px 18px rgba(2, 6, 23, 0.72);
}

@keyframes routeStopPulse {
    0%, 100% {
        box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.28), 0 6px 16px rgba(2, 6, 23, 0.65);
    }
    50% {
        box-shadow: 0 0 0 9px rgba(56, 189, 248, 0.12), 0 6px 20px rgba(2, 6, 23, 0.75);
    }
}

/* Gezen Kampçı / Karavan Karikatürü */
.route-camper-wrapper {
    background: transparent;
    border: none;
}

.route-camper-badge {
    position: relative;
    transform: translate(-50%, -64%);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    pointer-events: auto;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.2s ease;
}

.route-camper-badge:hover {
    transform: translate(-50%, -68%) scale(1.07);
}

.route-cartoon-sticker {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 6px 12px rgba(2, 6, 23, 0.55));
}

.route-cartoon-svg {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 0.2s ease;
}

.route-camper-badge.is-mode-travel.is-west .route-cartoon-svg {
    transform: scaleX(-1);
}

.route-camper-badge.is-role-family.is-mode-travel .route-cartoon-sticker {
    animation: routeDriveBounce 1.1s ease-in-out infinite;
}

.route-camper-badge.is-role-solo.is-mode-travel .route-cartoon-sticker {
    animation: routeWalkBob 0.72s ease-in-out infinite;
}

.route-camper-badge.is-mode-camp .route-cartoon-sticker {
    animation: routeCampSway 3.2s ease-in-out infinite;
}

.route-camper-badge .cartoon-flame {
    transform-origin: 50px 46px;
    animation: routeFlameFlicker 0.9s ease-in-out infinite;
}

.route-camper-badge .cartoon-puff,
.route-camper-badge .cartoon-steam {
    animation: routeFloatFade 1.6s ease-out infinite;
}

.route-camper-badge .cartoon-puff-2,
.route-camper-badge .cartoon-steam-2 {
    animation-delay: 0.65s;
}

.route-cartoon-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.94);
    border: 1.5px solid var(--route-char-color, #10b981);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    color: #f8fafc;
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

.route-cartoon-tag-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--route-char-color, #10b981);
    flex-shrink: 0;
}

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

@keyframes routeWalkBob {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-2.5px) rotate(3deg); }
}

@keyframes routeCampSway {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.035); }
}

@keyframes routeFlameFlicker {
    0%, 100% { transform: scaleY(1) scaleX(1); }
    50% { transform: scaleY(1.12) scaleX(0.94); }
}

@keyframes routeFloatFade {
    0% { opacity: 0.88; transform: translateY(0) scale(0.92); }
    100% { opacity: 0; transform: translateY(-4px) scale(1.16); }
}

/* Harita Üzerindeki Durum ve Kontrol HUD Çubuğu */
.route-map-hud {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 650;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    max-width: calc(100% - 210px);
    padding: 0.45rem 0.6rem 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.52);
    color: #f8fafc;
}

.route-hud-status {
    display: flex;
    align-items: center;
    gap: 0.48rem;
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 600;
}

.route-hud-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--route-char-color, #10b981);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    flex-shrink: 0;
}

.route-hud-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.route-hud-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    flex-shrink: 0;
}

.route-hud-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(30, 41, 59, 0.92);
    color: #f8fafc;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.route-hud-btn:hover {
    background: rgba(59, 130, 246, 0.28);
    border-color: rgba(96, 165, 250, 0.65);
}

.route-hud-btn.is-toggle {
    width: auto;
    padding: 0 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    gap: 0.3rem;
}

.route-map-stage .leaflet-control-attribution {
    background: rgba(15, 23, 42, 0.78);
    color: #cbd5e1;
    font-size: 10px;
}

.route-map-stage .leaflet-control-attribution a {
    color: #93c5fd;
}

/* Hover Tooltip & Durak Popup */
.leaflet-tooltip.route-stop-tooltip {
    background: rgba(15, 23, 42, 0.95);
    color: #f8fafc;
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 8px;
    padding: 5px 9px;
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.leaflet-tooltip.route-stop-tooltip::before {
    border-top-color: rgba(15, 23, 42, 0.95);
}

.route-stop-popup-wrap .leaflet-popup-content-wrapper {
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.65);
}

.route-stop-popup-wrap .leaflet-popup-tip {
    background: #0f172a;
}

.route-stop-popup {
    min-width: 195px;
    max-width: 245px;
    font-family: 'Inter', sans-serif;
}

.route-stop-popup-thumb {
    width: 100%;
    height: 84px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.45rem;
    display: block;
}

.route-stop-popup-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

.route-stop-popup-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.route-stop-popup-title {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.3;
    color: #f8fafc;
}

.route-stop-popup-meta {
    font-size: 0.76rem;
    color: #94a3b8;
    margin-bottom: 0.45rem;
}

.route-stop-popup-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.route-stop-popup-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    text-decoration: none;
}

.route-stop-popup-link:hover {
    background: rgba(56, 189, 248, 0.22);
}

/* Hikaye Bölümü Üstündeki Numaralı Durak Şeridi */
.story-stops-strip {
    background: rgba(15, 23, 42, 0.68);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}

.story-stops-strip-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.story-stops-strip-label i {
    color: #38bdf8;
}

.story-stops-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.48rem;
}

.story-stop-chip {
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    max-width: 100%;
    padding: 0.32rem 0.7rem 0.32rem 0.38rem;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.story-stop-chip:hover {
    border-color: rgba(56, 189, 248, 0.65);
    background: rgba(30, 58, 138, 0.45);
    transform: translateY(-1px);
}

.story-stop-chip:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.story-stop-chip-num {
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.74rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.story-stop-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.story-stop-chip.is-camper-active {
    border-color: rgba(16, 185, 129, 0.75);
    background: rgba(16, 185, 129, 0.18);
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.story-stop-chip.is-camper-active .story-stop-chip-num {
    background: linear-gradient(135deg, #10b981, #059669);
}

.story-stop-chip.is-selected-stop {
    border-color: rgba(250, 204, 21, 0.85);
    background: rgba(234, 179, 8, 0.16);
    color: #fef9c3;
}

/* Hikaye Paragrafı Satır İçi Numaralı Yer Rozetleri */
.story-stop-ref {
    display: inline;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    padding: 0.08rem 0.42rem 0.1rem 0.22rem;
    border-radius: 7px;
    background: rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.38);
    color: #f8fafc;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.story-stop-ref:hover {
    background: rgba(56, 189, 248, 0.28);
    border-color: rgba(125, 211, 252, 0.78);
}

.story-stop-ref:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.story-stop-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25em;
    height: 1.25em;
    padding: 0 0.26em;
    margin-right: 0.3em;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #ffffff;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.72em;
    font-weight: 800;
    line-height: 1;
    vertical-align: 0.06em;
    box-shadow: 0 1px 4px rgba(2, 6, 23, 0.45);
}

.story-stop-ref.is-camper-active {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(52, 211, 153, 0.78);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}

.story-stop-ref.is-camper-active .story-stop-num {
    background: linear-gradient(135deg, #10b981, #059669);
}

.story-stop-ref.is-selected-stop {
    background: rgba(234, 179, 8, 0.22);
    border-color: rgba(250, 204, 21, 0.85);
}

.story-stop-ref.is-selected-stop .story-stop-num {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Gün Gün Rota Akışı Kartlarında Alt Durak Aralığı ve Çipleri */
.stop-index.is-range {
    width: auto;
    min-width: 42px;
    padding: 0 0.75rem;
    border-radius: 999px;
    font-size: 1rem;
}

.stop-sub-stops-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.05rem;
    padding: 0.65rem 0.85rem;
    background: rgba(15, 23, 42, 0.58);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 12px;
}

.stop-sub-stops-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: #94a3b8;
    margin-right: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.stop-sub-stops-label i {
    color: #38bdf8;
}

@media (max-width: 640px) {
    .route-map-stage #route-map {
        height: 350px;
    }

    .route-stop-popup-thumb {
        height: 62px;
    }

    .route-stop-pin {
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
        border-width: 2px;
    }

    .route-cartoon-sticker {
        width: 40px;
        height: 40px;
    }

    .route-cartoon-tag {
        font-size: 0.56rem;
        padding: 1px 6px;
    }

    .route-map-hud {
        left: 8px;
        right: 8px;
        bottom: 24px;
        max-width: none;
        padding: 0.36rem 0.5rem 0.36rem 0.65rem;
        gap: 0.4rem;
    }

    .route-hud-text {
        font-size: 0.72rem;
    }

    .route-hud-btn {
        width: 26px;
        height: 26px;
        font-size: 0.78rem;
    }

    .route-hud-btn.is-toggle {
        padding: 0 0.52rem;
        font-size: 0.68rem;
    }

    .story-stops-strip {
        padding: 0.75rem;
    }

    .story-stop-chip {
        font-size: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .route-stop-pin,
    .route-stop-pin-wrapper.is-active-stop .route-stop-pin,
    .route-camper-badge,
    .route-cartoon-sticker,
    .route-cartoon-svg,
    .cartoon-flame,
    .cartoon-puff,
    .cartoon-steam {
        animation: none !important;
        transition: none !important;
    }
}

/* Karayolu KM Rozetleri & Gündüz/Gece Siklüs Katmanları */
.route-detail-km-marker {
    background: transparent;
    border: none;
}

.route-detail-leg-km-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transform: translate(calc(-50% + var(--km-dx, 0px)), calc(-50% + var(--km-dy, 0px)));
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    border: 1.5px solid var(--leg-day-color, #38bdf8);
    color: #f8fafc;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(2, 6, 23, 0.55);
    cursor: pointer;
}

.route-detail-leg-km-pill.is-compact .rdk-dur {
    display: none;
}

.route-detail-leg-km-pill.is-hidden {
    display: none !important;
}

.route-detail-leg-km-pill .rdk-dur {
    color: #94a3b8;
    font-weight: 600;
}

.route-detail-stop-cycle {
    position: absolute;
    left: 50%;
    top: calc(100% + 2px);
    transform: translateX(-50%);
    padding: 1px 5px;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 800;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(2, 6, 23, 0.55);
}

.route-detail-stop-cycle.is-day {
    background: rgba(15, 23, 42, 0.92);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.55);
}

.route-detail-stop-cycle.is-night {
    background: linear-gradient(135deg, #312e81, #4f46e5);
    color: #eef2ff;
    border: 1px solid #818cf8;
}

.route-detail-night-overlay {
    position: absolute;
    inset: 0;
    z-index: 430;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(circle at 50% 45%, rgba(15, 23, 42, 0.08) 0%, rgba(15, 23, 42, 0.42) 65%, rgba(30, 27, 75, 0.62) 100%);
    box-shadow: inset 0 0 0 2px rgba(129, 140, 248, 0.35);
    transition: opacity 0.4s ease;
}

.route-detail-night-overlay.is-night {
    opacity: 1;
}
