/* ============================================================
   GeoProblemBot — Noble Green Design System
   Deep forest greens with emerald accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ----- CSS Variables ----- */
:root {
    /* Deep Forest Greens */
    --bg-primary: #0a1a0f;
    --bg-secondary: #0f2416;
    --bg-tertiary: #14291a;
    --bg-card: #1a3522;
    --bg-elevated: #234a2e;

    /* Text Colors */
    --text-primary: #f0fdf4;
    --text-secondary: #a7f3d0;
    --text-muted: #6ee7b7;

    /* Accent Greens */
    --accent-emerald: #22c55e;
    --accent-emerald-dark: #16a34a;
    --accent-mint: #86efac;
    --accent-gold: #fbbf24;
    --accent-gold-dark: #f59e0b;
    --accent-red: #ef4444;

    /* Borders */
    --border: rgba(34, 197, 94, 0.15);
    --border-light: rgba(34, 197, 94, 0.25);
    --border-glow: rgba(34, 197, 94, 0.4);

    /* Typography */
    --font-display: 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(34, 197, 94, 0.2);
    --shadow-glow-gold: 0 0 24px rgba(251, 191, 36, 0.4);
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ----- Typography ----- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* ============================================================
   TOP NAVBAR — Simplified
   ============================================================ */
.nav-bar {
    background: rgba(10, 26, 15, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-brand-icon {
    font-size: 24px;
    line-height: 1;
}

.nav-brand-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

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

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
}

.nav-btn:hover {
    background: var(--bg-elevated);
    color: var(--accent-mint);
    border-color: var(--border-light);
}

/* ============================================================
   DESKTOP FILTER BAR (hidden on mobile, shown on desktop)
   ============================================================ */
.filter-bar {
    display: none;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    justify-content: flex-end;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

@media (min-width: 769px) {
    .filter-bar {
        display: flex;
    }
}

.filter-btn {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid transparent;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    white-space: nowrap;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
    border-color: var(--border-light);
}

.filter-btn.active {
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
    background: rgba(34, 197, 94, 0.12);
    box-shadow: var(--shadow-glow);
}

.filter-count {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.filter-btn.active .filter-count {
    background: rgba(34, 197, 94, 0.2);
    color: var(--accent-emerald);
}

/* ============================================================
   MOBILE DOCK — Bottom Navigation
   ============================================================ */
.dock {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: rgba(10, 26, 15, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border);
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.dock-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 8px 16px;
}

.dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-width: 56px;
}

.dock-btn:hover,
.dock-btn.active {
    color: var(--accent-emerald);
    background: rgba(34, 197, 94, 0.08);
}

.dock-btn-icon {
    font-size: 22px;
    line-height: 1;
}

.dock-btn-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Central Report Button — Gold CTA */
.dock-btn-report {
    position: relative;
    transform: translateY(-8px);
}

.dock-btn-report .dock-btn-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-glow-gold);
    animation: pulse-gold 2.5s ease-in-out infinite;
}

@keyframes pulse-gold {
    0%, 100% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 32px rgba(251, 191, 36, 0.6);
        transform: scale(1.05);
    }
}

.dock-btn-report:hover .dock-btn-icon {
    transform: scale(1.1);
}

/* ============================================================
   MOBILE FILTER SHEET (slides up from bottom)
   ============================================================ */
.filter-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
    border-top: 1px solid var(--border-light);
    z-index: 150;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 60vh;
    overflow-y: auto;
}

.filter-sheet.open {
    transform: translateY(0);
}

.filter-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.filter-sheet-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.filter-sheet-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.filter-sheet-btn {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1.5px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-sheet-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.filter-sheet-btn.active {
    border-color: var(--accent-emerald);
    color: var(--accent-emerald);
    background: rgba(34, 197, 94, 0.1);
}

.filter-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 140;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-sheet-overlay.open {
    display: block;
    opacity: 1;
}

/* ============================================================
   MAP
   ============================================================ */
#map {
    width: 100%;
    height: calc(100vh - 64px - 72px);
}

/* Dark theme for Yandex tiles */
[class*="ymaps"][class*="-ground-pane"] {
    filter: grayscale(0.3) brightness(0.6) sepia(0.1) hue-rotate(80deg);
}

[class*="ymaps"][class*="-copyrights"] {
    display: none !important;
}

/* Yandex balloon custom wrapper */
.balloon-card-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

/* ============================================================
   LOADING SKELETON
   ============================================================ */
.map-skeleton {
    position: absolute;
    inset: 64px 0 72px 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
    transition: opacity 0.5s ease;
}

.map-skeleton.hidden {
    opacity: 0;
    pointer-events: none;
}

.skeleton-pulse {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-light);
    border-top-color: var(--accent-emerald);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.skeleton-text {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-muted);
    animation: pulse-text 1.5s ease-in-out infinite;
}

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

@keyframes pulse-text {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    text-align: center;
    z-index: 10;
    box-shadow: var(--shadow-card);
    max-width: 340px;
    transition: opacity 0.3s ease;
}

.empty-state.hidden {
    opacity: 0;
    pointer-events: none;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.empty-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 6px;
}

.empty-desc {
    font-size: 14px;
    color: var(--text-muted);
}

/* ============================================================
   BALLOON (Yandex custom balloon)
   ============================================================ */
.balloon-card {
    width: 260px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.balloon-photo {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    background: var(--bg-tertiary);
}

.balloon-body {
    padding: 12px 14px 10px;
}

.balloon-category {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 3px;
    color: var(--accent-mint);
}

.balloon-address {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.balloon-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    padding-top: 6px;
    border-top: 1px solid var(--border);
}

.balloon-link {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 11px;
    color: var(--accent-emerald);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.balloon-link:hover {
    color: var(--accent-mint);
}

.balloon-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

@media (min-width: 769px) {
    .toast-container {
        bottom: 24px;
        right: 24px;
        left: auto;
        transform: none;
    }
}

.toast {
    pointer-events: auto;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
    animation: toast-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 360px;
}

.toast.success { border-color: var(--accent-emerald); }
.toast.error { border-color: var(--accent-red); }
.toast.info { border-color: var(--accent-mint); }

.toast.out {
    animation: toast-out 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toast-in {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    animation: fade-in 0.2s ease;
}

.modal-overlay.hidden {
    display: none;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: var(--shadow-card);
    animation: modal-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}

.modal-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-emerald-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.btn-danger {
    background: var(--accent-red);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

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

.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-light);
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-in {
    from {
        transform: scale(0.95) translateY(10px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ============================================================
   PROBLEM DETAIL PAGE
   ============================================================ */
.problem-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.problem-photo {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    display: block;
    background: var(--bg-tertiary);
}

@media (max-width: 640px) {
    .problem-photo {
        max-height: 280px;
    }
}

.problem-body {
    padding: 28px 32px 32px;
}

@media (max-width: 640px) {
    .problem-body {
        padding: 20px;
    }
}

.info-label {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.info-value {
    font-size: 15px;
    line-height: 1.6;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
}

.status-badge.approved {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.pending {
    background: rgba(251, 191, 36, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

@media (max-width: 900px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }
}

.admin-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.admin-panel-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.problem-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 480px;
    overflow-y: auto;
}

.problem-list::-webkit-scrollbar {
    width: 4px;
}
.problem-list::-webkit-scrollbar-track {
    background: transparent;
}
.problem-list::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}

.admin-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.admin-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
}

.admin-item.selected {
    border-color: var(--accent-emerald);
    background: rgba(34, 197, 94, 0.08);
}

.admin-item-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-primary);
    flex-shrink: 0;
}

.admin-item-info {
    flex: 1;
    min-width: 0;
}

.admin-item-category {
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-display);
}

.admin-item-address {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-item-date {
    font-size: 10px;
    color: var(--text-muted);
}

.admin-delete-btn {
    flex-shrink: 0;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.2s;
}

.admin-delete-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
}

/* ============================================================
   LINKS & UTILS
   ============================================================ */
a {
    color: var(--accent-emerald);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-mint);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Category colors for markers */
.cat-openhatch { --cat-color: #ef4444; }
.cat-graffiti  { --cat-color: #a78bfa; }
.cat-trash     { --cat-color: #f97316; }
.cat-debris    { --cat-color: #6b7280; }
.cat-dump      { --cat-color: #22c55e; }
.cat-infra     { --cat-color: #3b82f6; }
.cat-other     { --cat-color: #ec4899; }
