/* ═══════════════════════════════════════════════════════════════
   TaborMap - Main Stylesheet
   Theme: Dark with blue accents
═══════════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────────── */
:root {
    --bg-primary:     #0d1117;
    --bg-secondary:   #161b22;
    --bg-tertiary:    #1c2128;
    --bg-card:        #21262d;
    --bg-hover:       #30363d;
    --bg-input:       #0d1117;

    --border-primary: #30363d;
    --border-accent:  #1f4068;

    --text-primary:   #e6edf3;
    --text-secondary: #8b949e;
    --text-muted:     #6e7681;
    --text-inverse:   #0d1117;

    --accent-primary: #1f6feb;
    --accent-hover:   #388bfd;
    --accent-muted:   #1f4068;
    --accent-subtle:  #0d2137;

    --success:        #238636;
    --success-hover:  #2ea043;
    --success-text:   #3fb950;
    --warning:        #9e6a03;
    --warning-text:   #d29922;
    --danger:         #da3633;
    --danger-hover:   #f85149;
    --danger-text:    #f85149;
    --info:           #0c4a6e;
    --info-text:      #38bdf8;

    --archived-bg:    #1a1a2e;
    --archived-border:#2d2d5e;
    --archived-text:  #7070a0;

    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-xl:  16px;
    --radius-full: 9999px;

    --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg:  0 8px 24px rgba(0,0,0,0.6);
    --shadow-xl:  0 16px 48px rgba(0,0,0,0.7);

    --transition: 0.15s ease;
    --font-main:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono:  "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

    --topbar-height: 56px;
    --sidebar-width: 260px;
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent-hover);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--text-primary); }

img { max-width: 100%; display: block; }

ul, ol { list-style: none; }

button {
    font-family: var(--font-main);
    cursor: pointer;
    border: none;
    outline: none;
    transition: all var(--transition);
}

input, textarea, select {
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-primary); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Layout ─────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 1000;
    gap: 1rem;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
}

.topbar-logo span {
    color: var(--accent-hover);
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.topbar-nav-btn {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all var(--transition);
}

.topbar-nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.topbar-nav-btn.active {
    background: var(--accent-subtle);
    color: var(--accent-hover);
    border-color: var(--accent-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.main-content {
    margin-top: var(--topbar-height);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: all var(--transition);
    user-select: none;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-lg { padding: 0.6rem 1.4rem; font-size: 1rem; }
.btn-icon { padding: 0.45rem; min-width: 36px; }

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-primary);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--text-muted);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover:not(:disabled) {
    background: var(--success-hover);
}

.btn-danger {
    background: transparent;
    color: var(--danger-text);
    border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
    background: var(--danger);
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: var(--warning);
}
.btn-warning:hover:not(:disabled) {
    filter: brightness(1.15);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
}
.form-control:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(31,111,235,0.2);
}
.form-control::placeholder { color: var(--text-muted); }

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}
select.form-control option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.form-error {
    font-size: 0.78rem;
    color: var(--danger-text);
}

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body { padding: 1.25rem; }

/* ─── Badges ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-blue   { background: var(--accent-subtle); color: var(--accent-hover); border: 1px solid var(--accent-muted); }
.badge-green  { background: rgba(35,134,54,0.2);  color: var(--success-text); border: 1px solid rgba(35,134,54,0.4); }
.badge-yellow { background: rgba(158,106,3,0.2);  color: var(--warning-text); border: 1px solid rgba(158,106,3,0.4); }
.badge-red    { background: rgba(218,54,51,0.2);  color: var(--danger-text);  border: 1px solid rgba(218,54,51,0.4); }
.badge-gray   { background: var(--bg-hover);      color: var(--text-secondary); border: 1px solid var(--border-primary); }
.badge-archived { background: var(--archived-bg); color: var(--archived-text); border: 1px solid var(--archived-border); }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    border: 1px solid transparent;
}
.alert-success { background: rgba(35,134,54,0.15); color: var(--success-text); border-color: rgba(35,134,54,0.3); }
.alert-danger  { background: rgba(218,54,51,0.15);  color: var(--danger-text);  border-color: rgba(218,54,51,0.3); }
.alert-warning { background: rgba(158,106,3,0.15);  color: var(--warning-text); border-color: rgba(158,106,3,0.3); }
.alert-info    { background: rgba(12,74,110,0.3);   color: var(--info-text);    border-color: rgba(56,189,248,0.3); }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.modal-backdrop.visible { opacity: 1; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transform: translateY(-16px);
    transition: transform 0.2s ease;
}
.modal-backdrop.visible .modal { transform: translateY(0); }

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.modal-title { font-size: 1rem; font-weight: 600; }

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-primary);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ─── Toast Notifications ────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    animation: toastIn 0.25s ease forwards;
    max-width: 320px;
    border: 1px solid transparent;
}
.toast.hiding { animation: toastOut 0.25s ease forwards; }
.toast-success { background: #1a3a1f; color: var(--success-text); border-color: rgba(35,134,54,0.4); }
.toast-error   { background: #3a1a1a; color: var(--danger-text);  border-color: rgba(218,54,51,0.4); }
.toast-info    { background: var(--accent-subtle); color: var(--accent-hover); border-color: var(--accent-muted); }
.toast-warning { background: #2a2010; color: var(--warning-text); border-color: rgba(158,106,3,0.4); }

@keyframes toastIn  { from { opacity:0; transform: translateX(100%); } to { opacity:1; transform: translateX(0); } }
@keyframes toastOut { from { opacity:1; transform: translateX(0);    } to { opacity:0; transform: translateX(100%); } }

/* ─── Map Page ───────────────────────────────────────────────── */
#map-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
}

.map-tabs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
    overflow-x: auto;
    flex-shrink: 0;
}
.map-tabs::-webkit-scrollbar { height: 4px; }

.map-tab {
    padding: 0.4rem 1rem;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition);
}
.map-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.map-tab.active {
    background: var(--accent-subtle);
    color: var(--accent-hover);
    border-color: var(--accent-muted);
}

.map-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

#leaflet-map {
    flex: 1;
    background: var(--bg-primary);
    z-index: 1;
}

.map-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    z-index: 2;
}

.map-sidebar-section {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

.map-sidebar-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.map-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.filter-group { margin-bottom: 0.75rem; }

.filter-group-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.filter-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.filter-item {
    transition: all 0.2s ease;
}

.filter-item.active {
    background: rgba(37, 99, 235, 0.15);
    opacity: 1;
    transform: scale(1.02);
}

.filter-item:not(.active) {
    opacity: 0.4;
    background: transparent;
}

.filter-item:not(.active):hover {
    opacity: 0.6;
}

.filter-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.floor-switcher {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.floor-btn {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.85rem;
    border: 1px solid var(--border-primary);
    text-align: left;
    transition: all var(--transition);
}
.floor-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.floor-btn.active {
    background: var(--accent-subtle);
    color: var(--accent-hover);
    border-color: var(--accent-muted);
}
.floor-btn.all-floors {
    border-style: dashed;
    font-size: 0.78rem;
}

.search-box {
    position: relative;
    margin-bottom: 0.5rem;
}
.search-box input {
    width: 100%;
    padding: 0.4rem 0.75rem 0.4rem 2rem;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.85rem;
}
.search-box input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(31,111,235,0.2);
}
.search-box-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 200px;
    overflow-y: auto;
}

.search-result-item {
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.search-result-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ─── Leaflet overrides ───────────────────────────────────────── */
.leaflet-container {
    background: var(--bg-primary) !important;
    font-family: var(--font-main) !important;
}

.leaflet-control-zoom a {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
}
.leaflet-control-zoom a:hover {
    background: var(--bg-hover) !important;
}

.leaflet-control-attribution {
    background: rgba(13,17,23,0.8) !important;
    color: var(--text-muted) !important;
    font-size: 0.7rem !important;
}
.leaflet-control-attribution a { color: var(--text-muted) !important; }

.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-primary) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
    padding: 0 !important;
}
.leaflet-popup-tip { background: var(--bg-card) !important; }
.leaflet-popup-content { margin: 0 !important; width: auto !important; }
.leaflet-popup-close-button {
    color: var(--text-secondary) !important;
    font-size: 1.2rem !important;
    padding: 0.5rem !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
}
.leaflet-popup-close-button:hover { color: var(--text-primary) !important; }

/* ─── Marker Popup ───────────────────────────────────────────── */
.marker-popup {
    width: 300px;
    max-width: 90vw;
}

.marker-popup-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.marker-popup-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-right: 1.5rem;
}

.marker-popup-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

.marker-popup-body { padding: 0.75rem 1rem; }

.marker-popup-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.marker-popup-images {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.marker-popup-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    cursor: pointer;
    transition: all var(--transition);
}
.marker-popup-thumb:hover {
    border-color: var(--accent-primary);
    transform: scale(1.03);
}

.marker-popup-placeholder {
    width: 100%;
    height: 80px;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.marker-popup-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.marker-popup-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-primary);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.marker-archived-banner {
    background: var(--archived-bg);
    border-bottom: 1px solid var(--archived-border);
    padding: 0.4rem 1rem;
    font-size: 0.78rem;
    color: var(--archived-text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ─── Image Lightbox ─────────────────────────────────────────── */
#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
#lightbox.visible {
    opacity: 1;
    pointer-events: all;
}
#lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
}
.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition);
}
.lightbox-close:hover { background: var(--bg-hover); }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition);
}
.lightbox-nav:hover { background: var(--bg-hover); }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ─── Map Placeholder ────────────────────────────────────────── */
.map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-muted);
    background: var(--bg-primary);
}
.map-placeholder-icon {
    font-size: 4rem;
    opacity: 0.3;
}
.map-placeholder-text { font-size: 1rem; }

/* ─── Submission Form ─────────────────────────────────────────── */
.submit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-upload-area {
    border: 2px dashed var(--border-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
    font-size: 0.875rem;
}
.image-upload-area:hover {
    border-color: var(--accent-primary);
    color: var(--accent-hover);
    background: var(--accent-subtle);
}
.image-upload-area.drag-over {
    border-color: var(--accent-hover);
    background: var(--accent-subtle);
}

.image-preview-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.image-preview-item {
    position: relative;
    width: 80px;
    height: 60px;
}
.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
}
.image-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    cursor: pointer;
    border: none;
    line-height: 1;
}

/* ─── Talk Board ─────────────────────────────────────────────── */
#board-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    width: 100%;
}

.board-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    align-items: start;
}

.board-post-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.board-post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    transition: border-color var(--transition);
    cursor: pointer;
}
.board-post-card:hover {
    border-color: var(--accent-muted);
}
.board-post-card.pinned {
    border-color: var(--accent-muted);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-subtle) 100%);
}

.board-post-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.board-post-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.board-post-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.4rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.board-detail-header {
    margin-bottom: 1.5rem;
}

.board-detail-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.board-detail-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.board-reply {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

.board-reply-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.board-reply-author {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent-hover);
}

.board-reply-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.board-reply-content {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ─── Shoutbox ───────────────────────────────────────────────── */
.shoutbox {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    height: 400px;
    position: sticky;
    top: calc(var(--topbar-height) + 1rem);
}

.shoutbox-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.shoutbox-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.shoutbox-online {
    font-size: 0.72rem;
    color: var(--success-text);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.shoutbox-online::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--success-text);
    border-radius: 50%;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.shoutbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.shoutbox-msg {
    font-size: 0.82rem;
    line-height: 1.4;
    word-break: break-word;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.shoutbox-msg:hover { background: var(--bg-hover); }

.shoutbox-msg-author {
    font-weight: 600;
    color: var(--accent-hover);
    margin-right: 0.3rem;
}
.shoutbox-msg-author.visitor { color: var(--text-muted); }

.shoutbox-msg-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 0.3rem;
}

.shoutbox-msg-content { color: var(--text-secondary); }

.shoutbox-input-area {
    padding: 0.75rem;
    border-top: 1px solid var(--border-primary);
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.shoutbox-input {
    flex: 1;
    padding: 0.4rem 0.65rem;
    background: var(--bg-input);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.82rem;
    resize: none;
    height: 36px;
    line-height: 1.4;
}
.shoutbox-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(31,111,235,0.2);
}

.shoutbox-locked-msg {
    padding: 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

/* ─── Admin Panel ────────────────────────────────────────────── */
#admin-page {
    display: flex;
    height: calc(100vh - var(--topbar-height));
    overflow: hidden;
}

.admin-sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    padding: 1rem 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.admin-sidebar-section {
    margin-bottom: 0.25rem;
}

.admin-sidebar-label {
    padding: 0.3rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.admin-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: left;
    border: none;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.admin-nav-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}
.admin-nav-btn.active {
    background: var(--accent-subtle);
    color: var(--accent-hover);
    border-left-color: var(--accent-primary);
}

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.admin-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ─── Tables ─────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
}

th {
    padding: 0.65rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
}

td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr {
    transition: background var(--transition);
}
tbody tr:hover { background: var(--bg-hover); }

/* ─── Moderation Queue ───────────────────────────────────────── */
.mod-queue-item {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
    transition: border-color var(--transition);
}
.mod-queue-item:hover {
    border-color: var(--accent-muted);
}

.mod-queue-header {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.mod-queue-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.mod-queue-body {
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
}

.mod-queue-images {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.mod-queue-thumb {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-primary);
    cursor: pointer;
    transition: all var(--transition);
}
.mod-queue-thumb:hover {
    border-color: var(--accent-primary);
}

.mod-queue-actions {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.vote-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
}
.vote-up   { color: var(--success-text); }
.vote-down { color: var(--danger-text); }

/* ─── Announcement ───────────────────────────────────────────── */
.announcement-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-subtle) 100%);
    border: 1px solid var(--accent-muted);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.announcement-card.pinned {
    border-color: var(--accent-primary);
}
.announcement-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.announcement-content {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}
.announcement-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ─── Permission toggles ─────────────────────────────────────── */
.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
}

.perm-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--border-primary);
    border-radius: var(--radius-full);
    transition: background var(--transition);
    cursor: pointer;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--accent-primary); }
.toggle input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ─── Image Library ──────────────────────────────────────────── */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.image-grid-item {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition);
}
.image-grid-item:hover { border-color: var(--accent-muted); }

.image-grid-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.image-grid-info {
    padding: 0.4rem 0.6rem;
}
.image-grid-name {
    font-size: 0.72rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.image-grid-size {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* ─── Loading states ─────────────────────────────────────────── */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-primary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13,17,23,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: inherit;
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ─── Empty states ───────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
    gap: 0.75rem;
}
.empty-state-icon { font-size: 2.5rem; opacity: 0.4; }
.empty-state-title { font-size: 0.95rem; font-weight: 600; color: var(--text-secondary); }
.empty-state-desc { font-size: 0.85rem; max-width: 300px; }

/* ─── Divider ────────────────────────────────────────────────── */
.divider {
    border: none;
    border-top: 1px solid var(--border-primary);
    margin: 1rem 0;
}

/* ─── Utility classes ────────────────────────────────────────── */
.d-flex   { display: flex; }
.d-grid   { display: grid; }
.d-none   { display: none !important; }
.flex-1   { flex: 1; }
.flex-col { flex-direction: column; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end    { justify-content: flex-end; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-6  { gap: 1.5rem; }
.w-full { width: 100%; }
.text-sm   { font-size: 0.875rem; }
.text-xs   { font-size: 0.75rem; }
.text-muted   { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary   { color: var(--text-primary); }
.text-success   { color: var(--success-text); }
.text-danger    { color: var(--danger-text); }
.text-warning   { color: var(--warning-text); }
.text-accent    { color: var(--accent-hover); }
.font-bold  { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.p-1  { padding: 0.25rem; }
.p-2  { padding: 0.5rem; }
.p-3  { padding: 0.75rem; }
.p-4  { padding: 1rem; }
.rounded { border-radius: var(--radius-md); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    .topbar-logo span { display: none; }

    .map-sidebar {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 100;
    }
    .map-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-xl);
    }

    .board-layout {
        grid-template-columns: 1fr;
    }

    .shoutbox {
        position: static;
        height: 300px;
    }

    #admin-page {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - var(--topbar-height));
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-primary);
        display: flex;
        flex-wrap: wrap;
        padding: 0.5rem;
        gap: 0.25rem;
    }

    .admin-sidebar-label { display: none; }

    .admin-nav-btn {
        border-left: none;
        border-radius: var(--radius-md);
        padding: 0.4rem 0.75rem;
        border: 1px solid transparent;
        flex-shrink: 0;
    }
    .admin-nav-btn.active {
        border-color: var(--accent-muted);
    }

    .admin-content {
        overflow-y: visible;
        padding: 1rem;
    }

    .mod-queue-body {
        grid-template-columns: 1fr;
    }

    .modal {
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 85vh;
    }

    .modal-backdrop {
        align-items: flex-end;
    }

    .perm-grid {
        grid-template-columns: 1fr;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .topbar-nav {
        overflow-x: auto;
    }
    .topbar-nav::-webkit-scrollbar { display: none; }
}

@media (max-width: 480px) {
    .topbar-nav-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
    .marker-popup { width: 280px; }
}

/* ── Shoutbox IP reveal ────────────────────────────────────── */
.shoutbox-msg-ip {
    display: none;
    font-size: 0.65rem;
    color: var(--danger-text);
    cursor: pointer;
    padding: 0 0.25rem;
    border-radius: 3px;
    background: rgba(239,68,68,0.1);
    margin-left: 0.25rem;
}
.shoutbox-msg:hover .shoutbox-msg-ip {
    display: inline;
}
.shoutbox-msg-ip:hover {
    background: rgba(239,68,68,0.25);
}

/* ═══════════════════════════════════════════════════════════════
   MODERATION TABS
   ═══════════════════════════════════════════════════════════════ */

.mod-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.mod-tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.mod-tab:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.mod-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.mod-content {
    padding: 1rem 0;
}


/* ═══════════════════════════════════════════════════════════════
   MOBILE IMPROVEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* Mobile: Hamburger menu */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .topbar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-primary);
        border-right: 1px solid var(--border-color);
        flex-direction: column;
        padding: 4rem 0 1rem 0;
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }
    
    .topbar.mobile-open {
        left: 0;
    }
    
    .topbar-nav {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    
    .topbar-nav-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem 1.5rem;
        border-radius: 0;
    }
    
    .topbar-user {
        width: 100%;
        padding: 1rem 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Collapsible sidebar */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
        overflow-y: auto;
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .sidebar-toggle {
        display: block;
        position: fixed;
        left: 1rem;
        top: 5rem;
        z-index: 998;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        padding: 0.75rem;
        border-radius: 8px;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    
    /* Better marker popups */
    .marker-popup {
        max-width: 90vw;
    }
    
    .marker-popup-images {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    
    .marker-popup-thumb {
        scroll-snap-align: start;
        min-width: 100%;
    }
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}

.mobile-overlay.active {
    display: block;
}

/* Add marker mode button */
.add-marker-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 500;
    background: var(--primary);
    color: white;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

.add-marker-btn:hover {
    transform: scale(1.1);
}

.add-marker-btn.active {
    background: var(--danger);
}

@media (min-width: 769px) {
    .add-marker-btn {
        display: none;
    }
}


/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .topbar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 4rem 0 1rem 0;
        transition: left 0.3s;
        z-index: 1000;
    }
    .topbar.mobile-open { left: 0; }
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}
.mobile-overlay.active { display: block; }

.add-marker-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 500;
    background: var(--primary);
    color: white;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .topbar-nav { flex-direction: column; width: 100%; }
    .sidebar { left: -100%; transition: left 0.3s; }
    .sidebar.mobile-open { left: 0; }
    .marker-popup { max-width: 90vw; }
    .add-marker-btn.active { background: var(--danger); }
}

/* Better mobile button styling */
.add-marker-btn {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    left: auto !important;
    top: auto !important;
    z-index: 1000 !important;
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    font-size: 2rem !important;
    font-weight: bold !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.add-marker-btn.active {
    background: var(--danger) !important;
}


/* Show hamburger on mobile */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important;
    }
    
    .topbar {
        position: fixed !important;
        top: 0 !important;
        left: -100% !important;
        width: 80% !important;
        max-width: 300px !important;
        height: 100vh !important;
        background: var(--bg-primary) !important;
        border-right: 1px solid var(--border-color) !important;
        flex-direction: column !important;
        padding: 4rem 0 1rem 0 !important;
        transition: left 0.3s ease !important;
        z-index: 1000 !important;
    }
    
    .topbar.mobile-open {
        left: 0 !important;
    }
}


@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        left: -100% !important;
        top: 0 !important;
        width: 80% !important;
        max-width: 300px !important;
        height: 100vh !important;
        z-index: 999 !important;
        transition: left 0.3s ease !important;
        overflow-y: auto !important;
    }
    
    .sidebar.mobile-open {
        left: 0 !important;
    }
    
    .sidebar-toggle {
        display: block !important;
        position: fixed !important;
        left: 1rem !important;
        bottom: 2rem !important;
        z-index: 998 !important;
        background: var(--bg-primary) !important;
        border: 1px solid var(--border-color) !important;
        padding: 1rem !important;
        border-radius: 50% !important;
        width: 60px !important;
        height: 60px !important;
        font-size: 1.5rem !important;
        cursor: pointer !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
    }
}


/* Force mobile elements to show on mobile */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block !important;
        position: fixed !important;
        top: 1rem !important;
        right: 1rem !important;
        z-index: 1001 !important;
    }
    
    .add-marker-btn {
        display: flex !important;
        position: fixed !important;
        bottom: 2rem !important;
        right: 2rem !important;
    }
    
    .sidebar-toggle {
        display: flex !important;
        position: fixed !important;
        left: 1rem !important;
        bottom: 2rem !important;
    }
}


@media (max-width: 768px) {
    /* Hide desktop nav items except logo */
    .topbar-nav-btn {
        display: none !important;
    }
    
    .topbar-user {
        display: none !important;
    }
    
    /* Logo stays visible */
    .topbar-logo {
        display: flex !important;
    }
}


@media (max-width: 768px) {
    .map-selector {
        display: none !important;
    }
}


.add-marker-btn {
    display: none !important;
}


/* Show login in mobile menu */
@media (max-width: 768px) {
    .topbar.mobile-open .topbar-user {
        display: flex !important;
        flex-direction: column;
        padding: 1rem;
        border-top: 1px solid var(--border-color);
    }
}


/* Keep topbar normal on mobile, just show login */
@media (max-width: 768px) {
    .topbar {
        position: relative !important;
        left: 0 !important;
        width: 100% !important;
        height: auto !important;
        flex-direction: row !important;
        padding: 0.5rem 1rem !important;
    }
    
    .topbar-user {
        display: flex !important;
    }
    
    .topbar-nav {
        display: flex !important;
    }
}


/* Fix topbar positioning on mobile */
@media (max-width: 768px) {
    .topbar {
        padding: 1rem !important;
        margin-bottom: 0.5rem !important;
        min-height: 60px !important;
    }
    
    .topbar-logo {
        font-size: 1.2rem !important;
    }
    
    .topbar-user button {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Make sure map doesn't cover topbar */
    #map-page {
        padding-top: 0 !important;
    }
    
    #leaflet-map {
        margin-top: 70px !important;
    }
}

