body, html {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f5f7f5;
    color: #2c3e50;
    padding-bottom: 10px;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 25px;
    padding: 25px 0;
    border-bottom: 2px solid #5b7065;
}

header h1 {
    font-size: 26px;
    font-weight: 400;
    color: #304040;
    margin: 0 0 8px 0;
    letter-spacing: 1px;
}

.subtitle {
    color: #5b7065;
    font-size: 14px;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0;
}

/* Панель управления */
.control-panel {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #c9d1c8;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.control-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.district-selector {
    flex: 1;
}

.control-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #5b7065;
    margin: 0 0 12px 0;
    font-weight: 600;
}

/* Кнопки районов */
.district-buttons {
    display: flex;
    gap: 10px;
}

.district-btn {
    padding: 10px 18px;
    background: #f5f7f5;
    border: 1px solid #c9d1c8;
    color: #304040;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.district-btn:hover {
    background: #e8ebe8;
    border-color: #5b7065;
}

.district-btn.active {
    background: #304040;
    border-color: #304040;
    color: #ffffff;
}

.district-btn.all.active {
    background: #5b7065;
    border-color: #5b7065;
}

.monument-count {
    opacity: 0.7;
    font-size: 11px;
    margin-left: 4px;
}

/* Toggle для подписей */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid #c9d1c8;
}

.toggle-label {
    font-size: 12px;
    color: #5b7065;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #c9d1c8;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.toggle-switch.active {
    background: #5b7065;
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(20px);
}

/* Контент */
.content {
    display: flex;
    gap: 20px;
}

/* Карта */
.map-container {
    flex: 1;
    height: 700px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #c9d1c8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#map {
    width: 100%;
    height: 100%;
}

/* Инфо-панель */
.info-panel {
    width: 400px;
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #c9d1c8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow-y: auto;
    max-height: 700px;
}

.info-panel h2 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #304040;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #5b7065;
    font-weight: 600;
}

/* Пустое состояние */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #5b7065;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

/* Инфо о районе */
.district-info-header {
    background: #f5f7f5;
    border: 1px solid #c9d1c8;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.district-info-title {
    font-size: 18px;
    font-weight: 500;
    color: #304040;
    margin: 0 0 10px 0;
}

.district-info-desc {
    font-size: 13px;
    color: #5b7065;
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.district-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #c9d1c8;
    font-size: 13px;
    color: #304040;
}

.district-stat-icon {
    color: #5b7065;
}

/* Карточка памятника */
.monument-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 15px;
    transition: all 0.2s;
    border-left: 4px solid #5b7065;
}

.monument-card:hover {
    border-color: #5b7065;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.monument-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 10px;
        flex-wrap: wrap;
}

.monument-title {
    font-size: 15px;
    font-weight: 500;
    color: #304040;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.monument-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.monument-description {
    color: #5b7065;
    font-size: 13px;
    line-height: 1.7;
    margin: 0 0 12px 0;
}

.monument-meta {
    font-size: 12px;
    color: #5b7065;
}

.monument-meta-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    line-height: 1.5;
}

.monument-meta-label {
    color: #304040;
    font-weight: 500;
    min-width: 70px;
    flex-shrink: 0;
}

/* Ссылка на фото */
.photo-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 14px;
    background: #304040;
    color: #ffffff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.photo-link:hover {
    background: #5b7065;
}

/* Скрытые подписи */
.monument-label.hidden {
    opacity: 0 !important;
    pointer-events: none;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .content {
        flex-direction: column;
    }
    
    .info-panel {
        width: auto;
        max-height: 400px;
    }
    
    .map-container {
        height: 500px;
    }
}

@media (max-width: 768px) {
    .control-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toggle-container {
        padding-left: 0;
        padding-top: 15px;
        border-left: none;
        border-top: 1px solid #c9d1c8;
        justify-content: space-between;
    }
    
    .district-buttons {
        justify-content: center;
    }
    
    header h1 {
        font-size: 20px;
    }
    
    .info-panel {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .district-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .monument-title {
        font-size: 14px;
    }
}

.monument-label {
    margin-left: -30px !important;
    margin-top: 10px !important;
    transition: opacity 0.3s;
}

.monument-label.hidden {
    opacity: 0 !important;
    pointer-events: none;
}

/* Иконка плиты - стили при необходимости */
.monument-label div {
    background: rgba(48, 64, 64, 0.9) !important;
}
/* ===== СТИЛИ ДЛЯ ПОИСКА ===== */
.search-container {
    flex: 1;
    max-width: 450px;
    margin: 0 20px;
    position: relative;
}

.search-box {
    display: flex;
    gap: 8px;
    position: relative;
}

#search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #c9d1c8;
    border-radius: 6px;
    font-size: 13px;
    background: #f5f7f5;
    color: #304040;
    transition: all 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: #5b7065;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(91, 112, 101, 0.1);
}

#search-input::placeholder {
    color: #8a9a91;
    font-style: italic;
}

.search-btn {
    padding: 10px 16px;
    background: #304040;
    border: 1px solid #304040;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.search-btn:hover {
    background: #5b7065;
    border-color: #5b7065;
}

/* Результаты поиска */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #c9d1c8;
    border-radius: 6px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #e8ebe8;
    cursor: pointer;
    transition: all 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f5f7f5;
}

.search-result-item.selected {
    background: #e8ebe8;
    border-left: 3px solid #304040;
}

.search-result-title {
    font-weight: 600;
    color: #304040;
    margin-bottom: 4px;
    font-size: 13px;
}

.search-result-location {
    font-size: 11px;
    color: #5b7065;
    margin-bottom: 4px;
}

.search-result-type {
    display: inline-block;
    padding: 2px 8px;
    background: #304040;
    color: white;
    border-radius: 12px;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-result-type.obelisktag {
    background: #6b5b95;
}

.search-result-type.znak {
    background: #88b04b;
}

.search-result-type.doska {
    background: #5b7065;
}

.search-result-type.plita {
    background: #955251;
}

.search-result-type.complex {
    background: #8b4513;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: #5b7065;
    font-style: italic;
}

/* Адаптивность для поиска */
@media (max-width: 1024px) {
    .search-container {
        max-width: 100%;
        margin: 15px 0;
    }
    
    .control-section {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
    }
    
    .search-btn {
        width: 100%;
    }
    
    .search-results {
        max-height: 250px;
    }
}
/* Дополнительные стили для результатов поиска */
.search-result-burial {
    font-size: 10px;
    color: #304040;
    background: #e8ebe8;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
    font-weight: 500;
}

/* Подсветка найденного текста (опционально) */
.search-result-item mark {
    background: #ffd700;
    color: #304040;
    padding: 0 2px;
    border-radius: 2px;
}
/* Стили для фильтров типов */
.type-filters-container {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.type-filters-title {
    font-size: 12px;
    font-weight: 600;
    color: #304040;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.type-filter {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 16px;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
    user-select: none;
}

.type-filter:hover {
    background: #e9ecef;
    border-color: #d0d0d0;
}

.type-filter.active {
    background: #304040;
    color: white;
    border-color: #304040;
}

/* Цвета для активных фильтров по типам */
.type-filter.active[data-type="Цитадель"] {
    background: #8B0000;
    border-color: #8B0000;
}

.type-filter.active[data-type="Памятник"] {
    background: #304040;
    border-color: #304040;
}

.type-filter.active[data-type="Обелиск"] {
    background: #6b5b95;
    border-color: #6b5b95;
}

.type-filter.active[data-type="знак"] {
    background: #88b04b;
    border-color: #88b04b;
}

.type-filter.active[data-type="доска"] {
    background: #5b7065;
    border-color: #5b7065;
}

.type-filter.active[data-type="плита"] {
    background: #955251;
    border-color: #955251;
}

.type-filter.active[data-type="комплекс"] {
    background: #8b4513;
    border-color: #8b4513;
}

.type-filter-icon {
    font-size: 12px;
}

.type-count {
    background: rgba(0,0,0,0.1);
    padding: 1px 5px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
}

.type-filter.active .type-count {
    background: rgba(255,255,255,0.3);
}

/* Индикатор цитадели в результатах поиска */
.citadel-item {
    border-left: 3px solid #8B0000;
    background: linear-gradient(to right, rgba(139, 0, 0, 0.05), transparent);
}

.search-result-type.citadel {
    background: #8B000015;
    color: #8B0000;
    border: 1px solid #8B000040;
}

/* Стили для маркера цитадели */
.citadel-marker {
    animation: pulse-citadel 2s infinite;
}

@keyframes pulse-citadel {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Адаптивность */
@media (max-width: 768px) {
    .type-filters {
        gap: 4px;
    }
    
    .type-filter {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* ===== СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА ФОТОГРАФИЙ ===== */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.photo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.photo-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.photo-modal.active .photo-modal-content {
    transform: scale(1);
}

.photo-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(48, 64, 64, 0.9);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.photo-modal-close:hover {
    background: #5b7065;
    transform: rotate(90deg);
}

#photo-modal-image {
    display: block;
    max-width: 85vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.photo-modal-caption {
    padding: 15px 20px;
    background: #f5f7f5;
    border-top: 1px solid #c9d1c8;
    font-size: 14px;
    color: #304040;
    text-align: center;
    max-width: 85vw;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .photo-modal-content {
        max-width: 95vw;
        max-height: 85vh;
        border-radius: 8px;
    }
    
    #photo-modal-image {
        max-width: 95vw;
        max-height: 70vh;
    }
    
    .photo-modal-caption {
        max-width: 95vw;
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .photo-modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

/* Анимация загрузки изображения */
#photo-modal-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#photo-modal-image.loaded {
    opacity: 1;
}
/* Кнопка копирования координат */
.copy-coords-btn {
    margin-left: 8px;
    padding: 4px 8px;
    background: #f5f7f5;
    border: 1px solid #c9d1c8;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #5b7065;
}

.copy-coords-btn:hover {
    background: #304040;
    border-color: #304040;
    color: #ffffff;
}

.copy-coords-btn svg {
    display: block;
}