:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #0f0f16;
    --bg-card: rgba(10, 15, 20, 0.95);
    --bg-glass: rgba(0, 255, 170, 0.03);
    --border-glass: rgba(0, 255, 170, 0.15);
    --text-primary: #00ffaa;
    --text-secondary: #00cc88;
    --text-muted: #006644;
    --accent-primary: #00ffaa;
    --accent-secondary: #00cc88;
    --accent-glow: rgba(0, 255, 170, 0.4);
    --success: #00ff88;
    --warning: #ffaa00;
    --danger: #ff3366;
    --shadow-glow: 0 0 30px rgba(0, 255, 170, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.5);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.25s ease;
}

[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #666666;
    --border-glass: rgba(0, 0, 0, 0.15);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.12);
    --accent-primary: #0d9488;
    --accent-secondary: #0f766e;
    --accent-glow: rgba(13, 148, 136, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent body scroll, map handles it */
}

/* Marker Status Colors */
.marker-online { fill: #00ffaa !important; color: #00ffaa; }
.marker-offline { fill: #ff4444 !important; color: #ff4444; }
.marker-checking { fill: #888888 !important; color: #888888; }

main {
    padding: 24px 0;
    flex: 1; /* Pushes footer down */
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    flex: 1; /* Ensures container fills main */
    display: flex;
    flex-direction: column;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    background: var(--bg-card); /* Use var for theme support */
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    width: 200px;
    transition: var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(0, 255, 170, 0.1);
}

.sort-select {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.sort-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.sort-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Map View */
.map-wrapper {
    width: 100%;
    height: calc(100vh - 85px); /* Full height minus header (adjust if needed) */
    position: relative;
    background: var(--bg-primary);
}

.map-container {
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    z-index: 1;
}

/* Custom Leaflet Dark Mode using Filters (Optional but cool) or Tile Layer selection */
.leaflet-container {
    font-family: var(--font-mono);
    background: var(--bg-primary);
}

/* Modal Z-Index must be higher than Leaflet (400) */
.video-modal-overlay, .modal-overlay {
    z-index: 1000;
}

.leaflet-control-attribution {
    background: rgba(0,0,0,0.6) !important;
    color: #ccc !important;
    padding: 4px 8px !important;
    font-size: 10px !important;
}
.leaflet-control-attribution a {
    color: var(--accent-primary) !important;
}

.leaflet-popup-content-wrapper {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.leaflet-popup-tip {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
}

.leaflet-popup-close-button {
    color: var(--text-muted) !important;
}

.popup-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.popup-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.popup-btn {
    font-size: 0.7rem;
    padding: 4px 12px;
    width: 100%;
    background: var(--accent-primary);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
}

.popup-btn:hover {
    box-shadow: 0 0 10px var(--accent-glow);
}

header {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--accent-glow);
}

.logo-icon svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.btn svg {
    width: 14px;
    height: 14px;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.card-action-btn svg {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
}

.camera-play-icon svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin: 0 auto 16px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-shadow: 0 0 10px var(--accent-glow);
}

.logo-subtitle {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
}

.btn-ghost:hover {
    background: var(--bg-glass);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.btn-primary:hover {
    box-shadow: 0 0 20px var(--accent-glow);
}

main {
    padding: 24px 0;
    min-height: calc(100vh - 200px);
}

.camera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.camera-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.camera-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.camera-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.camera-card:hover::before {
    opacity: 1;
}

.camera-preview {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

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

    .search-bar {
        width: 100%;
        display: flex;
        flex-wrap: wrap; /* Allow wrapping */
        gap: 10px;
    }

    /* Reorder Input to Bottom */
    .search-input {
        order: 2; /* Moves to bottom */
        width: 100%; /* Full width fallback */
        flex: 1 1 100%; /* Force full width in flex container */
        margin-top: 5px;
        max-width: none; /* Override base constraint if any */
    }

    /* All other controls stay top (implicit order 0 or 1) */
    .sort-select, 
    #addCameraBtn, 
    #selectModeBtn {
        flex: 1; /* Distribute space evenly */
        order: 1;
        height: 42px; /* Enforce uniform height */
        display: flex;
        align-items: center; /* Center text/icon vertically */
        justify-content: center;
    }
    
    #selectModeBtn {
        flex: 0 0 42px; /* Fixed square for icon button */
    }

    .logo {
        justify-content: center;
        margin-bottom: 10px;
    }
}

.camera-preview video {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Fix: scaling issue, ensures full video is visible */
    pointer-events: none;
    filter: saturate(0.8) contrast(1.1);
    background: #000; /* Letterboxing background */
}

.camera-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.camera-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 40%, transparent 60%, rgba(0,0,0,0.6) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
}

.camera-status {
    display: flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid;
}

.camera-status.online {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--success);
    color: var(--success);
}

.camera-status.offline {
    background: rgba(255, 51, 102, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

.camera-status.checking {
    background: rgba(255, 170, 0, 0.15);
    border-color: var(--warning);
    color: var(--warning);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.camera-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(0, 255, 170, 0.15);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    transition: all var(--transition-normal);
}

.camera-card:hover .camera-play-icon {
    opacity: 1;
    box-shadow: 0 0 30px var(--accent-glow);
}

.camera-card-info {
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-glass);
}

.camera-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.camera-card-actions {
    display: flex;
    gap: 4px;
}

.card-action-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    transition: all var(--transition-fast);
}

.card-action-btn.edit-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
}

.card-action-btn.delete-btn:hover {
    background: var(--danger);
    border-color: var(--danger);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.8rem;
}

.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.video-modal {
    width: 100%;
    max-width: 1200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 0 50px var(--accent-glow);
}

.video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-glass);
}

.video-modal-header .camera-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.video-modal-header .camera-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.video-modal-header .camera-location {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.video-modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.live-badge svg {
    width: 10px;
    height: 10px;
    animation: blink 1s infinite;
}

.video-modal-content {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.modal-video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.video-modal-content:hover .video-controls {
    opacity: 1;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 255, 170, 0.1);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.control-btn:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.volume-slider {
    width: 80px;
    height: 4px;
    background: rgba(0, 255, 170, 0.2);
    border-radius: 2px;
    appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-glow);
}

.quality-badge {
    padding: 4px 10px;
    background: rgba(0, 255, 170, 0.1);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    font-size: 0.6rem;
    color: var(--accent-primary);
    font-weight: 600;
    text-transform: uppercase;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 2px solid rgba(0, 255, 170, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

footer {
    padding: 24px 0;
    border-top: 1px solid var(--border-glass);
    text-align: center;
}

.footer-text {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.footer-link {
    color: var(--accent-primary);
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
    text-shadow: 0 0 10px var(--accent-glow);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 0 40px var(--accent-glow);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-glass);
}

.modal-title {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.modal-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

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

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1002;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    animation: slideIn 0.3s ease;
    font-size: 0.8rem;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent-primary); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .container { padding: 0 12px; }
    header { padding: 12px 0; }
    .logo-icon { width: 36px; height: 36px; }
    .logo-title { font-size: 0.85rem; }
    .logo-subtitle { display: none; }
    main { padding: 16px 0; }
    .camera-grid { grid-template-columns: 1fr; gap: 12px; }
    .video-modal-overlay { padding: 0; }
    .video-modal { border-radius: 0; height: 100%; display: flex; flex-direction: column; }
    .video-modal-content { flex: 1; aspect-ratio: unset; }
    .volume-slider { display: none; }
    .loading-terminal { font-size: 0.65rem; }
    .search-bar { width: 100%; justify-content: flex-end; }
    .search-input { width: 120px; }
}

/* Sort Select */
.sort-select {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    padding: 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
}
.sort-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}
.sort-select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Selection Checkbox */
.camera-select-chk {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    z-index: 20;
    cursor: pointer;
    accent-color: var(--accent-primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* Bulk Toolbar */
.bulk-toolbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    animation: slideUp 0.3s ease;
}
.bulk-info {
    color: var(--text-primary);
    font-weight: 600;
}
@keyframes slideUp {
    from { transform: translate(-50%, 50px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

/* Custom Confirm Modal */
.confirm-modal {
    max-width: 400px;
    text-align: center;
    padding: 30px;
}
.confirm-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 51, 102, 0.1);
    color: var(--danger);
}
.confirm-icon svg {
    width: 32px;
    height: 32px;
}
.modal-text {
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
}
.btn-danger:hover {
    background: #ff0040;
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
}

/* Undo Toast */
.undo-toast {
    justify-content: space-between;
    min-width: 300px;
    position: relative;
    overflow: hidden;
}
.undo-btn {
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-weight: bold;
    cursor: pointer;
    font-family: var(--font-mono);
    text-decoration: underline;
}
.undo-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent-primary);
    width: 100%;
    animation: progress 6s linear forwards;
}
@keyframes progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Ensure status is always strictly visible */
.camera-preview-overlay {
    z-index: 10 !important;
    pointer-events: none;
}
.camera-status {
    z-index: 11 !important;
}

a.card-action-btn {
    text-decoration: none;
    color: var(--text-muted);
}
a.card-action-btn:hover {
    color: var(--bg-primary);
}

/* Nearby Panel */
.nearby-panel {
    position: absolute;
    bottom: 60px;
    left: 16px;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    z-index: 500;
    overflow: hidden;
}

.nearby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-glass);
    background: var(--bg-secondary);
}

.nearby-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nearby-content {
    padding: 16px;
}

.radius-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    appearance: none;
    background: var(--border-glass);
    margin: 12px 0;
    cursor: pointer;
}

.radius-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
}

.nearby-stats {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Attribution Fix - ensure not cut off */
.leaflet-control-attribution {
    position: relative;
    z-index: 400;
    margin-bottom: 4px !important;
    margin-right: 4px !important;
}
