/* ============================================================
   css/style.css - Основные стили карты свалок
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ==================== ПРОГРЕСС-БАР ЗАГРУЗКИ ==================== */
.load-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.2);
    z-index: 10000;
    display: none;
}

.load-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71, #3498db);
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 1s infinite;
}

@keyframes progressPulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* ==================== ФИКС МЕРЦАНИЯ КАРТЫ ==================== */
.ol-viewport {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.ol-layer {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

#map {
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

.ol-viewport .ol-layer {
    transition: none !important;
}

canvas.ol-unselectable {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.ol-viewport,
.ol-layer,
canvas {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
    -webkit-perspective: 1000;
}

@media (min-width: 2560px) {
    .ol-viewport {
        transform: translateZ(0) scale(1);
        -webkit-transform: translateZ(0) scale(1);
    }
    .ol-layer {
        image-rendering: crisp-edges;
        image-rendering: -webkit-optimize-contrast;
    }
    .ol-unselectable {
        -webkit-font-smoothing: antialiased;
    }
}

/* ==================== НАВИГАЦИОННЫЕ ВКЛАДКИ ==================== */
.nav-tabs {
    background: white;
    padding: 0 20px;
    display: flex;
    gap: 5px;
    border-bottom: 1px solid #eef2f6;
    flex-shrink: 0;
}

.nav-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #7f8c8d;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 2px solid transparent;
}

.nav-tab:hover { color: #3498db; }
.nav-tab.active { color: #3498db; border-bottom-color: #3498db; }

.map-container:hover canvas {
    will-change: auto;
}

/* ==================== ШАПКА ==================== */
header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 100;
    flex-wrap: wrap;
    gap: 10px;
}

.header-title h1 {
    font-size: 24px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.header-title p {
    font-size: 14px;
    opacity: 0.8;
}

.version-badge {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin-left: 10px;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.1);
    padding: 8px 20px;
    border-radius: 30px;
    flex-wrap: wrap;
}

.user-name {
    font-size: 14px;
    font-weight: bold;
    font-family: monospace;
}

.user-role {
    font-size: 12px;
    background: #3498db;
    padding: 3px 10px;
    border-radius: 15px;
}

.user-type-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.user-type-badge.qualified {
    background: #f1c40f;
    color: #2c3e50;
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

.user-type-badge.regular {
    background: #95a5a6;
    color: white;
}

/* ==================== КНОПКИ ==================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-small {
    padding: 8px 15px;
    font-size: 14px;
}

.btn-add {
    background: #27ae60;
    color: white;
}

.btn-add:hover {
    background: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.3);
}

.btn-cancel {
    background: #e74c3c;
    color: white;
}

.btn-cancel:hover {
    background: #c0392b;
}

.btn-login {
    background: #3498db;
    color: white;
}

.btn-login:hover {
    background: #2980b9;
}

.btn-logout {
    background: #95a5a6;
    color: white;
}

.btn-logout:hover {
    background: #7f8c8d;
}

.btn-admin {
    background: #9b59b6;
    color: white;
}

.btn-admin:hover {
    background: #8e44ad;
}

.btn-my-observations {
    background: #f39c12;
    color: white;
}

.btn-my-observations:hover {
    background: #e67e22;
}

.btn-statistics {
    background: #3498db;
    color: white;
}

.btn-statistics:hover {
    background: #2980b9;
}

.btn-training {
    background: #9b59b6;
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-training:hover {
    background: #8e44ad;
}

.btn-training::after {
    content: '🎓';
    margin-left: 5px;
}

.btn-account {
    background: #9b59b6;
    color: white;
}

.btn-account:hover {
    background: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(155, 89, 182, 0.3);
}

.btn-vk {
    background: #4c75a3;
    color: white;
}

.btn-vk:hover {
    background: #3a5d82;
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(76, 117, 163, 0.3);
}

/* ==================== ПАНЕЛЬ УПРАВЛЕНИЯ ==================== */
.controls {
    background: #34495e;
    padding: 15px 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 10;
    border-bottom: 1px solid #2c3e50;
}

.controls-left {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex: 1;
}

.controls-right {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.coord-info {
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    color: white;
    font-family: monospace;
}

.info-message {
    background: #f39c12;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

/* ==================== ОСНОВНОЙ КОНТЕЙНЕР ==================== */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background: #ecf0f1;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 5;
    transition: transform 0.3s ease;
}

.sidebar-left {
    border-right: 1px solid #bdc3c7;
}

.sidebar-left.collapsed {
    transform: translateX(-100%);
    position: absolute;
    width: 280px;
    height: calc(100vh - 120px);
    background: #ecf0f1;
}

.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
}

.map-container.heatmap-mode #map {
    background: linear-gradient(135deg, #2c1a4d 0%, #1a0f2e 100%);
}

/* ==================== ЛЕГЕНДА ТЕПЛОВОЙ КАРТЫ ==================== */
.heatmap-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    z-index: 1000;
    display: none;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}

.heatmap-legend.show {
    display: block;
}

.legend-gradient {
    width: 200px;
    height: 20px;
    background: linear-gradient(to right, 
        #4B0082, #6A0DAD, #8A2BE2, #4169E1, 
        #1E90FF, #00CED1, #3CB371, #ADFF2F, 
        #FFFF00, #FFA500, #FF4500, #FF0000);
    margin: 10px 0;
    border-radius: 4px;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}

.legend-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #fff;
}

/* ==================== ПЕРЕКЛЮЧАТЕЛЬ САЙДБАРА ==================== */
.sidebar-toggle {
    position: absolute;
    width: 30px;
    height: 60px;
    background: #2c3e50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    border-radius: 0 5px 5px 0;
    transition: all 0.3s;
    font-size: 20px;
}

.sidebar-toggle.left-toggle {
    left: 280px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 0 5px 5px 0;
}

.sidebar-toggle.left-toggle.collapsed {
    left: 0;
}

.sidebar-toggle:hover {
    background: #3498db;
}

/* ==================== ПАНЕЛЬ ФИЛЬТРОВ ==================== */
.map-filter-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
    min-width: 280px;
    max-width: 320px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.map-filter-panel.collapsed {
    transform: translateX(-110%);
    opacity: 0;
    pointer-events: none;
}

.map-filter-panel h4 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 14px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.panel-header h4 {
    margin-bottom: 0;
}

.panel-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #7f8c8d;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.panel-close-btn:hover {
    background: #e74c3c;
    color: white;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
    font-weight: bold;
}

.filter-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.map-filter-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    flex: 1;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.map-filter-btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.map-filter-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.map-filter-btn.size-small.active { background: #f1c40f; color: #2c3e50; border-color: #f39c12; }
.map-filter-btn.size-medium.active { background: #e67e22; color: white; border-color: #d35400; }
.map-filter-btn.size-large.active { background: #e74c3c; color: white; border-color: #c0392b; }

/* ==================== ПАНЕЛЬ СЛОЁВ КАРТЫ ==================== */
.map-layer-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: white;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
    min-width: 200px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.map-layer-panel.collapsed {
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
}

.layer-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layer-btn {
    padding: 10px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.layer-btn:hover {
    background: #f8f9fa;
    transform: translateX(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.layer-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.layer-btn .layer-icon {
    font-size: 18px;
}

.reset-filter-btn {
    width: 100%;
    padding: 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s;
}

.reset-filter-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

.active-filters {
    margin-top: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 12px;
    color: #7f8c8d;
    max-height: 100px;
    overflow-y: auto;
}

.active-filters span {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    margin: 2px;
    font-size: 11px;
}

.year-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    background: white;
    cursor: pointer;
}

.year-select:focus {
    outline: none;
    border-color: #3498db;
}

/* ==================== ПОПАП ==================== */
.ol-popup {
    position: absolute;
    background-color: white;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #ecf0f1;
    bottom: 12px;
    left: -50px;
    min-width: 280px;
    max-width: 380px;
    width: calc(100vw - 40px);
    z-index: 1000;
    animation: popupFadeIn 0.2s ease-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ol-popup:after, .ol-popup:before {
    top: 100%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}

.ol-popup:after {
    border-top-color: white;
    border-width: 10px;
    left: 48px;
    margin-left: -10px;
}

.ol-popup:before {
    border-top-color: #bdc3c7;
    border-width: 11px;
    left: 48px;
    margin-left: -11px;
}

.popup-content {
    padding: 5px;
    position: relative;
}

.popup-content h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    padding-right: 30px;
}

.popup-content p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

.popup-loading {
    text-align: center;
    padding: 30px;
}

.popup-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #ecf0f1;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    margin: 5px 0;
}

.status-new { background: #3498db; }
.status-in_progress { background: #f39c12; }
.status-resolved { background: #27ae60; }
.status-rejected { background: #e74c3c; }

.size-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    margin: 5px 0;
}

.size.small { background: #f1c40f; color: #2c3e50; }
.size.medium { background: #e67e22; }
.size.large { background: #e74c3c; }

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    color: white;
    font-size: 12px;
    font-weight: bold;
    margin: 5px 0;
}

.priority-badge {
    background: #f1c40f;
    color: #2c3e50;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    margin-left: 8px;
}

.popup-photo {
    max-width: 100%;
    max-height: 150px;
    margin: 15px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s;
    border: 2px solid #ecf0f1;
}

.popup-photo:hover {
    transform: scale(1.05);
    border-color: #3498db;
}

.popup-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #7f8c8d;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.popup-close-btn:hover {
    background: #e74c3c;
    color: white;
    transform: rotate(90deg);
}

/* ==================== САЙДБАР-ВИДЖЕТЫ ==================== */
.sidebar-widget {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar-widget h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.widget-content {
    font-size: 14px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 5px;
    transition: all 0.3s;
}

.stat-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.stat-item.total {
    background: #2c3e50;
    color: white;
    font-weight: bold;
}

.recent-dump-item {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 3px solid #3498db;
}

.recent-dump-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.recent-dump-item.priority {
    border-left-color: #f1c40f;
    background: #fff9e6;
}

/* ==================== ФОРМЫ ==================== */
.add-form, .login-form, .status-form {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    max-width: 400px;
    margin: 10px;
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1000;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

.form-collapse-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #7f8c8d;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.form-collapse-btn:hover {
    background: #e74c3c;
    color: white;
}

.add-form.collapsed {
    padding: 15px;
    width: auto;
    min-width: 200px;
    max-width: 250px;
}

.add-form.collapsed .form-collapse-btn {
    transform: rotate(180deg);
}

.add-form.collapsed .form-body {
    display: none;
}

.add-form.collapsed h3 {
    margin-bottom: 0;
    font-size: 16px;
    padding-right: 30px;
}

.coord-selection-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coord-display {
    background: #ecf0f1;
    padding: 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
    border: 1px solid #bdc3c7;
    flex: 1;
    cursor: pointer;
    transition: all 0.2s;
}

.coord-display:hover {
    background: #d5dbdb;
}

.coord-display.selected {
    background: #d4edda;
    border-color: #27ae60;
}

.select-coord-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.select-coord-btn:hover {
    background: #2980b9;
    transform: scale(1.05);
}

.select-coord-btn.active {
    background: #27ae60;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); background: #2ecc71; }
    100% { transform: scale(1); }
}

.back-to-form-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: none;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    animation: fadeUp 0.3s ease;
}

.back-to-form-btn:hover {
    background: #3498db;
    transform: translateX(-50%) scale(1.02);
}

.back-to-form-btn.show {
    display: flex;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.add-form h3, .login-form h3, .status-form h3 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    padding-right: 30px;
}

.add-form input, .add-form textarea, .add-form select,
.login-form input,
.status-form input, .status-form select, .status-form textarea {
    width: 100%;
    padding: 10px;
    margin: 8px 0 15px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.add-form textarea, .status-form textarea {
    height: 100px;
    resize: vertical;
}

.add-form label, .login-form label, .status-form label {
    font-weight: bold;
    color: #34495e;
    display: block;
    margin-top: 10px;
    font-size: 14px;
}

.photo-preview {
    max-width: 100%;
    max-height: 200px;
    margin: 15px 0;
    display: none;
    border-radius: 5px;
    border: 2px solid #ddd;
}

.file-input-wrapper {
    position: relative;
    margin: 10px 0;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-button {
    background: #3498db;
    color: white;
    padding: 12px;
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
}

.file-input-button:hover {
    background: #2980b9;
}

.file-name {
    margin-top: 8px;
    font-size: 12px;
    color: #7f8c8d;
}

.size-selector {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.size-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: white;
    transition: all 0.3s;
    font-size: 14px;
}

.size-btn.small.selected {
    background: #f1c40f;
    border-color: #f39c12;
    color: #2c3e50;
    font-weight: bold;
}

.size-btn.medium.selected {
    background: #e67e22;
    border-color: #d35400;
    color: white;
    font-weight: bold;
}

.size-btn.large.selected {
    background: #e74c3c;
    border-color: #c0392b;
    color: white;
    font-weight: bold;
}

/* ==================== МОДАЛЬНЫЕ ОКНА ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.photo-modal img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.close-photo-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 50px;
    cursor: pointer;
    transition: all 0.3s;
}

.close-photo-modal:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

/* ==================== ПРОЧЕЕ ==================== */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.toggle-all-panels {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.toggle-all-panels:hover {
    background: #3498db;
    transform: scale(1.1);
}

.username-display {
    font-family: monospace;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #2c3e50;
}

/* ==================== TOAST УВЕДОМЛЕНИЯ ==================== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: none;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    font-size: 14px;
    max-width: 320px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.toast.success { background: #27ae60; }
.toast.error { background: #e74c3c; }
.toast.info { background: #3498db; }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== МОБИЛЬНАЯ АДАПТАЦИЯ ==================== */
@media (max-width: 768px) {
    header { padding: 10px 12px; }
    .header-title h1 { font-size: 16px; }
    .header-title p { font-size: 9px; }
    .version-badge { font-size: 7px; padding: 2px 5px; }
    .btn, .btn-small { padding: 5px 10px; font-size: 11px; }
    .user-info { padding: 4px 10px; gap: 6px; }
    .user-name { font-size: 10px; }
    .user-role, .user-type-badge { font-size: 9px; padding: 2px 6px; }
    .controls { padding: 8px 10px; }
    .coord-info { font-size: 10px; padding: 3px 8px; }
    .info-message { font-size: 10px; padding: 3px 8px; }
    
    .sidebar-left {
        position: absolute;
        transform: translateX(-100%);
        width: 260px;
        height: calc(100vh - 110px);
        z-index: 200;
        transition: transform 0.3s ease;
    }
    .sidebar-left.mobile-visible {
        transform: translateX(0);
    }
    .sidebar-toggle.left-toggle {
        display: none;
    }
    .mobile-menu-btn {
        display: flex;
        position: absolute;
        top: 70px;
        left: 10px;
        z-index: 1000;
        background: #2c3e50;
        color: white;
        border: none;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        font-size: 20px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
        transition: all 0.3s;
    }
    .mobile-menu-btn:hover {
        background: #3498db;
    }
    .map-filter-panel {
        top: auto;
        bottom: 70px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        min-width: auto;
        transform: translateY(100%);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .map-filter-panel.mobile-visible {
        transform: translateY(0);
        opacity: 1;
    }
    .map-layer-panel {
        top: auto;
        bottom: 70px;
        right: 10px;
        left: 10px;
        width: auto;
        min-width: auto;
        transform: translateY(100%);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .map-layer-panel.mobile-visible {
        transform: translateY(0);
        opacity: 1;
    }
    .mobile-layer-toggle {
        display: flex;
        bottom: 70px;
        left: auto;
        right: 20px;
    }
    
    .ol-popup {
        min-width: 260px;
        max-width: 320px;
        padding: 15px;
    }
    
    .ol-popup:after, .ol-popup:before {
        display: none;
    }
    
    .popup-content h4 {
        font-size: 16px;
        margin-bottom: 10px;
        padding-right: 30px;
    }
    
    .popup-content p {
        font-size: 12px;
        margin: 6px 0;
    }
    
    .popup-content .status-badge,
    .popup-content .size-badge,
    .popup-content .category-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .popup-content .popup-photo {
        max-height: 120px;
        margin: 10px 0;
    }
    
    .popup-close-btn {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .add-form, .login-form, .status-form {
        left: 10px;
        right: 10px;
        top: 60px;
        max-width: none;
        width: auto;
        padding: 15px;
        max-height: 80vh;
    }
    
    .add-form h3, .login-form h3, .status-form h3 {
        font-size: 16px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    
    .add-form label, .login-form label, .status-form label {
        font-size: 12px;
        margin-top: 8px;
    }
    
    .add-form input, .add-form textarea, .add-form select,
    .login-form input,
    .status-form input, .status-form select, .status-form textarea {
        padding: 8px;
        font-size: 13px;
        margin: 5px 0 10px 0;
    }
    
    .size-selector {
        gap: 5px;
    }
    
    .size-btn {
        font-size: 11px;
        padding: 6px;
    }
    
    .toggle-all-panels {
        bottom: 70px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .heatmap-legend {
        bottom: 70px;
        left: 10px;
        right: 10px;
        width: auto;
        font-size: 10px;
        padding: 8px;
    }
    
    .legend-gradient {
        width: 100%;
        height: 15px;
    }
    
    .back-to-form-btn {
        bottom: 80px;
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .sidebar-widget {
        padding: 12px;
    }
    
    .sidebar-widget h3 {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .stat-item {
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .recent-dump-item {
        font-size: 11px;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .controls-left {
        width: 100%;
        justify-content: space-between;
    }
    .controls-right {
        width: 100%;
        justify-content: space-between;
    }
    .btn {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .popup-content h4 {
        font-size: 14px;
    }
    
    .popup-content p {
        font-size: 11px;
    }
    
    .popup-content .status-badge,
    .popup-content .size-badge,
    .popup-content .category-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}
/* ==================== ПРОКРУТКА СТРАНИЦЫ ОТЧЁТНОСТИ ==================== */

/* Переопределяем overflow: hidden из style.css */
body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100vh;
}

/* Контейнер отчётов — обычный поток */
.reports-container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px 40px;
}

/* Основной лэйаут — не фиксированный */
.reports-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: start;
}

/* Левая колонка — sticky, но со своим скроллом */
.reports-sidebar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
}

.reports-sidebar > .sidebar-section {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.reports-sidebar > .sidebar-section:first-child,
.reports-sidebar > .sidebar-section:last-child {
    flex: 0 0 auto;
}

/* Правая колонка — растёт по содержимому */
.reports-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 25px;
    min-height: 400px;
    /* Никаких ограничений по высоте — растёт по содержимому */
}

/* Модальное окно справочников — скроллится внутри */
.modal-content {
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    flex-shrink: 0;
}

.modal-tabs {
    flex-shrink: 0;
}

.tab-content {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 15px 25px 25px;
}

.tab-content.active {
    display: block;
}

/* Скроллбар для красоты (опционально) */
body::-webkit-scrollbar,
.tab-content::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-track,
.tab-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

body::-webkit-scrollbar-thumb,
.tab-content::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 5px;
}

body::-webkit-scrollbar-thumb:hover,
.tab-content::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* На мобильных — обычная прокрутка без sticky */
@media (max-width: 900px) {
    .reports-layout {
        grid-template-columns: 1fr;
    }
    .reports-sidebar {
        position: static;
        max-height: none;
    }
}

/* Отступ снизу, чтобы последние элементы не прилипали к краю */
.reports-content > *:last-child {
    margin-bottom: 20px;
}

/* Уведомления не перекрывают контент */
.toast {
    z-index: 3000;
}