body { margin: 0; padding: 0; background: #000; overflow: hidden; font-family: -apple-system, system-ui, sans-serif; -webkit-font-smoothing: antialiased; color: white;}
#map { height: 100vh; width: 100vw; z-index: 1; background: #111; }

.maplibregl-canvas { filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%); }

.ui-panel {
    background: rgba(15, 18, 25, 0.85);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px; color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.status-overlay {
    position: absolute; top: 15px; left: 50%; transform: translateX(-50%);
    z-index: 1000; padding: 10px 18px;
    font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; gap: 10px; pointer-events: none;
}
.pulse-dot { width: 9px; height: 9px; background: #ff4d4d; border-radius: 50%; animation: status-blink 1.2s infinite; box-shadow: 0 0 10px #ff4d4d;}
@keyframes status-blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.9); } }

/* === АККУРАТНЫЙ ПЕРЕКЛЮЧАТЕЛЬ СТРАН === */
.country-switcher-container {
    position: absolute; top: 58px; left: 50%; transform: translateX(-50%);
    z-index: 1000; width: 150px; transition: opacity 0.25s;
}
.country-switcher {
    display: flex; position: relative; padding: 3px; height: 34px;
    background: rgba(15, 18, 25, 0.85); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.country-switcher input { display: none; }
.country-switcher label {
    flex: 1; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 13px; font-weight: 700; color: #999; z-index: 1; transition: color 0.2s;
}
.country-switcher input:checked + label { color: white; }
.country-switcher .glider {
    position: absolute; height: 28px; width: 70px;
    background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255,255,255,0.2);
    top: 2px; left: 3px; border-radius: 9px; z-index: 0; transition: transform 0.25s ease-out;
}
.country-switcher input[value="UA"]:checked ~ .glider { transform: translateX(71px); }

/* ИСПРАВЛЕННЫЕ СТИЛИ КРАСНЫХ ТОЧЕК (Аппаратное ускорение) */
.radar-blip {
    display: block !important;
    width: 32px; height: 32px; background: rgba(255, 60, 60, 0.8);
    border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 0 rgba(255, 60, 60, 1);
    animation: pulse-red-slow 2s infinite cubic-bezier(0.66, 0, 0, 1);
    transform: translateZ(0); 
    will-change: transform, box-shadow;
    z-index: 1000 !important;
}
.radar-blip.fast-pulse { animation: pulse-red-fast 1s infinite cubic-bezier(0.66, 0, 0, 1); }
.radar-blip.predicted { background: rgba(255, 204, 0, 0.8); box-shadow: 0 0 0 0 rgba(255, 204, 0, 1); animation: pulse-yellow-slow 2s infinite cubic-bezier(0.66, 0, 0, 1); border: 2px dashed #fff;}
.user-blip { background: rgba(255, 165, 0, 0.8); box-shadow: 0 0 0 0 rgba(255, 165, 0, 1); animation: pulse-yellow-slow 2s infinite cubic-bezier(0.66, 0, 0, 1); }

@keyframes pulse-red-slow { to { box-shadow: 0 0 0 45px rgba(255, 60, 60, 0); } }
@keyframes pulse-red-fast { to { box-shadow: 0 0 0 50px rgba(255, 60, 60, 0); } }
@keyframes pulse-yellow-slow { to { box-shadow: 0 0 0 40px rgba(255, 204, 0, 0); } }

/* СТИЛИ ДЛЯ МАРКЕРА "Я" */
.user-marker {
    width: 30px; height: 30px; background: #28a745; border-radius: 50%; border: 2px solid white; color: white;
    font-size: 15px; font-weight: bold; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 20px rgba(40, 255, 40, 0.7); cursor: pointer; position: relative; 
    transition: background-color 0.2s, box-shadow 0.2s;
}
.user-marker.active { background: #1e7e34; box-shadow: 0 0 30px rgba(40, 255, 40, 1); }
.user-marker::before, .user-marker::after {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    border: 1px solid rgba(40, 255, 40, 0.6); border-radius: 50%; width: 100%; height: 100%;
    animation: user-scan 2.5s infinite linear; pointer-events: none;
}
.user-marker::after { animation-delay: 1.25s; }
@keyframes user-scan { 0% { width: 100%; height: 100%; opacity: 1; } 100% { width: 350%; height: 350%; opacity: 0; } }

.radius-panel { position: absolute; bottom: 85px; left: 15px; right: 15px; display: none; flex-direction: column; gap: 10px; padding: 15px; z-index: 1200; border: 1px solid rgba(40, 255, 40, 0.4); animation: slideUp 0.3s forwards;}
.radius-panel.show { display: flex; }
.radius-header { display: flex; justify-content: space-between; align-items: center; font-weight: bold;}
.radius-val { color: #28a745; font-size: 18px; font-weight: 800;}
input[type=range] { -webkit-appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 20px; width: 20px; border-radius: 50%; background: #28a745; cursor: pointer; margin-top: -8px; box-shadow: 0 0 10px #28a745;}
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: rgba(255,255,255,0.2); border-radius: 2px;}
.btn-save-radius { padding: 12px; border-radius: 8px; border: none; background: #28a745; color: white; font-weight: bold; cursor: pointer; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Кнопки меню */
.nav-btns-container { position: absolute; top: 15px; right: 15px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.nav-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 19px; cursor: pointer; transition: all 0.2s; }
.nav-btn:active { transform: scale(0.92); background: rgba(50, 50, 50, 0.9); }
.admin-btn { display: none; font-size: 22px; border-color: rgba(255, 204, 0, 0.3); color: #ffcc00; }

.info-btns-container { position: absolute; top: 15px; left: 15px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; }
.side-btn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer;}
.side-btn:active { transform: scale(0.92); }

.ui-layer-bottom { position: absolute; bottom: 0; left: 0; right: 0; z-index: 1000; pointer-events: none; padding-bottom: calc(15px + env(safe-area-inset-bottom)); }
.bottom-content-wrapper { padding: 0 15px; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; }

.report-control-wrapper { width: 100%; max-width: 500px; position: relative; pointer-events: auto; }
.btn-report {
    width: 100%; padding: 16px; border-radius: 14px; border: none; font-size: 17px; font-weight: 700;
    color: white; cursor: pointer; background: rgba(255, 50, 50, 0.2); border: 1px solid rgba(255, 50, 50, 0.5);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-report:active { transform: scale(0.97); }

.report-confirm-panel {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: none; align-items: center; justify-content: space-between; padding: 0 8px; box-sizing: border-box;
    border-radius: 14px; background: rgba(20, 20, 30, 0.95); border: 1px solid rgba(255, 50, 50, 0.6);
    z-index: 1100; opacity: 0; transform: translateY(10px); transition: all 0.3s;
}
.report-confirm-panel.show { display: flex; opacity: 1; transform: translateY(0); }
.confirm-title { font-size: 13px; font-weight: 700; color: #ffcccc; margin-left: 10px; text-transform: uppercase;}
.confirm-btns { display: flex; gap: 6px; }
.c-btn { padding: 10px 14px; border-radius: 10px; border: none; font-size: 12px; font-weight: 700; cursor: pointer; text-transform: uppercase;}
.c-btn-cancel { background: rgba(255, 255, 255, 0.1); color: white; }
.c-btn-ok { background: #ff3c3c; color: white; box-shadow: 0 0 15px rgba(255, 60, 60, 0.5); }

.bottom-sheet {
    position: fixed; bottom: 0; left: 0; width: 100%; height: auto; max-height: 70vh;
    border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 2000; padding: 20px; box-sizing: border-box; overflow-y: auto; pointer-events: auto;
}
.bottom-sheet.show { transform: translateY(0); }
.sheet-handle { width: 40px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; margin: 0 auto 20px auto; cursor: grab;}
.sheet-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.sheet-title { font-size: 20px; font-weight: 800; color: #ff4d4d; margin: 0; line-height: 1.2;}
.sheet-region { font-size: 14px; color: rgba(255,255,255,0.7); margin: 4px 0 0 0; font-weight: 500;}
.sheet-time { font-size: 13px; color: #999; text-align: right; font-weight: 600; white-space: nowrap;}
.sheet-body { font-size: 15px; line-height: 1.5; color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.03); padding: 15px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05);}
.sheet-close { position: absolute; top: 15px; right: 15px; background: none; border: none; color: #666; font-size: 24px; cursor: pointer; padding: 5px; }

.fullscreen-panel {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 11, 15, 0.96); z-index: 2500; display: none; flex-direction: column;
    padding: 20px; padding-top: calc(20px + env(safe-area-inset-top));
    box-sizing: border-box; overflow-y: auto; opacity: 0; transform: scale(1.05); transition: all 0.25s;
}
.fullscreen-panel.show { display: flex; opacity: 1; transform: scale(1); }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid #333; padding-bottom: 15px; }
.panel-title { font-size: 22px; font-weight: 800; margin: 0;}
.close-panel { background: none; border: none; color: #999; font-size: 32px; cursor: pointer; padding: 0 5px; }

.feed-list { display: flex; flex-direction: column; gap: 10px; list-style: none; padding: 0; margin: 0; }
.feed-item {
    background: rgba(255,255,255,0.03); border-radius: 12px; border: 1px solid rgba(255,255,255,0.05);
    padding: 15px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 15px;
}
.feed-item.fresh { border-color: rgba(255, 60, 60, 0.3); background: rgba(255, 60, 60, 0.03); }
.feed-item-main { display: flex; flex-direction: column; gap: 3px; }
.feed-item-type { font-weight: 700; font-size: 15px; color: #ffcccc; }
.feed-item.fresh .feed-item-type { color: #ff5555; }
.feed-item-region { font-size: 13px; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 5px;}
.feed-item-count { color: #ffcc00; font-weight: 600; margin-left: 2px; }
.feed-item-time { font-size: 12px; color: #999; font-weight: 700; white-space: nowrap; text-align: right;}

.legend-list { display: flex; flex-direction: column; gap: 18px; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 15px; }
.legend-icon-swatch { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0;}
.legend-text { flex: 1; }
.legend-name { font-weight: 700; font-size: 15px; margin-bottom: 2px; color: white; }
.legend-desc { font-size: 13px; color: rgba(255,255,255,0.7); line-height: 1.4; }

.admin-section { background: rgba(30, 30, 30, 0.6); border-radius: 12px; padding: 15px; margin-bottom: 20px; border: 1px solid #444;}
.admin-list { list-style: none; padding: 0; margin: 10px 0; max-height: 180px; overflow-y: auto; }
.admin-list li { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.5); padding: 10px 12px; border-radius: 8px; margin-bottom: 5px; font-size: 14px; gap: 10px;}
.admin-list button { background: rgba(255,40,40,0.3); border: 1px solid rgba(255,40,40,0.5); color: white; border-radius: 6px; padding: 4px 10px; cursor: pointer; flex-shrink: 0;}
.admin-input-group { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.admin-input-group input, .admin-input-group select { padding: 12px; border-radius: 8px; border: 1px solid #555; background: #111; color: white; font-size: 14px;}
.admin-input-group button { padding: 12px; border-radius: 8px; border: none; background: #28a745; color: white; font-weight: bold; cursor: pointer; font-size: 14px;}

#mapOverlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1500; display: none; background: rgba(0,0,0,0.2); backdrop-filter: blur(2px);}

/* СТИЛИ КАЛЕНДАРЯ СТАТИСТИКИ */
.calendar-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; font-size: 18px; font-weight: bold; }
.calendar-controls button { background: rgba(255,255,255,0.1); border: none; color: white; padding: 10px 15px; border-radius: 8px; cursor: pointer; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.cal-day-header { font-size: 12px; color: #999; margin-bottom: 5px; }
.cal-day { padding: 10px 0; background: rgba(255,255,255,0.05); border-radius: 8px; cursor: pointer; font-size: 14px; transition: background 0.2s; }
.cal-day:active { transform: scale(0.95); }
.cal-day:hover { background: rgba(255,255,255,0.15); }
.cal-day.empty { background: transparent; cursor: default; }
.cal-day.selected { background: #ff4d4d; font-weight: bold; box-shadow: 0 0 10px rgba(255, 60, 60, 0.4); }

.stats-container { background: rgba(30, 30, 30, 0.6); border-radius: 12px; padding: 15px; border: 1px solid #444; }
.stats-container h3 { margin-top: 0; color: #ffcccc; border-bottom: 1px solid #444; padding-bottom: 10px; margin-bottom: 10px;}
.stats-list { list-style: none; padding: 0; margin: 0; }
.stats-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 14px; }
.stats-list li span:last-child { font-weight: bold; font-size: 16px; }