﻿:root {
    /* Score colors */
    --score-excellent: #70df7d;
    --score-good: #ecc267;
    --score-fair: #ff6c6f;
    --score-poor: #dc2626;

    /* Category colors */
    --cat-food: #ea580c;
    --cat-coffee: #78350f;
    --cat-shopping: #2563eb;
    --cat-transport: #16a34a;
    --cat-health: #dc2626;
    --cat-fitness: #7c3aed;
    --cat-education: #ca8a04;
    --cat-nightlife: #4f46e5;
    --cat-other: #4b5563;

    /* UI - Light theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);

    /* Accent colors */
    --accent: #3a4282;
    --accent-hover: color-mix(in srgb, var(--accent) 80%, black);
    --secondary: #e2e8f0;
    --secondary-hover: color-mix(in srgb, var(--secondary) 80%, black);
}

.amenity-widget-embed * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.amenity-widget-embed {
    margin: 2em 0;
}

/* Map */
.map-container {
    width: 100%;
    height: 500px;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* Filters - toolbar grid */
.filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    background: var(--secondary);
    border: 0 none;
    color: var(--text-secondary);
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
    white-space: normal;
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.filter-btn:hover {
    background: var(--secondary-hover);
}

.filter-btn.active:hover {
    background: var(--accent-hover);
}

@media (min-width: 768px) {
    .filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .filters {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Panel */
.panel {
    height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-primary);
}

/* Scores Grid */
.scores-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.scores-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.score-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    border: 1px solid var(--border);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.score-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.score-ring-container {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 8px;
}

.score-ring {
    transform: rotate(-90deg);
}

.score-ring .bg {
    fill: none;
    stroke: var(--bg-card);
    stroke-width: 6;
}

.score-ring .fill {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 201;
    stroke-dashoffset: 201;
    transition: stroke-dashoffset 1s ease-out;
}

.score-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 400;
}

.score-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.score-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Category Summaries */

.summaries-section {
    margin-bottom: 24px;
}

.summary-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.summary-icon {
    font-size: 1.3rem;
}

.summary-title {
    font-weight: 600;
    flex: 1;
}

.summary-count {
    background: var(--bg-card);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.summary-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.summary-items {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    margin: 0 -8px;
    font-size: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.summary-item:hover {
    background: var(--bg-card);
}

.summary-item-name {
    color: var(--text-primary);
}

.summary-item-time {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Marker highlight on hover */
.marker-highlight .marker-icon {
    animation: marker-bounce 0.4s ease;
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.3) !important;
    transform: scale(1.2);
}

@keyframes marker-bounce {
    0%,
    100% {
        transform: scale(1.2) translateY(0);
    }

    50% {
        transform: scale(1.2) translateY(-6px);
    }
}

/* Error/Empty states */
.error-text {
    color: var(--score-poor);
    font-size: 0.9rem;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius);
    margin-top: 12px;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 25%,
        var(--bg-secondary) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    margin: 0 auto 8px;
}

.skeleton-text {
    height: 16px;
    width: 60%;
    margin: 0 auto;
}

/* Mobile/Tablet */
@media (max-width: 1023px) {
    .panel {
        width: 100%;
        height: auto;
    }

    .scores-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Leaflet overrides */
.leaflet-popup-content-wrapper {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.leaflet-popup-tip {
    background: var(--bg-secondary);
}

.leaflet-popup-content {
    margin: 12px 14px;
}

.leaflet-popup-content b {
    color: var(--text-primary);
}

/* Custom marker */
.category-marker {
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.9);
}

/* Cluster markers */
.marker-cluster {
    background: transparent !important;
}

.cluster-icon {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: 3px solid #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2563eb;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}
