/* style.css - ParkSezgi Apple Liquid Glass UI/UX Design System (Custom Palette Edition) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg-dark: #1A1033;       /* Midnight Violet Base */
    --accent-pink: #FF4FD8;   /* Neon Magenta / Danger */
    --accent-purple: #B45CFF; /* Electric Purple / Ambient */
    --accent-cyan: #4BE3FF;   /* Bright Cyan / Primary Active */
    --text-light: #FFF1FB;    /* Frost Pearl White */
    --apple-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
    --spring-curve: cubic-bezier(0.16, 1, 0.3, 1);
    --liquid-blur: blur(28px) saturate(200%) contrast(105%);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--apple-font);
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-dark);
    color: var(--text-light);
    letter-spacing: -0.015em;
    user-select: none;
}

#map {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 10;
}

/* Custom Leaflet Container */
.leaflet-container {
    background-color: var(--bg-dark);
    font-family: inherit;
}

/* ==========================================================================
   Apple Liquid Glass Design System (Palette: #1A1033, #FF4FD8, #B45CFF, #4BE3FF, #FFF1FB)
   ========================================================================== */

/* 1. Spatial Floating Island Panel (Kenar Çubuğu / Ada) */
.liquid-glass-panel {
    background: linear-gradient(135deg, rgba(180, 92, 255, 0.12) 0%, rgba(75, 227, 255, 0.04) 100%),
                rgba(26, 16, 51, 0.82);
    backdrop-filter: var(--liquid-blur);
    -webkit-backdrop-filter: var(--liquid-blur);
    border: 1px solid rgba(180, 92, 255, 0.24);
    box-shadow: 
        0 24px 60px -12px rgba(10, 5, 22, 0.75),
        0 0 0 1px rgba(255, 241, 251, 0.06) inset,
        0 1px 1px 0 rgba(255, 241, 251, 0.35) inset;
    transition: box-shadow 0.3s var(--spring-curve), transform 0.3s var(--spring-curve);
}

/* 2. Glass Cards (İç Bölüm & Kartlar) */
.liquid-glass-card {
    background: linear-gradient(135deg, rgba(180, 92, 255, 0.09) 0%, rgba(75, 227, 255, 0.03) 100%),
                rgba(38, 24, 74, 0.60);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(180, 92, 255, 0.18);
    box-shadow: 
        0 8px 24px -4px rgba(10, 5, 22, 0.4),
        inset 0 1px 1px 0 rgba(255, 241, 251, 0.2);
    border-radius: 18px;
    transition: all 0.28s var(--spring-curve);
}

.liquid-glass-card:hover {
    background: linear-gradient(135deg, rgba(180, 92, 255, 0.18) 0%, rgba(75, 227, 255, 0.08) 100%),
                rgba(45, 28, 88, 0.78);
    border-color: rgba(75, 227, 255, 0.45);
    box-shadow: 
        0 14px 34px -4px rgba(10, 5, 22, 0.6),
        0 0 22px rgba(75, 227, 255, 0.15),
        inset 0 1px 1.5px 0 rgba(255, 241, 251, 0.4);
    transform: translateY(-2px);
}

.liquid-glass-card:active {
    transform: scale(0.985);
}

/* 3. Apple Spotlight Arama Kutusu */
.spotlight-input-container {
    background: rgba(38, 24, 74, 0.52);
    border: 1px solid rgba(180, 92, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 4px 16px rgba(10, 5, 22, 0.35),
        inset 0 1px 1px rgba(255, 241, 251, 0.18);
    border-radius: 16px;
    transition: all 0.3s var(--spring-curve);
}

.spotlight-input-container:focus-within {
    background: rgba(45, 28, 88, 0.7);
    border-color: var(--accent-cyan);
    box-shadow: 
        0 0 0 3px rgba(75, 227, 255, 0.28),
        0 0 24px rgba(75, 227, 255, 0.2),
        0 12px 28px rgba(10, 5, 22, 0.5),
        inset 0 1px 1.5px rgba(255, 241, 251, 0.35);
    transform: translateY(-1px);
}

/* Arama Sonuçları Açılır Menüsü */
#search-results {
    background: rgba(26, 16, 51, 0.96) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(180, 92, 255, 0.28) !important;
    border-radius: 18px !important;
    box-shadow: 
        0 20px 40px -8px rgba(10, 5, 22, 0.8),
        inset 0 1px 1px rgba(255, 241, 251, 0.25) !important;
}

.search-item {
    transition: all 0.18s var(--spring-curve);
}

.search-item:hover {
    background-color: rgba(180, 92, 255, 0.2) !important;
    padding-left: 14px;
}

/* 4. Apple Segmented Control & Pill Butonlar */
.liquid-pill-btn {
    background: rgba(180, 92, 255, 0.08);
    border: 1px solid rgba(180, 92, 255, 0.2);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 13px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.24s var(--spring-curve);
    box-shadow: inset 0 1px 0.5px rgba(255, 241, 251, 0.15);
}

.liquid-pill-btn:hover {
    background: rgba(180, 92, 255, 0.18);
    border-color: rgba(75, 227, 255, 0.45);
    color: #ffffff;
    transform: translateY(-1px);
}

.liquid-pill-btn:active {
    transform: scale(0.96);
}

.liquid-pill-btn.active,
.liquid-pill-btn[data-active="true"] {
    background: rgba(75, 227, 255, 0.18) !important;
    border-color: rgba(75, 227, 255, 0.55) !important;
    box-shadow: 
        0 2px 8px rgba(10, 5, 22, 0.3),
        inset 0 1px 1px rgba(255, 241, 251, 0.2) !important;
    color: var(--accent-cyan) !important;
    font-weight: 600;
}

/* 5. iOS Tarzı Sıvı Mesafe Kaydırıcı */
input[type=range].liquid-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 7px;
    border-radius: 9999px;
    background: rgba(180, 92, 255, 0.18);
    outline: none;
    border: 1px solid rgba(180, 92, 255, 0.22);
    box-shadow: inset 0 1px 2px rgba(10, 5, 22, 0.5);
}

input[type=range].liquid-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-light);
    border: 2.5px solid var(--accent-cyan);
    box-shadow: 
        0 2px 10px rgba(10, 5, 22, 0.5),
        0 0 14px rgba(75, 227, 255, 0.85);
    cursor: pointer;
    transition: transform 0.16s var(--spring-curve), box-shadow 0.16s var(--spring-curve);
}

input[type=range].liquid-slider::-webkit-slider-thumb:hover {
    transform: scale(1.18);
    box-shadow: 
        0 4px 16px rgba(10, 5, 22, 0.6),
        0 0 20px rgba(75, 227, 255, 1);
}

input[type=range].liquid-slider::-webkit-slider-thumb:active {
    transform: scale(0.95);
}

/* 6. Apple Dynamic Island (Harita Üstü Canlı Tarama Bildirimi) */
.dynamic-island-badge {
    background: rgba(26, 16, 51, 0.88);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border: 1px solid rgba(180, 92, 255, 0.3);
    box-shadow: 
        0 20px 40px -8px rgba(10, 5, 22, 0.7),
        0 0 26px rgba(75, 227, 255, 0.25),
        inset 0 1px 1px rgba(255, 241, 251, 0.35);
    border-radius: 9999px;
    transition: all 0.4s var(--spring-curve);
}

/* 7. Apple Sheet Tutamaç (Bottom Sheet Grab Handle) */
.sheet-grab-handle {
    width: 40px;
    height: 4.5px;
    border-radius: 9999px;
    background: rgba(255, 241, 251, 0.3);
    margin: 0 auto 10px auto;
    transition: background 0.2s ease;
}

.sheet-grab-handle:hover {
    background: rgba(255, 241, 251, 0.55);
}

/* 8. VisionOS Harita Katman Seçici Kapsülü */
.map-layer-selector {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 35;
}

.map-layer-selector select {
    background: rgba(26, 16, 51, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(180, 92, 255, 0.25) !important;
    box-shadow: 
        0 8px 24px rgba(10, 5, 22, 0.5),
        inset 0 1px 1px rgba(255, 241, 251, 0.25) !important;
    border-radius: 14px !important;
    color: var(--text-light) !important;
    transition: all 0.25s var(--spring-curve) !important;
}

.map-layer-selector select:hover {
    border-color: var(--accent-cyan) !important;
    transform: translateY(-1px);
}

/* ==========================================================================
   Harita Ögeleri & Rozetler
   ========================================================================== */

/* Canlı Sonar / Radar Dalgası */
.radar-scanner-container {
    position: relative;
    width: 80px;
    height: 80px;
    pointer-events: none;
}

.radar-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #38bdf8;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, rgba(56, 189, 248, 0.08) 50%, transparent 100%);
    animation: radar-pulse 2.2s cubic-bezier(0.1, 0.4, 0.2, 1) infinite;
    pointer-events: none;
}

.radar-wave-2 {
    animation-delay: 0.7s;
}

.radar-wave-3 {
    animation-delay: 1.4s;
}

@keyframes radar-pulse {
    0% {
        width: 10px;
        height: 10px;
        opacity: 1;
        border-width: 3px;
    }
    70% {
        opacity: 0.5;
    }
    100% {
        width: 380px;
        height: 380px;
        opacity: 0;
        border-width: 1px;
    }
}

/* Hedef Marker */
.target-marker-icon {
    position: relative;
    width: 24px;
    height: 24px;
    background: #ef4444;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.85);
}

.target-marker-icon::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    width: 34px;
    height: 34px;
    border: 2px solid #ef4444;
    border-radius: 50%;
    animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.6);
        opacity: 1;
    }
    100% {
        transform: scale(1.7);
        opacity: 0;
    }
}

/* Harita Üzerindeki #1, #2, #3 Öneri Rozetleri */
.rank-badge-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 800;
    font-size: 11px;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transition: transform 0.28s var(--spring-curve);
    position: relative;
}

.rank-badge-marker:hover {
    transform: scale(1.24);
    z-index: 1000 !important;
}

.rank-badge-1 {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 2.5px solid #ffffff;
    color: #ffffff;
    width: 38px;
    height: 38px;
    animation: bounce-gentle 2.4s infinite;
}

.rank-badge-1::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 9999px;
    border: 2px solid #10b981;
    animation: pulse-ring 2s infinite;
}

.rank-badge-2 {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    border: 2px solid #ffffff;
    color: #ffffff;
    width: 34px;
    height: 34px;
}

.rank-badge-3 {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    border: 2px solid #ffffff;
    color: #ffffff;
    width: 32px;
    height: 32px;
}

@keyframes bounce-gentle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Yürüme Çizgisi */
.animated-walking-route {
    stroke-dasharray: 8, 12;
    animation: dash-move 1.2s linear infinite;
    filter: drop-shadow(0 0 8px #0284c7);
}

@keyframes dash-move {
    to {
        stroke-dashoffset: -40;
    }
}

/* Leaflet Zoom Kontrolü (Apple Kapsülü) */
.leaflet-bar {
    border: none !important;
    box-shadow: 0 8px 24px rgba(10, 5, 22, 0.5) !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    background: rgba(26, 16, 51, 0.85) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(180, 92, 255, 0.22) !important;
}

.leaflet-bar a {
    background-color: transparent !important;
    color: var(--text-light) !important;
    border-bottom: 1px solid rgba(180, 92, 255, 0.15) !important;
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    font-size: 15px !important;
    transition: all 0.2s ease !important;
}

.leaflet-bar a:hover {
    background-color: rgba(180, 92, 255, 0.25) !important;
    color: var(--accent-cyan) !important;
}

/* Leaflet Atıf Barı */
.leaflet-control-attribution {
    background: rgba(26, 16, 51, 0.85) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    color: rgba(255, 241, 251, 0.6) !important;
    font-size: 10px !important;
    padding: 3px 10px !important;
    border-top-left-radius: 10px;
    border: 1px solid rgba(180, 92, 255, 0.18);
    border-bottom: none;
    border-right: none;
}
.leaflet-control-attribution a {
    color: var(--accent-cyan) !important;
    text-decoration: none !important;
    font-weight: 500;
}
.leaflet-control-attribution a:hover {
    text-decoration: underline !important;
    color: var(--accent-pink) !important;
}

/* Kademeli Akışkan Giriş Animasyonu */
@keyframes liquid-fade-slide {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-liquid-in {
    animation: liquid-fade-slide 0.32s var(--spring-curve) both;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(180, 92, 255, 0.25);
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(180, 92, 255, 0.45);
}

/* Loading Spinner */
.spinner {
    border: 2.5px solid rgba(180, 92, 255, 0.18);
    border-radius: 50%;
    border-top: 2.5px solid var(--accent-cyan);
    width: 18px;
    height: 18px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sokak çizgisi hover */
.leaflet-interactive:hover {
    filter: drop-shadow(0 0 10px currentColor);
}

/* ==========================================================================
   Apple Maps Tarzı 3-Kademeli Mobil Alt Çekmece (Bottom Sheet) & GPS FAB
   ========================================================================== */
@media (max-width: 767px) {
    #sidebar {
        height: 50vh;
        transition: height 0.38s cubic-bezier(0.16, 1, 0.3, 1), transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
        will-change: height;
        overflow: hidden;
    }

    #sidebar.sheet-peek {
        height: 74px !important;
    }

    #sidebar.sheet-half {
        height: 50vh !important;
    }

    #sidebar.sheet-full {
        height: 86vh !important;
    }

    /* Peek modundayken iç listenin taşmasını önle */
    #sidebar.sheet-peek .sidebar-scroll-content {
        opacity: 0;
        pointer-events: none;
    }

    .sidebar-scroll-content {
        transition: opacity 0.22s ease;
    }

    #sheet-header-handle {
        touch-action: none;
    }
}

@media (min-width: 768px) {
    #sheet-mini-peek {
        display: none !important;
    }
}

/* Apple GPS Floating Action Button */
.apple-gps-fab {
    background: rgba(26, 16, 51, 0.88) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(180, 92, 255, 0.3) !important;
    box-shadow: 
        0 12px 30px rgba(10, 5, 22, 0.65),
        inset 0 1px 1px rgba(255, 241, 251, 0.25) !important;
    color: var(--accent-cyan) !important;
    transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.apple-gps-fab:hover {
    border-color: var(--accent-cyan) !important;
    box-shadow: 
        0 14px 34px rgba(10, 5, 22, 0.7),
        0 0 18px rgba(75, 227, 255, 0.35),
        inset 0 1px 1px rgba(255, 241, 251, 0.35) !important;
    transform: scale(1.06);
}

.apple-gps-fab:active {
    transform: scale(0.92) !important;
}

/* ============================================
   Topluluk Değerlendirme Sistemi (Star Rating)
   ============================================ */

.star-rating-input .star-btn {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, transform 0.15s ease;
    padding: 2px;
    line-height: 1;
}

.star-rating-input .star-btn:hover {
    transform: scale(1.2);
}

.star-rating-input .star-btn.active {
    color: #f59e0b !important;
}

.star-rating-input .star-btn.hover-preview {
    color: #f59e0b !important;
    opacity: 0.7;
}

.star-rating-input .star-btn:active {
    transform: scale(0.9);
}

/* Community stars (read-only display) */
#community-stars-visual .star-filled {
    color: #f59e0b;
}

#community-stars-visual .star-half {
    color: #f59e0b;
    opacity: 0.5;
}

#community-stars-visual .star-empty {
    color: rgba(255, 241, 251, 0.15);
}

/* Rating textarea focus glow */
#rating-comment:focus {
    box-shadow: 0 0 0 2px rgba(75, 227, 255, 0.15);
}

/* Distribution bars animation */
#community-distribution [id^="dist-bar-"] {
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
