/* ================================================================
   MAP2 — Карта практик и ресурсов (Map2.cshtml)
   ================================================================ */

/* Секция и обёртка */
.map2-section { padding: 0; }
.map2-wrap    { position: relative; }
.map2-canvas  { height: 100vh; width: 100%; }

/* ── Панель справа ── */
.map2-panel {
    position: absolute;
    top: 80px; right: 20px;
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    display: none;
    z-index: 1000;
    overflow: hidden;
    max-height: calc(100vh - 120px);
}

.map2-panel-close {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(0,0,0,0.4);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 28px; height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}
.map2-panel-close:hover { background: rgba(0,0,0,0.65); }

.map2-panel-header {
    padding: 16px 16px 0 16px;
    border-bottom: 1px solid #f0f0f0;
}

.map2-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 10px;
    padding-right: 30px;
    line-height: 1.4;
}

/* ── Вкладки ── */
.map2-tabs {
    display: flex;
    margin-bottom: -1px;
}

.map2-tab {
    flex: 1;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #999;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.map2-tab i { margin-right: 4px; }

.map2-tab.active          { color: #2e7d32; border-bottom-color: #2e7d32; }
.map2-tab:last-child.active { color: #1565c0; border-bottom-color: #1565c0; }

/* ── Бейджи счётчиков ── */
.map2-badge {
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
    margin-left: 4px;
    color: #fff;
}
.map2-badge.green { background: #2e7d32; }
.map2-badge.grey  { background: #999; }
.map2-badge.blue  { background: #1565c0; }

/* ── Тело панели ── */
.map2-panel-body {
    overflow-y: auto;
    max-height: calc(100vh - 260px);
}
.map2-tab-pane { padding: 12px; }

/* ── Элементы списка ── */
.map2-item {
    display: block;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s;
}
.map2-item:last-child { border-bottom: none; }
.map2-item:hover      { opacity: 0.8; }

.map2-item-thumb {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 6px;
}

.map2-item-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 3px;
}
.map2-item-title.green { color: #1b5e20; }
.map2-item-title.blue  { color: #1565c0; }

.map2-item-meta {
    font-size: 11px;
    color: #999;
}

.map2-empty {
    font-size: 13px;
    color: #999;
    margin: 0;
    padding: 4px 0;
}
.map2-error { color: #c62828; }

/* ── Маркеры на карте ── */
.district-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.8);
    cursor: default;
}

.marker-pin {
    position: relative;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #2e7d32;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: transform 0.15s;
}
.marker-pin:hover         { transform: scale(1.4); background: #1b5e20; }
.marker-pin.active        { background: #f57f17; transform: scale(1.4); }

.marker-count {
    position: absolute;
    top: -8px; right: -8px;
    background: #f57f17;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 50%;
    width: 14px; height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Подписи на карте ── */
.district-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    transition: color 0.3s, text-shadow 0.3s;
}
.district-label::before { display: none !important; }

.practice-label {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #4caf50 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9) !important;
}

/* ── Переключатель подложек ── */
.leaflet-control-layers {
    background: rgba(0,0,0,0.6) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15) !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3) !important;
    margin-top: 80px !important;
    margin-left: 10px !important;
}
.leaflet-control-layers::before {
    content: '🗺 Подложка';
    display: block;
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.leaflet-control-layers-base label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff !important;
    font-size: 13px;
    padding: 5px 0;
    cursor: pointer;
    transition: color 0.15s;
}
.leaflet-control-layers-base label:hover      { color: #a5d6a7 !important; }
.leaflet-control-layers-base input[type="radio"] {
    accent-color: #4caf50;
    width: 14px; height: 14px;
    cursor: pointer;
}
.leaflet-control-layers-separator { display: none; }

.map-type-switcher-ctrl {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
    border-radius: 0 0 8px 8px;
    padding: 6px 8px;
    display: flex;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    margin-top: -1px;
}
.map-type-btn {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    color: #555;
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
}

.map-type-btn.active {
    background: #2e7d32;
    color: #fff;
    border-radius: 6px;
}

.map-type-btn:hover {
    background: #e8f5e9;
    color: #2e7d32;
    text-decoration: none;
}
