body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

#map {
    flex-grow: 1;
    height: 100%;
    z-index: 1;
}

.sidebar {
    width: 330px;
    background-color: #fff;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
}

.sidebar.collapsed {
    transform: translateX(100%);
}

.sidebar-header {
    padding: 15px;
    background-color: #0078d4;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.2rem;
}

/* Toggle buttons */
.toggle-sidebar-btn {
    position: absolute;
    top: 10px;
    z-index: 1100;
    background-color: #0078d4;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-sidebar-btn:hover {
    background-color: #005a9e;
}

/* Right sidebar toggle */

.sidebar-content {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
}

.tool-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.tool-section h3 {
    margin-top: 0;
    font-size: 1rem;
    color: #333;
    margin-bottom: 10px;
}

.search-box {
    display: flex;
    gap: 5px;
}

#search-input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#search-btn,
#clear-search-btn {
    padding: 8px 12px;
    background-color: #0078d4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#search-btn:hover,
#clear-search-btn:hover {
    background-color: #005a9e;
}

/* Layer Control Styles */
.layer-group {
    margin-bottom: 10px;
}

.layer-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.layer-item input {
    margin-right: 8px;
}

.layer-item label {
    flex-grow: 1;
}

.settings-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 5px;
}

.settings-btn:hover {
    background-color: #f0f0f0;
    border-radius: 3px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Leaflet Customization */
.leaflet-popup-content-wrapper {
    border-radius: 4px;
}

.leaflet-control-minimap {
    border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
    border-radius: 4px;
}

.toggle-sidebar-btn.left-toggle {
    left: 10px;
    top: 5px;
}

.sidebar-content {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
}

.tool-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.tool-section h3 {
    margin-top: 0;
    font-size: 1rem;
    color: #333;
    margin-bottom: 10px;
}

.search-box {
    display: flex;
    gap: 5px;
}

#search-input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#search-btn,
#clear-search-btn {
    padding: 8px 12px;
    background-color: #0078d4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#search-btn:hover,
#clear-search-btn:hover {
    background-color: #005a9e;
}

/* Layer Control Styles */
.layer-group {
    margin-bottom: 10px;
}

.layer-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.layer-item input {
    margin-right: 8px;
}

.layer-item label {
    flex-grow: 1;
}

.settings-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 5px;
}

.settings-btn:hover {
    background-color: #f0f0f0;
    border-radius: 3px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Leaflet Customization */
.leaflet-popup-content-wrapper {
    border-radius: 4px;
}

.leaflet-control-minimap {
    border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
    border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-width: 300px;
    }
}

/* Popup Export Buttons */
.popup-export-btn {
    background-color: #0078d4;
    color: white;
    border: none;
    padding: 5px 10px;
    margin-right: 5px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
}

.popup-export-btn:hover {
    background-color: #005a9e;
}

/* Layer Export Buttons */
.layer-export-btn {
    transition: all 0.2s ease;
}

.layer-export-btn:hover {
    background-color: #218838 !important;
    transform: scale(1.05);
}

.layer-export-btn:active {
    transform: scale(0.95);
}

/* Перемещаем кнопку меню в правый верхний угол */
#toggle-sidebar {
    top: 5px !important;
    right: 10px !important;
    left: auto !important;
}

/* Убираем смещение при открытии */
#toggle-sidebar.shifted {
    right: 10px !important;
}

/* Zoom-кнопки ставим под кнопку меню */
.leaflet-top.leaflet-right {
    top: 50px !important;
}

/* Filter Styles */
.filter-group {
    margin-bottom: 15px;
}

.filter-group h4 {
    font-size: 0.9rem;
    margin: 10px 0 8px 0;
    color: #555;
    font-weight: 600;
}

.filter-label {
    display: flex;
    align-items: center;
    margin: 5px 0;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 3px 5px;
    transition: background-color 0.2s;
    border-radius: 3px;
}

.filter-label:hover {
    background-color: #f5f5f5;
}

.filter-checkbox {
    margin-right: 8px;
    cursor: pointer;
}

.filter-label span {
    flex-grow: 1;
    user-select: none;
}

/* Search Filters Section Border */
#search-filters-section {
    border: 2px solid #ccc;
    border-radius: 6px;
    padding: 15px;
    background-color: #fafafa;
    margin-top: 10px;
}