/**
 * =====================================================
 * Map-Specific Styles
 * =====================================================
 * 
 * Spezielle Styles für die Karten-Ansicht mit
 * MapLibre GL JS und benutzerdefinierten Overlays.
 */

/* CSS-Variable: Höhe der CTA-Infobar (wird per JS gesetzt) */
:root {
    --cta-bar-height: 0px;
}

/* =====================================================
   CTA INFO BANNER (nur auf der Kartenseite)
   ===================================================== */

.cta-notice-bar {
    position: fixed !important;
    top: 56px;                          /* direkt unter dem Navbar */
    left: 0;
    right: 0;
    z-index: 1015;                      /* unter Navbar (1020), über Karte (0) */
    background: rgba(10, 18, 35, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(59, 130, 246, 0.22);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: 0.55rem var(--space-lg);
    font-family: 'Inter', sans-serif;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary, #94a3b8);
}

.cta-notice-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    flex: 1;
    min-width: 0;
    text-align: center;
}

.cta-notice-content span {
    flex-shrink: 1;
    min-width: 0;
}

.cta-notice-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 600;
}

.cta-notice-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    padding: 0.375rem;
    border-radius: 4px;
    line-height: 0;
    opacity: 0.7;
    transition: opacity 0.15s, background 0.15s;
}

.cta-notice-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.07);
}

@media (max-width: 640px) {
    .cta-notice-bar {
        padding: 0.5rem var(--space-md);
        gap: var(--space-sm);
    }

    .cta-notice-content {
        flex-wrap: wrap;
        gap: var(--space-xs);
    }

    .cta-notice-content > svg {
        display: none;
    }
}

/* =====================================================
   MAP CONTAINER
   ===================================================== */

#map {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    /* Enable all touch gestures on the map */
    touch-action: pan-x pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
}

/* Ensure map doesn't overlap footer */
body {
    position: relative;
}

main {
    position: relative;
    z-index: 0;
}

/* MapLibre Attribution anpassen */
.maplibregl-ctrl-attrib {
    background: var(--glass-bg-strong) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary) !important;
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

.maplibregl-ctrl-attrib a {
    color: var(--primary-light) !important;
}

/* MapLibre Controls anpassen */
.maplibregl-ctrl-group {
    background: var(--glass-bg-strong) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
}

/* Map Controls nicht unter Header + CTA-Bar-Offset */
.maplibregl-ctrl-top-right {
    top: calc(80px + var(--cta-bar-height, 0px)) !important;
}

.maplibregl-ctrl-top-left {
    top: calc(80px + var(--cta-bar-height, 0px)) !important;
}

.maplibregl-ctrl-group button {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--divider) !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.maplibregl-ctrl-group button:last-child {
    border-bottom: none !important;
}

.maplibregl-ctrl-group button:hover {
    background: var(--glass-bg-light) !important;
}

.maplibregl-ctrl-icon {
    filter: brightness(0) invert(1);
    opacity: 0.8;
    width: 20px !important;
    height: 20px !important;
}

/* =====================================================
   MAP OVERLAYS & PANELS
   ===================================================== */

.map-overlay {
    position: fixed;
    z-index: var(--z-fixed);
    pointer-events: none;
}

.map-overlay > * {
    pointer-events: auto;
}

/* =====================================================
   ADDRESS SEARCH BAR
   ===================================================== */

.map-search-container {
    position: fixed;
    top: calc(80px + var(--cta-bar-height, 0px));
    right: 60px;
    z-index: var(--z-fixed);
    width: 320px;
    max-width: calc(100vw - 80px);
}

.map-search-box {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xs) var(--space-sm);
    box-shadow: var(--shadow-lg);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.map-search-box:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.map-search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.map-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: var(--space-xs) 0;
    min-width: 0;
}

.map-search-input::placeholder {
    color: var(--text-muted);
}

.map-search-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.map-search-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.map-search-btn:active {
    transform: scale(0.98);
}

/* Search Results Dropdown */
.map-search-results {
    position: absolute;
    top: calc(100% + var(--space-xs));
    left: 0;
    right: 0;
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 280px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
}

.map-search-results.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--divider);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--glass-bg-light);
}

.search-result-icon {
    color: var(--primary);
    flex-shrink: 0;
}

.search-result-text {
    font-size: 0.8125rem;
    color: var(--text-primary);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-no-results,
.search-error {
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-align: center;
    cursor: default;
}

.search-no-results:hover,
.search-error:hover {
    background: transparent;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .map-search-container {
        top: 56px;
        right: var(--space-sm);
        left: var(--space-sm);
        width: auto;
        max-width: none;
        z-index: 1000;
    }
    
    .search-input-wrapper {
        height: 44px;
    }
    
    .search-input {
        font-size: 16px; /* Prevents iOS zoom */
        height: 44px;
        padding: var(--space-sm) var(--space-md);
        padding-left: 44px;
    }
    
    .search-icon {
        left: 14px;
        width: 20px;
        height: 20px;
    }
    
    .search-clear-btn {
        width: 44px;
        height: 44px;
    }
}

/* Top Left Controls */
.map-overlay-top-left {
    top: calc(80px + var(--cta-bar-height, 0px));
    left: var(--space-md);
    max-width: 320px;
    max-height: calc(100vh - 120px - var(--cta-bar-height, 0px));
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.map-overlay-top-left.collapsed {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

/* Panel Collapse Button */
.panel-collapse-btn {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 150; /* Über dem Premium-Overlay (z-index: 100) */
}

.panel-collapse-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
    color: var(--text-primary);
}

/* Panel Expand Button (visible when collapsed) */
.panel-expand-btn {
    position: fixed;
    top: calc(80px + var(--cta-bar-height, 0px));
    left: 0;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    padding-left: var(--space-sm);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-left: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    z-index: var(--z-fixed);
    transition: all 0.2s;
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.panel-expand-btn.visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.panel-expand-btn:hover {
    background: rgba(30, 41, 59, 0.95);
    color: var(--text-primary);
    padding-right: var(--space-lg);
}

.panel-expand-btn svg {
    color: var(--primary);
}

/* Top Right Controls */
.map-overlay-top-right {
    top: var(--space-md);
    right: var(--space-md);
    max-width: 280px;
}

/* Bottom Left Info */
.map-overlay-bottom-left {
    bottom: var(--space-md);
    left: var(--space-md);
}

/* Bottom Right Info */
.map-overlay-bottom-right {
    bottom: var(--space-md);
    right: var(--space-md);
}

/* Control Panels */
.control-panel {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(59, 130, 246, 0.1);
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar für Control Panel */
.control-panel::-webkit-scrollbar {
    width: 6px;
}

.control-panel::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.3);
    border-radius: var(--radius-full);
}

.control-panel::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: var(--radius-full);
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.6);
}

.control-panel-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.control-panel-title svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.control-section {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--divider);
}

.control-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.control-section-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

/* =====================================================
   CATEGORY FILTERS
   ===================================================== */

.category-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.category-item:hover {
    background: var(--glass-bg-light);
}

.category-item input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--glass-bg-light);
    cursor: pointer;
    transition: all var(--transition-fast);
    accent-color: var(--primary);
}

.category-item span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* =====================================================
   WEIGHT CONTROLS
   ===================================================== */

.weight-control {
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.weight-control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.weight-label {
    font-size: 0.9375rem;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.weight-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary-light);
    font-family: inherit;
    min-width: 2rem;
    text-align: right;
    margin-left: var(--space-xs);
}

.weight-slider {
    flex: 1;
    height: 4px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: var(--radius-full);
    background: var(--primary);
    border: 2px solid var(--bg-base);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.weight-slider::-webkit-slider-thumb:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: scale(1.15);
}

.weight-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: var(--radius-full);
    background: var(--primary);
    border: 2px solid var(--bg-base);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.weight-slider::-moz-range-thumb:hover {
    background: var(--primary-light);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: scale(1.15);
}

/* =====================================================
   INFO BADGES & STATUS
   ===================================================== */

.info-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
}

.tile-mode-indicator {
    font-size: 0.75rem;
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

/* =====================================================
   LOADING OVERLAYS
   ===================================================== */

.loading-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: var(--z-modal);
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-xl);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.loading-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* =====================================================
   ERROR TOAST
   ===================================================== */

.error-toast {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    z-index: var(--z-tooltip);
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--danger);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(239, 68, 68, 0.3);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    transition: all var(--transition-base);
}

.error-toast.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.error-toast-icon {
    flex-shrink: 0;
    color: var(--danger-light);
}

.error-toast-text {
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* =====================================================
   NO DATA OVERLAY
   ===================================================== */

.no-data-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: var(--z-modal);
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-xl);
    text-align: center;
    max-width: 400px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.no-data-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.no-data-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    color: var(--text-muted);
}

.no-data-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.no-data-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* =====================================================
   FEATURE HINTS
   ===================================================== */

.feature-hint {
    padding: var(--space-md);
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
}

.feature-hint-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.feature-hint-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* =====================================================
   MAP POPUPS (MapLibre)
   ===================================================== */

.maplibregl-popup-content {
    background: var(--glass-bg-strong) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
    padding: var(--space-lg) !important;
    color: var(--text-primary) !important;
    min-width: 250px;
}

.maplibregl-popup-tip {
    border-top-color: var(--glass-bg-strong) !important;
}

.maplibregl-popup-close-button {
    color: var(--text-muted) !important;
    font-size: 1.5rem !important;
    padding: var(--space-xs) !important;
    right: var(--space-sm) !important;
    top: var(--space-sm) !important;
    transition: color var(--transition-fast);
}

.maplibregl-popup-close-button:hover {
    color: var(--text-primary) !important;
    background: transparent !important;
}

/* =====================================================
   RESPONSIVE MAP LAYOUT
   ===================================================== */

@media (max-width: 768px) {
    .map-overlay-top-left,
    .map-overlay-top-right {
        max-width: calc(100vw - 2rem);
        left: var(--space-md);
        right: var(--space-md);
    }
    
    .map-overlay-bottom-left,
    .map-overlay-bottom-right {
        left: var(--space-md);
        right: var(--space-md);
        bottom: var(--space-md); /* Kein Footer mehr auf Mobile */
    }
    
    .error-toast {
        top: 110px; /* Below search */
        right: var(--space-md);
        left: var(--space-md);
    }
    
    /* MapLibre zoom/compass controls - larger touch targets */
    .maplibregl-ctrl-top-right {
        top: 110px !important; /* Below search bar */
    }
    
    .maplibregl-ctrl-group button {
        width: 44px !important;
        height: 44px !important;
    }
    
    .maplibregl-ctrl-icon {
        width: 24px !important;
        height: 24px !important;
    }
    
    /* Attribution smaller on mobile */
    .maplibregl-ctrl-attrib {
        font-size: 0.625rem;
        padding: 0.25rem 0.5rem;
    }
}

/* =====================================================
   ADDITIONAL MAP COMPONENTS
   ===================================================== */

/* Legend */
.legend {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.legend-gradient {
    height: 12px;
    flex: 1;
    border-radius: var(--radius-sm);
    background: linear-gradient(to right, #bf1a1a, #f27319, #f2d926, #33c099, #27a640);
    border: 1px solid var(--border-color);
}

.legend-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Premium/Pro Badges */
.premium-badge,
.pro-badge {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    margin-left: var(--space-xs);
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.premium-badge {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: var(--bg-base);
}

.pro-badge {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: white;
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.toggle-switch {
    position: relative;
    width: 32px;
    height: 18px;
    background: rgba(100, 116, 139, 0.3);
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.toggle-switch:hover {
    border-color: var(--primary);
    background: rgba(100, 116, 139, 0.4);
}

.toggle-switch.active {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle-switch.active::after {
    transform: translateX(14px);
}

.toggle-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Debug Marker */
.debug-marker {
    width: 24px;
    height: 24px;
    background: var(--danger);
    border: 3px solid white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

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

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xs);
}

/* Category Weight Item (Unified List) */
.category-weight-item {
    padding: var(--space-xs) 0;
    border-radius: 0;
    background: transparent;
    transition: opacity var(--transition-fast);
    margin-bottom: 2px;
}

.category-weight-item:hover {
    opacity: 0.85;
}

/* Filter States */
.filter-disabled {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(0.5);
}

.filter-locked {
    position: relative;
}

.filter-locked::after {
    content: '🔒';
    position: absolute;
    right: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
}

/* =====================================================
   RESPONSIVE - Mobile Panel Collapsed by Default
   ===================================================== */

@media (max-width: 768px) {
    .map-overlay-top-left {
        top: 110px; /* Below search bar */
        left: var(--space-sm);
        max-width: calc(100vw - var(--space-lg));
        max-height: calc(100vh - 140px); /* Mehr Platz ohne Footer */
    }
    
    /* Collapsed by default on mobile */
    .map-overlay-top-left.mobile-default-collapsed {
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
    }
    
    .panel-expand-btn.mobile-default-visible {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }
    
    .panel-expand-btn {
        top: 110px; /* Below search bar */
        min-height: 48px;
        padding: var(--space-md) var(--space-lg);
        font-size: 1rem;
    }
    
    .control-panel {
        padding: var(--space-md);
    }
    
    /* Collapse Button größer und besser klickbar */
    .panel-collapse-btn {
        width: 44px;
        height: 44px;
        top: var(--space-sm);
        right: var(--space-sm);
    }
    
    .panel-collapse-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .control-panel-title {
        font-size: 1.125rem;
        padding-right: 52px; /* Platz für größeren Button */
    }
    
    /* Größere Schriften für Labels */
    .control-section-label {
        font-size: 1rem;
    }
    
    .weight-label {
        font-size: 0.9375rem;
    }
    
    .weight-value {
        font-size: 0.875rem;
    }
    
    .legend-label {
        font-size: 0.8125rem;
    }
    
    .form-help {
        font-size: 0.875rem;
    }
    
    /* Larger touch targets for toggles */
    .toggle-switch {
        width: 52px;
        height: 28px;
    }
    
    .toggle-switch::after {
        width: 24px;
        height: 24px;
    }
    
    .toggle-switch.active::after {
        transform: translateX(24px);
    }
    
    /* Larger weight sliders */
    .weight-slider {
        height: 8px;
    }
    
    .weight-slider::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }
    
    .weight-slider::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }
    
    /* Touch-friendly category items */
    .unified-category-item {
        padding: var(--space-sm) var(--space-md);
        min-height: 48px;
    }
    
    .weight-control-header {
        min-height: 48px;
    }
    
    .weight-control {
        min-height: 44px;
    }
    
    /* Apply button touch-friendly */
    .apply-settings-btn,
    #apply-settings {
        min-height: 52px;
        font-size: 1rem;
    }
    
    /* Buttons im Panel größer */
    .btn-icon.btn-ghost {
        width: 40px;
        height: 40px;
    }
}

/* =====================================================
   PREMIUM OVERLAY
   ===================================================== */

.premium-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: var(--space-lg);
}

.premium-overlay-content {
    text-align: center;
    max-width: 280px;
}

.premium-overlay-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-lg);
    color: #fbbf24;
}

.premium-overlay-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
    background: linear-gradient(135deg, #f8fafc, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.premium-overlay-text {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 var(--space-lg) 0;
}

.premium-overlay-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    width: 100%;
    padding: var(--space-sm) var(--space-lg);
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #0f172a;
    font-weight: 600;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.premium-overlay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
    background: linear-gradient(135deg, #fcd34d, #fbbf24);
}

.premium-overlay-btn svg {
    flex-shrink: 0;
}

.premium-overlay-subtext {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin: var(--space-sm) 0 0 0;
}

/* Control panel needs relative positioning for overlay */
.control-panel {
    position: relative;
}

/* =====================================================
   LOCATION POPUP - Glass Card with Flip Animation
   ===================================================== */

/* Custom popup wrapper - replaces MapLibre default */
.location-popup {
    position: fixed;
    z-index: var(--z-modal);
    pointer-events: none;
    display: none;
    align-items: center;
    justify-content: center;
}

.location-popup.active {
    display: flex;
    pointer-events: auto;
}

/* Glass card container with flip capability */
.popup-card {
    width: 320px;
    perspective: 1000px;
    position: relative;
    /* Padding bottom for pointer space */
    padding-bottom: 14px;
}

/* Hide the separate pointer element - we use ::after instead */
.popup-pointer {
    display: none;
}

.popup-card-inner {
    position: relative;
    width: 100%;
    min-height: 250px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.popup-card.flipped .popup-card-inner {
    transform: rotateY(180deg);
}

/* Flipped state: pointer on top */
.popup-card.pointer-flipped {
    padding-bottom: 0;
    padding-top: 14px;
}

/* Shared face styles */
.popup-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 200px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-xl);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
    overflow: visible;
}

/* Pointer as pseudo-element - guaranteed at edge */
.popup-face::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: var(--pointer-x, 50%);
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 14px solid rgba(15, 23, 42, 0.85);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    z-index: 10;
}

/* Flipped pointer (popup below click point) */
.popup-card.pointer-flipped .popup-face::after {
    bottom: auto;
    top: -14px;
    border-top: none;
    border-bottom: 14px solid rgba(15, 23, 42, 0.85);
}

.popup-face-front {
    z-index: 2;
}

.popup-face-back {
    transform: rotateY(180deg);
}

/* Entry animation - macOS Dock style "genie" effect */
@keyframes popupGenie {
    0% {
        opacity: 0;
        transform: scaleY(0.1) scaleX(0.3) translateY(60px);
        transform-origin: bottom center;
    }
    30% {
        opacity: 1;
        transform: scaleY(0.6) scaleX(0.85) translateY(15px);
    }
    50% {
        transform: scaleY(1.05) scaleX(1.02) translateY(-5px);
    }
    70% {
        transform: scaleY(0.98) scaleX(0.99) translateY(2px);
    }
    85% {
        transform: scaleY(1.01) scaleX(1.005) translateY(-1px);
    }
    100% {
        opacity: 1;
        transform: scaleY(1) scaleX(1) translateY(0);
    }
}

@keyframes popupExit {
    0% {
        opacity: 1;
        transform: scaleY(1) scaleX(1) translateY(0);
        transform-origin: bottom center;
    }
    100% {
        opacity: 0;
        transform: scaleY(0.1) scaleX(0.3) translateY(60px);
    }
}

.popup-card.entering {
    animation: popupGenie 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.popup-card.exiting {
    animation: popupExit 0.2s ease-in forwards;
}

/* Popup header */
.popup-header {
    padding: var(--space-md) var(--space-md) var(--space-sm);
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-sm);
}

.popup-header-content {
    flex: 1;
    min-width: 0;
}

.popup-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.popup-address {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin: var(--space-xs) 0 0 0;
    padding-left: calc(16px + var(--space-sm)); /* Align with title text (icon width + gap) */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.popup-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.popup-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Popup body */
.popup-body {
    padding: var(--space-md);
    position: relative;
}

/* Rating display - 5-dot scale */
.rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--divider);
}

.rating-row:last-child {
    border-bottom: none;
}

.rating-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.rating-label svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* 5-dot rating scale */
.rating-dots {
    display: flex;
    gap: 4px;
}

.rating-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: transparent;
    transition: all var(--transition-fast);
    position: relative;
}

/* Rating colors: 1=red, 2=orange, 3=yellow, 4=green, 5=blue */
.rating-dot.filled-1 {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.rating-dot.filled-2 {
    background: #f97316;
    border-color: #f97316;
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
}

.rating-dot.filled-3 {
    background: #eab308;
    border-color: #eab308;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.4);
}

.rating-dot.filled-4 {
    background: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.rating-dot.filled-5 {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

/* Half-filled dot */
.rating-dot.half-filled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    border-radius: 50% 0 0 50%;
    background: inherit;
}

.rating-dot.half-filled {
    background: linear-gradient(to right, var(--fill-color) 50%, transparent 50%);
}

/* Grayed out dots for locked state */
.rating-dot.locked {
    background: var(--bg-elevated);
    border-color: var(--border-color);
    box-shadow: none;
}

/* Popup footer with add button */
.popup-footer {
    padding: var(--space-sm) var(--space-md) var(--space-md);
    display: flex;
    justify-content: flex-end;
}

.popup-add-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md), 0 0 20px rgba(59, 130, 246, 0.3);
}

.popup-add-btn:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(59, 130, 246, 0.4);
}

.popup-add-btn:active {
    transform: scale(0.95);
}

.popup-add-btn svg {
    width: 20px;
    height: 20px;
}

/* Access restriction overlay */
.popup-locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    text-align: center;
    z-index: 10;
}

.popup-locked-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 116, 139, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.popup-locked-icon svg {
    width: 24px;
    height: 24px;
}

.popup-locked-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs);
}

.popup-locked-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0 0 var(--space-md);
    line-height: 1.5;
}

.popup-locked-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    width: 100%;
}

.popup-locked-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.popup-locked-btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.popup-locked-btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.popup-locked-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.popup-locked-btn-secondary:hover {
    background: var(--glass-bg-light);
    color: var(--text-primary);
}

/* Content blur when locked */
.popup-content-blurred {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

/* =====================================================
   REVIEW CREATE FORM (Back of flip card)
   ===================================================== */

.review-form-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.review-form-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.review-form-back {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.review-form-back:hover {
    background: var(--glass-bg-light);
    color: var(--text-primary);
}

.review-form-body {
    padding: var(--space-md);
}

/* Interactive rating input */
.rating-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--divider);
}

.rating-input-row:last-child {
    border-bottom: none;
}

.rating-input-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.rating-input-dots {
    display: flex;
    gap: 6px;
}

.rating-input-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s ease-out;
}

.rating-input-dot:hover {
    transform: scale(1.12);
    border-color: var(--text-muted);
}

/* Hover preview - pale/faded colors */
.rating-input-dot.preview-1 { background: rgba(239, 68, 68, 0.35); border-color: rgba(239, 68, 68, 0.5); }
.rating-input-dot.preview-2 { background: rgba(249, 115, 22, 0.35); border-color: rgba(249, 115, 22, 0.5); }
.rating-input-dot.preview-3 { background: rgba(234, 179, 8, 0.35); border-color: rgba(234, 179, 8, 0.5); }
.rating-input-dot.preview-4 { background: rgba(34, 197, 94, 0.35); border-color: rgba(34, 197, 94, 0.5); }
.rating-input-dot.preview-5 { background: rgba(59, 130, 246, 0.35); border-color: rgba(59, 130, 246, 0.5); }

/* Selected rating colors - full vibrant */
.rating-input-dot.selected-1 { background: #ef4444; border-color: #ef4444; box-shadow: 0 0 12px rgba(239, 68, 68, 0.6); }
.rating-input-dot.selected-2 { background: #f97316; border-color: #f97316; box-shadow: 0 0 12px rgba(249, 115, 22, 0.6); }
.rating-input-dot.selected-3 { background: #eab308; border-color: #eab308; box-shadow: 0 0 12px rgba(234, 179, 8, 0.6); }
.rating-input-dot.selected-4 { background: #22c55e; border-color: #22c55e; box-shadow: 0 0 12px rgba(34, 197, 94, 0.6); }
.rating-input-dot.selected-5 { background: #3b82f6; border-color: #3b82f6; box-shadow: 0 0 12px rgba(59, 130, 246, 0.6); }

/* Bounce animation on selection */
@keyframes dotBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.25); }
    50% { transform: scale(0.95); }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.rating-input-dot.just-selected {
    animation: dotBounce 0.35s ease-out;
}

/* Comment textarea */
.review-comment {
    margin-top: var(--space-md);
}

.review-comment-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    display: block;
}

.review-comment-input {
    width: 100%;
    min-height: 60px;
    padding: var(--space-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8125rem;
    resize: vertical;
    transition: border-color var(--transition-fast);
}

.review-comment-input:focus {
    outline: none;
    border-color: var(--primary);
}

.review-comment-input::placeholder {
    color: var(--text-muted);
}

/* Submit button */
.review-form-footer {
    padding: var(--space-sm) var(--space-md) var(--space-md);
    display: flex;
    justify-content: flex-end;
}

.review-submit-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--success), #059669);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md), 0 0 20px rgba(16, 185, 129, 0.3);
}

.review-submit-btn:hover:not(:disabled) {
    transform: scale(1.08);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(16, 185, 129, 0.4);
}

.review-submit-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    background: var(--text-muted);
    box-shadow: none;
}

.review-submit-btn svg {
    width: 20px;
    height: 20px;
}

/* =====================================================
   SUCCESS OVERLAY
   ===================================================== */

.review-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    text-align: center;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.review-success-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Hide pointer when success overlay is visible */
.popup-face-back:has(.review-success-overlay.visible)::after {
    display: none;
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-checkmark {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--success), #059669);
    border-radius: 50%;
    margin-bottom: var(--space-md);
    animation: checkmarkPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.success-checkmark svg {
    width: 32px;
    height: 32px;
    color: white;
}

.success-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 var(--space-xs);
}

.success-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* No data state */
.popup-no-data {
    text-align: center;
    padding: var(--space-lg);
}

.popup-no-data-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg-light);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
}

.popup-no-data-text {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Mobile responsive styles for popup */
@media (max-width: 768px) {
    .location-popup {
        /* On mobile: JavaScript handles positioning via inline styles */
        /* Only set transform for centering - JS sets top/left */
        transform: translateX(-50%);
    }
    
    .popup-card {
        width: calc(100vw - 32px);
        max-width: 360px;
    }
    
    /* Show pointer on mobile - points to clicked location */
    .popup-pointer {
        display: block;
    }
    
    /* Adjust form body for mobile */
    .review-form-body {
        max-height: calc(100vh - 300px);
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .popup-card {
        width: calc(100vw - 24px);
        max-width: 340px;
    }
    
    .popup-header,
    .review-form-header {
        padding: var(--space-sm) var(--space-md);
    }
    
    .popup-body,
    .review-form-body {
        padding: var(--space-sm);
    }
    
    .rating-input-dots {
        gap: var(--space-xs);
    }
    
    .rating-input-dot {
        width: 22px;
        height: 22px;
    }
}


/* =====================================================
   ARTICLE POPUP (Map Marker Preview)
   ===================================================== */

.article-popup {
    position: fixed;
    z-index: var(--z-popover);
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.article-popup.visible {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
}

.article-popup-card {
    width: 280px;
    background: var(--glass-bg-strong);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
}

.article-popup-close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.8);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    z-index: 10;
    transition: all var(--transition-fast);
}

.article-popup-close:hover {
    background: rgba(30, 41, 59, 0.9);
    color: var(--text-primary);
}

.article-popup-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: var(--bg-elevated);
    position: relative;
}

.article-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-popup-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.article-popup-content {
    padding: var(--space-md);
}

.article-popup-topic {
    display: inline-block;
    padding: 2px var(--space-sm);
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.article-popup-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0 0 var(--space-xs) 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-popup-excerpt {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0 0 var(--space-sm) 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-popup-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.article-popup-link:hover {
    color: var(--primary-light);
}

.article-popup-link svg {
    transition: transform var(--transition-fast);
}

.article-popup-link:hover svg {
    transform: translateX(2px);
}

.article-popup-pointer {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    bottom: -8px;
    left: 50%;
    margin-left: -8px;
}

/* Mobile adjustments for article popup */
@media (max-width: 768px) {
    .article-popup-card {
        width: calc(100vw - 32px);
        max-width: 320px;
    }
}
