
@font-face {
    font-family: 'estedad';
    src: url('/fonts/estedad.woff2') format('woff2'),
        url('/fonts/estedad.ttf') format('truetype');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}
* { font-family: 'estedad', 'Estedad-FD', sans-serif; }
html, body { margin: 0; padding: 0; overflow: hidden; background: #05070d; }
#map { height: 100vh; width: 100vw; background: #05070d; }

/* === Dark, slightly desaturated/blue-tinted map === */
#map {
    filter: invert(1) hue-rotate(190deg) saturate(0.35) brightness(0.92) contrast(0.95);
}

.leaflet-marker-pane,
.leaflet-popup-pane,
.leaflet-tooltip-pane {
    filter: invert(1) hue-rotate(190deg);
}

/* ===== Leaflet zoom control - glass ===== */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: none !important;
    margin: 0 16px 16px 0 !important;
}
.leaflet-control-zoom a {
    background: rgba(255,255,255,0.06) !important;
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.10) !important;
    color: #e7eaf3 !important;
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    font-size: 18px !important;
    border-radius: 12px !important;
    margin-bottom: 8px !important;
    transition: all 0.2s ease;
}
.leaflet-control-zoom a:hover {
    background: rgba(249, 115, 22, 0.18) !important;
    color: #fb923c !important;
    border-color: rgba(249, 115, 22, 0.35) !important;
}
.leaflet-control-zoom a:first-child { border-radius: 12px 12px 6px 6px !important; }
.leaflet-control-zoom a:last-child { border-radius: 6px 6px 12px 12px !important; margin-bottom: 0 !important; }
.leaflet-control-zoom {
    margin-bottom: 100px !important;
}
.leaflet-control-attribution {
    background: rgba(15, 18, 30, 0.55) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #7c8aa5 !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 10px !important;
    margin: 0 8px 8px 0 !important;
}
.leaflet-control-attribution a { color: #9ca8c4 !important; }

/* ===== Glass popup ===== */
.leaflet-popup-content-wrapper {
    background: rgba(22, 26, 41, 0.72) !important;
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    color: #e7eaf3 !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}
.leaflet-popup-tip-container { display: none; }
.leaflet-popup-content {
    font-family: 'estedad', 'Vazirmatn', sans-serif !important;
    text-align: right;
    font-size: 13.5px;
    color: #e7eaf3 !important;
    margin: 14px 16px;
    line-height: 1.6;
}
.leaflet-popup-close-button {
    color: #8b96b3 !important;
    top: 8px !important;
    left: 8px !important;
    font-size: 18px !important;
}
.leaflet-popup-close-button:hover { color: #f1f5f9 !important; }

.leaflet-popup-close-button {
    left: 8px !important;
    right: auto !important;
}

/* ===== Glass pin form ===== */
.pin-form {
    background: rgba(20, 24, 38, 0.55);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-radius: 24px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.10);
    color: #e7eaf3;
}

.pin-form h3 {
    color: #f5f7fb;
    letter-spacing: -0.01em;
}

.pin-form textarea {
    background: rgba(8, 11, 22, 0.45);
    border: 1px solid rgba(255,255,255,0.08);
    color: #e7eaf3;
    border-radius: 14px;
}

.pin-form textarea::placeholder {
    color: #6b7793;
}

.pin-form textarea:focus {
    outline: none;
    border-color: rgba(249, 115, 22, 0.55);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

/* ===== Pulse animations ===== */
.pulse {
    animation: pulse 2.4s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.45); }
    70% { box-shadow: 0 0 0 22px rgba(249, 115, 22, 0); }
    100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

.pulse-blue {
    animation: pulseBlue 2s infinite;
}
@keyframes pulseBlue {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
    70% { box-shadow: 0 0 0 22px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* ===== Floating action buttons - glass ===== */
.glass-btn {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
    color: #cdd5e8;
}
.glass-btn:hover {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.18);
    color: #f1f5f9;
}

.add-pin-btn {
    background: linear-gradient(135deg, rgba(249,115,22,0.85), rgba(225,29,72,0.85));
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 10px 35px rgba(249,115,22,0.25), inset 0 1px 0 rgba(255,255,255,0.25);
    color: #fff;
}
.add-pin-btn:hover {
    background: linear-gradient(135deg, rgba(251,146,60,0.95), rgba(244,63,94,0.95));
}

/* ===== Type buttons ===== */
.type-btn {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    transition: all 0.2s ease;
}

/* Active states - Dark mode */
.type-btn.active-memory {
    background: rgba(168,85,247,0.35) !important;
    color: #d8b4fe !important;
    border-color: rgba(168,85,247,0.55) !important;
    box-shadow: 0 0 18px rgba(168,85,247,0.25);
}
.type-btn.active-experience {
    background: rgba(34,197,94,0.35) !important;
    color: #86efac !important;
    border-color: rgba(34,197,94,0.55) !important;
    box-shadow: 0 0 18px rgba(34,197,94,0.25);
}
.type-btn.active-opinion {
    background: rgba(59,130,246,0.35) !important;
    color: #93c5fd !important;
    border-color: rgba(59,130,246,0.55) !important;
    box-shadow: 0 0 18px rgba(59,130,246,0.25);
}
.type-btn.active-alert {
    background: rgba(239,68,68,0.35) !important;
    color: #fca5a5 !important;
    border-color: rgba(239,68,68,0.55) !important;
    box-shadow: 0 0 18px rgba(239,68,68,0.25);
}
.type-btn.active-request {
    background: rgba(249,115,22,0.35) !important;
    color: #fdba74 !important;
    border-color: rgba(249,115,22,0.55) !important;
    box-shadow: 0 0 18px rgba(249,115,22,0.25);
}
.type-btn.active-invite {
    background: rgba(20,184,166,0.35) !important;
    color: #5eead4 !important;
    border-color: rgba(20,184,166,0.55) !important;
    box-shadow: 0 0 18px rgba(20,184,166,0.25);
}

/* Type buttons in light mode */
body.light-mode .type-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #475569;
    font-weight: 600;
}

body.light-mode .type-btn.active-memory {
    background: rgba(168,85,247,0.15) !important;
    color: #7c3aed !important;
    border-color: rgba(168,85,247,0.5) !important;
    box-shadow: 0 0 18px rgba(168,85,247,0.2);
}
body.light-mode .type-btn.active-experience {
    background: rgba(34,197,94,0.15) !important;
    color: #16a34a !important;
    border-color: rgba(34,197,94,0.5) !important;
    box-shadow: 0 0 18px rgba(34,197,94,0.2);
}
body.light-mode .type-btn.active-opinion {
    background: rgba(59,130,246,0.15) !important;
    color: #2563eb !important;
    border-color: rgba(59,130,246,0.5) !important;
    box-shadow: 0 0 18px rgba(59,130,246,0.2);
}
body.light-mode .type-btn.active-alert {
    background: rgba(239,68,68,0.15) !important;
    color: #dc2626 !important;
    border-color: rgba(239,68,68,0.5) !important;
    box-shadow: 0 0 18px rgba(239,68,68,0.2);
}
body.light-mode .type-btn.active-request {
    background: rgba(249,115,22,0.15) !important;
    color: #ea580c !important;
    border-color: rgba(249,115,22,0.5) !important;
    box-shadow: 0 0 18px rgba(249,115,22,0.2);
}
body.light-mode .type-btn.active-invite {
    background: rgba(20,184,166,0.15) !important;
    color: #0d9488 !important;
    border-color: rgba(20,184,166,0.5) !important;
    box-shadow: 0 0 18px rgba(20,184,166,0.2);
}

/* ===== Overlay ===== */
#overlay {
    background: rgba(5, 7, 13, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}


/* ===== Hint banner ===== */
#clickHint {
    background: rgba(249, 115, 22, 0.22);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(249, 115, 22, 0.35);
    color: #fed7aa;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== Custom pin icons with glass ring ===== */
.pin-glass-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* User location pulse ring */
.user-loc-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: rgba(59,130,246,0.18);
    animation: ringPulse 2.4s infinite;
}
@keyframes ringPulse {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* ============================================== */
/* ===== Light mode styles ===== */
/* ============================================== */
body.light-mode,
body.light-mode #map {
    background: #f8fafc;
}

body.light-mode #map {
    filter: none;
}

body.light-mode .leaflet-marker-pane,
body.light-mode .leaflet-popup-pane,
body.light-mode .leaflet-tooltip-pane {
    filter: none;
}

/* Zoom control in light mode */
body.light-mode .leaflet-control-zoom a {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: #334155 !important;
}
body.light-mode .leaflet-control-zoom a:hover {
    background: rgba(249, 115, 22, 0.1) !important;
    color: #f97316 !important;
    border-color: rgba(249, 115, 22, 0.35) !important;
}

/* Attribution in light mode */
body.light-mode .leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #475569 !important;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
body.light-mode .leaflet-control-attribution a {
    color: #1e293b !important;
}

/* Popup in light mode */
body.light-mode .leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    color: #1e293b !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.6) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
}
body.light-mode .leaflet-popup-content {
    color: #1e293b !important;
}
body.light-mode .leaflet-popup-close-button {
    color: #64748b !important;
}
body.light-mode .leaflet-popup-close-button:hover {
    color: #0f172a !important;
}

/* Glass buttons in light mode */
body.light-mode .glass-btn {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
    color: #334155;
}
body.light-mode .glass-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
    color: #0f172a;
}
body.light-mode .glass-btn .fa-heart {
    color: #f43f5e;
}

/* Pin form in light mode */
body.light-mode .pin-form {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    box-shadow: 0 25px 80px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.08);
    color: #1e293b;
}
body.light-mode .pin-form h3 {
    color: #0f172a;
}
body.light-mode .pin-form textarea {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
}
body.light-mode .pin-form textarea::placeholder {
    color: #94a3b8;
}
body.light-mode .pin-form textarea:focus {
    border-color: rgba(249, 115, 22, 0.6);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}
body.light-mode .pin-form .text-slate-400 {
    color: #64748b;
}
body.light-mode .pin-form .text-slate-400:hover {
    color: #0f172a;
}

/* Type selection buttons in light mode */

/* Hint banner in light mode */
body.light-mode #clickHint {
    background: rgba(249, 115, 22, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(249, 115, 22, 0.4);
    color: #9a3412;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}

/* Overlay in light mode */
body.light-mode #overlay {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* User location ring slightly more visible in light mode */
body.light-mode .user-loc-ring {
    background: rgba(59,130,246,0.25);
}

/* ViMap title text in light mode */
body.light-mode .text-white\/90 {
    color: #1e293b;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-strong {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border: 1px solid rgba(255,255,255,0.08);
}

/* Terms modal in light mode */
body.light-mode .glass-strong {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border: 1px solid rgba(0,0,0,0.06);
    color: #1e293b;
}
body.light-mode #termsModal h2 {
    color: #0f172a;
}
body.light-mode #termsModal .text-slate-300 {
    color: #334155;
}
body.light-mode #termsModal .text-slate-400 {
    color: #475569;
}
body.light-mode #termsModal .text-slate-500 {
    color: #64748b;
}

/* ===== Support Modal in light mode ===== */
body.light-mode #supportModal .glass-strong {
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
}

body.light-mode #supportModal h2 {
    color: #0f172a;
}

body.light-mode #supportModal .text-slate-200 {
    color: #0f172a;
}

body.light-mode #supportModal .text-slate-300 {
    color: #334155;
}

body.light-mode #supportModal .text-slate-400 {
    color: #475569;
}

body.light-mode #supportModal .text-slate-500 {
    color: #64748b;
}

body.light-mode #supportModal .glass-btn {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #334155;
}

body.light-mode #supportModal .glass-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #0f172a;
}

body.light-mode #supportModal .fa-github {
    color: #1e293b !important;
}

body.light-mode #supportModal .group:hover .fa-github {
    color: #0f172a !important;
}

/* ===== Alert/Confirm Modal in light mode ===== */
body.light-mode #alertModal .glass-strong,
body.light-mode #confirmModal .glass-strong {
    background: rgba(255, 255, 255, 0.9);
    color: #1e293b;
}

body.light-mode #alertModal .text-slate-200,
body.light-mode #confirmModal .text-slate-200 {
    color: #1e293b;
}

body.light-mode #alertModal .text-slate-400,
body.light-mode #confirmModal .text-slate-400 {
    color: #475569;
}

body.light-mode #confirmModal .glass-btn {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #475569;
}

body.light-mode #confirmModal .glass-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

/* Support/About Modal in light mode */

body.light-mode #supportModal .border-rose-500\/20 { border-color: rgba(244,63,94,0.3) !important; }
body.light-mode #supportModal .text-rose-300\/80 { color: #e11d48 !important; }
body.light-mode #supportModal .text-rose-300 { color: #be123c !important; }
body.light-mode #supportModal .text-rose-200\/60 { color: #9f1239 !important; }
body.light-mode #supportModal .bg-rose-500\/10 { background: rgba(244,63,94,0.08) !important; }
body.light-mode #supportModal .border-rose-500\/30 { border-color: rgba(244,63,94,0.4) !important; }

@media (max-width: 640px) {
    .glass-strong {
        max-height: 80vh;
        overflow-y: auto;
        padding: 1rem !important;
    }
}

#loadingOverlay .animate-spin {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}