/* ═══════════════════════════════════════════
   Souper Map Marker — Frontend Styles v2.0
   ═══════════════════════════════════════════ */

.smm-map-container {
    --smm-accent: #ff6b35;
    --smm-height: 600px;
    --smm-radius: 10px;
    --smm-text: #2c3e50;
    --smm-text-light: #7f8c8d;
    --smm-bg: #ffffff;
    --smm-bg-glass: rgba(255, 255, 255, 0.92);
    --smm-border: #e1e5e9;
    --smm-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    border-radius: var(--smm-radius);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Map canvas */
.smm-map-canvas {
    width: 100%;
    height: var(--smm-height);
    z-index: 1;
}

/* Controls bar */
.smm-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    pointer-events: none;
}

.smm-controls > * {
    pointer-events: auto;
}

/* Search */
.smm-search-wrap {
    position: relative;
    flex: 0 1 280px;
    min-width: 180px;
}

.smm-search-input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: none;
    border-radius: 8px;
    background: var(--smm-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    font-size: 13px;
    color: var(--smm-text);
    box-shadow: var(--smm-shadow);
    outline: none;
    transition: box-shadow 0.2s;
    box-sizing: border-box;
}

.smm-search-input:focus {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 2px var(--smm-accent);
}

.smm-search-input::placeholder { color: var(--smm-text-light); }

.smm-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
}

/* Filter tags */
.smm-filter-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.smm-filter-btn {
    --tag-color: var(--smm-accent);
    padding: 7px 14px;
    border: none;
    border-radius: 20px;
    background: var(--smm-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--smm-text);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.smm-filter-btn:hover {
    background: var(--tag-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.smm-filter-btn.smm-filter-active {
    background: var(--tag-color);
    color: white;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--tag-color) 40%, transparent);
}

.smm-filter-emoji { font-size: 13px; }

/* Spot count */
.smm-spot-count {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 1000;
    background: var(--smm-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--smm-text-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.smm-count-number { color: var(--smm-accent); }

/* Custom popup styling */
.smm-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 0;
    overflow: hidden;
}

.smm-popup .leaflet-popup-content {
    margin: 0;
    min-width: 240px;
    max-width: 320px;
}

.smm-popup .leaflet-popup-tip { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08); }

.smm-popup-card {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.smm-popup-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.smm-popup-body { padding: 14px; }

.smm-popup-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e1e2e;
    margin: 0 0 6px;
    line-height: 1.3;
}

.smm-popup-address {
    font-size: 12px;
    color: #7f8c8d;
    margin: 0 0 6px;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.smm-popup-address::before { content: '📍'; font-size: 11px; flex-shrink: 0; }

.smm-popup-desc {
    font-size: 13px;
    color: #2c3e50;
    margin: 0 0 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.smm-popup-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.smm-popup-tag {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.smm-popup-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: var(--smm-accent);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: opacity 0.2s;
}

.smm-popup-link:hover { opacity: 0.85; color: white; }

/* Fullscreen button */
.smm-fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--smm-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    box-shadow: var(--smm-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.smm-fullscreen-btn:hover { background: var(--smm-accent); color: white; }

/* Locate me button */
.smm-locate-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 1000;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--smm-bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    box-shadow: var(--smm-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.smm-locate-btn:hover { background: var(--smm-accent); color: white; }

/* Sidebar popup style */
.smm-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 340px;
    max-width: 90%;
    z-index: 1001;
    background: var(--smm-bg);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.smm-sidebar.smm-sidebar-open { transform: translateX(0); }

.smm-sidebar-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smm-sidebar-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.smm-sidebar-body { padding: 20px; }
.smm-sidebar-title { font-size: 18px; font-weight: 700; margin: 0 0 8px; color: #1e1e2e; }
.smm-sidebar-address { font-size: 13px; color: #7f8c8d; margin-bottom: 12px; }
.smm-sidebar-desc { font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.smm-sidebar-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

/* Cluster styling */
.smm-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 13px;
    color: white;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.8);
}

.smm-cluster-small { width: 36px; height: 36px; background: var(--smm-accent); }
.smm-cluster-medium { width: 44px; height: 44px; background: color-mix(in srgb, var(--smm-accent) 80%, #333); font-size: 14px; }
.smm-cluster-large { width: 52px; height: 52px; background: color-mix(in srgb, var(--smm-accent) 60%, #333); font-size: 15px; }

/* Social links in popup/sidebar */
.smm-social-links {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.smm-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    text-decoration: none;
    font-size: 15px;
    transition: transform 0.2s, background 0.2s;
}

.smm-social-link:hover {
    transform: scale(1.15);
    background: rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .smm-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .smm-search-wrap { flex: 1 1 100%; }

    .smm-filter-tags {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .smm-filter-tags::-webkit-scrollbar { display: none; }

    .smm-sidebar { width: 100%; max-width: 100%; }
}

/* Leaflet overrides */
.smm-map-container .leaflet-control-zoom { border: none; box-shadow: var(--smm-shadow); border-radius: 8px; overflow: hidden; }
.smm-map-container .leaflet-control-zoom a { width: 32px; height: 32px; line-height: 32px; font-size: 16px; border: none !important; }
.smm-map-container .leaflet-control-zoom a:hover { background: var(--smm-accent); color: white; }
.smm-map-container .leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,0.7) !important; backdrop-filter: blur(4px); }

/* Scroll zoom hint */
.smm-scroll-hint {
    position: absolute;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 14px;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: var(--smm-radius);
}

.smm-scroll-hint.smm-scroll-hint-visible {
    opacity: 1;
}
