/**
 * Talk With Me - Leaflet.js Map & Location Analytics Master Stylesheet
 */

.leaflet-map-container {
    height: 500px;
    width: 100%;
    border-radius: 18px;
    border: 1px solid var(--border-glass);
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
    background: #10040a;
}

/* Custom Dark Leaflet Tile Filter for Aesthetic Romantic Blend */
.leaflet-tile-pane {
    filter: brightness(0.68) invert(1) contrast(1.2) hue-rotate(190deg) saturate(0.6);
}

/* Dark Custom Leaflet Zoom Controls */
.leaflet-control-zoom {
    border: 1px solid var(--border-glass) !important;
    border-radius: 12px !important;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5) !important;
    margin: 16px !important;
}

.leaflet-control-zoom a {
    background: rgba(28, 8, 20, 0.92) !important;
    color: #fdf6f8 !important;
    border-bottom: 1px solid var(--border-glass) !important;
    backdrop-filter: blur(12px);
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    font-size: 1.1rem !important;
    transition: var(--transition-smooth);
}

.leaflet-control-zoom a:last-child {
    border-bottom: none !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(255, 107, 139, 0.3) !important;
    color: #ffffff !important;
}

/* Leaflet Attribution Bar */
.leaflet-control-attribution {
    background: rgba(18, 5, 12, 0.85) !important;
    color: var(--text-muted) !important;
    border-radius: 8px;
    padding: 3px 10px !important;
    font-size: 0.72rem !important;
    border: 1px solid var(--border-glass);
    margin: 10px !important;
    backdrop-filter: blur(8px);
}

.leaflet-control-attribution a {
    color: var(--rose-primary) !important;
    text-decoration: none;
}

/* Custom Map Pins */
.custom-map-pin-wrapper {
    background: transparent;
    border: none;
}

.custom-map-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--rose-primary), var(--wine-accent));
    border: 2px solid #ffffff;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 0 16px var(--rose-glow), 0 4px 12px rgba(0, 0, 0, 0.6);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-map-pin:hover {
    transform: scale(1.3);
    z-index: 999;
}

.custom-map-pin.human-active {
    background: linear-gradient(135deg, #f59e0b, #b45309);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.7), 0 4px 12px rgba(0, 0, 0, 0.6);
}

.custom-map-pin::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2px solid var(--rose-primary);
    animation: pinPulse 2s infinite;
    pointer-events: none;
}

.custom-map-pin.human-active::after {
    border-color: #f59e0b;
}

@keyframes pinPulse {
    0% { transform: scale(1); opacity: 0.85; }
    100% { transform: scale(1.9); opacity: 0; }
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
    background: rgba(28, 9, 20, 0.96) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 16px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.65), 0 0 20px rgba(255, 107, 139, 0.2) !important;
    color: var(--text-primary) !important;
    padding: 8px !important;
    backdrop-filter: blur(16px);
}

.leaflet-popup-tip {
    background: rgba(28, 9, 20, 0.96) !important;
}

.popup-city-card {
    padding: 6px 8px;
    min-width: 190px;
}

.popup-city-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--rose-primary);
    margin-bottom: 2px;
    line-height: 1.2;
}

.popup-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 14px;
    font-size: 0.74rem;
    font-weight: 600;
    margin-right: 4px;
    margin-top: 5px;
}

.badge-visitors { background: rgba(59, 130, 246, 0.2); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.35); }
.badge-ai-chats { background: rgba(139, 92, 246, 0.2); color: #c084fc; border: 1px solid rgba(139, 92, 246, 0.35); }
.badge-human-chats { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.35); }

/* Premium Modern KPI Card (No Truncation / No Cutoff) */
.analytics-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 112px;
}

.analytics-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--rose-primary), transparent);
    opacity: 0.5;
}

.analytics-kpi-card:hover {
    border-color: var(--rose-primary);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4), 0 0 16px rgba(255, 107, 139, 0.15);
}

.analytics-kpi-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.analytics-kpi-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.analytics-kpi-card .stat-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.analytics-kpi-card .stat-val-number {
    font-size: 1.85rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.analytics-kpi-card .stat-val-text {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
    margin-top: 2px;
}

/* Map Filter Toolbar */
.map-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: rgba(18, 5, 12, 0.65);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
}

.map-filter-toolbar .btn-glass.active {
    background: linear-gradient(135deg, var(--rose-primary), var(--wine-accent));
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 15px var(--rose-glow);
    font-weight: 600;
}

/* User Location Consent Banner */
.location-consent-banner {
    position: fixed;
    bottom: 80px;
    left: 20px;
    max-width: 360px;
    background: rgba(30, 10, 20, 0.96);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px);
    z-index: 1040;
    animation: slideUpConsent 0.35s ease-out;
}

@keyframes slideUpConsent {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
