/* ============================
   Interactive Community Map Detail Page
   ============================ */

/* Hero */
.detail-hero {
    padding: 130px 0 40px;
    text-align: center;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0f9ff 100%);
}

.detail-hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.detail-hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-dark, #1E293B);
    margin-bottom: 0.75rem;
}

.detail-hero-desc {
    font-size: 1rem;
    color: var(--text-gray, #64748B);
    line-height: 1.7;
}

/* Map Section */
.map-section {
    padding: 2rem 0 4rem;
}

.map-card {
    background: var(--card-bg, #fff);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color, #e2e8f0);
    position: relative;
}

/* Leaflet Map Container */
.leaflet-map-container {
    width: 100%;
    height: 65vh;
    min-height: 400px;
    z-index: 1;
}

/* Override Leaflet default popup styles */
.leaflet-popup-content-wrapper {
    border-radius: 16px !important;
    padding: 0 !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 280px !important;
}

.leaflet-popup-tip {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Custom Popup Card inside Leaflet */
.popup-card {
    font-family: 'Inter', sans-serif;
}

.popup-card-img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.popup-card-body {
    padding: 1rem 1.25rem 1.25rem;
}

.popup-card-city {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.15rem;
}

.popup-card-city-zh {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0.6rem;
}

.popup-card-spot {
    font-size: 0.85rem;
    font-weight: 600;
    color: #059669;
    margin-bottom: 0.35rem;
}

.popup-card-address {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.65rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #10b981;
}

.popup-card-desc {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.popup-card-actions {
    display: flex;
    gap: 0.5rem;
}

.popup-card-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.popup-card-btn--primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.popup-card-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.popup-card-btn--secondary {
    background: #f1f5f9;
    color: #475569;
}

.popup-card-btn--secondary:hover {
    background: #e2e8f0;
}

.popup-card-btn.copied {
    background: #22c55e !important;
    color: white !important;
}

/* More spots indicator */
.popup-card-more {
    text-align: center;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
    margin-top: 0.5rem;
}

.popup-card-more-btn {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.popup-card-more-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Map Legend */
.map-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: #fafbfc;
    border-top: 1px solid #f1f5f9;
}

.map-subtitle {
    text-align: center;
    padding: 0.75rem 1.5rem 1rem;
    background: #fafbfc;
}

.map-subtitle p {
    font-size: 0.82rem;
    color: #94a3b8;
    font-weight: 500;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot--hot,
.legend-dot--popular,
.legend-dot--emerging {
    background: linear-gradient(135deg, #F5A623 0%, #E8962A 100%);
    box-shadow: 0 0 8px rgba(245, 166, 35, 0.4);
}

/* City Detail Side Panel */
.city-detail-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    padding: 2rem 1.5rem;
}

.city-detail-panel.active {
    right: 0;
}

.panel-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.panel-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
}

.panel-city-icon {
    font-size: 2.5rem;
}

.panel-city-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.15rem;
}

.panel-city-tagline {
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Spot Cards in Panel */
.spot-card {
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.spot-card:hover {
    border-color: #10b981;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.1);
}

.spot-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.spot-card-body {
    padding: 1.25rem;
}

.spot-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.spot-card-address {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.6;
    padding: 0.65rem 0.85rem;
    background: #fff;
    border-radius: 8px;
    border-left: 3px solid #10b981;
    margin-bottom: 0.75rem;
}

.spot-card-desc {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.spot-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.spot-card-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 20px;
}

.spot-card-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.spot-card-copy-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.spot-card-copy-btn.copied {
    background: #22c55e;
}

/* Overlay for panel */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.panel-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Custom Leaflet marker pulse animation */
@keyframes markerPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(245, 166, 35, 0.4);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(245, 166, 35, 0);
    }
}

.custom-marker-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent !important;
    border: none !important;
}

.custom-marker {
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.custom-marker:hover {
    transform: scale(1.2);
}

.marker-label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 4px #fff;
    pointer-events: none;
    line-height: 1;
}

.custom-marker--brand {
    background: linear-gradient(135deg, #F5A623 0%, #E8962A 100%);
    animation: markerPulse 2.5s ease-in-out infinite;
}

/* Contact CTA Section */
.contact-cta-section {
    padding: 0 0 4rem;
}

.contact-cta-card {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.contact-cta-glow {
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(16, 185, 129, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 60%);
    pointer-events: none;
    animation: glowShift 6s ease-in-out infinite alternate;
}

@keyframes glowShift {
    0% {
        transform: translateX(-5%);
    }

    100% {
        transform: translateX(5%);
    }
}

.contact-cta-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 3.5rem 2rem;
}

.contact-cta-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.contact-cta-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
}

.contact-cta-desc {
    font-size: 1rem;
    color: #94a3b8;
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto 2rem;
}

.contact-cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.contact-btn-wa,
.contact-btn-ig {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 2rem;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'Inter', sans-serif;
}

.contact-btn-wa {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
}

.contact-btn-wa:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.4);
}

.contact-btn-ig {
    background: linear-gradient(135deg, #833AB4 0%, #C13584 30%, #E1306C 60%, #F77737 100%);
    color: #fff;
    box-shadow: 0 4px 20px rgba(193, 53, 132, 0.3);
}

.contact-btn-ig:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(193, 53, 132, 0.4);
}

.contact-btn-wa svg,
.contact-btn-ig svg {
    flex-shrink: 0;
}

.contact-cta-note {
    font-size: 0.85rem;
    color: #64748b;
}

/* Responsive */
@media (max-width: 768px) {
    .detail-hero {
        padding: 120px 0 30px;
    }

    .detail-hero-title {
        font-size: 1.6rem;
    }

    .leaflet-map-container {
        height: 55vh;
        min-height: 320px;
    }

    .map-legend {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .city-detail-panel {
        width: 100%;
        right: -100%;
    }

    .leaflet-popup-content {
        width: 240px !important;
    }

    .popup-card-img {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .detail-hero-title {
        font-size: 1.4rem;
    }

    .detail-hero-desc {
        font-size: 0.9rem;
    }

    .leaflet-map-container {
        height: 50vh;
        min-height: 280px;
    }
}