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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    text-align: center;
}

h1 {
    color: #2d3748;
    font-size: 32px;
    margin-bottom: 10px;
}

.subtitle {
    color: #718096;
    font-size: 16px;
    margin-bottom: 15px;
}

.stats {
    display: inline-block;
    background: #f7fafc;
    padding: 10px 20px;
    border-radius: 8px;
    color: #4a5568;
    font-weight: 500;
}

/* Поисковая панель */
.search-panel {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.search-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.search-group label {
    display: block;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 14px;
}

.search-group input,
.search-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-group input:focus,
.search-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: #f7fafc;
    font-size: 18px;
}

.btn-icon:hover {
    background: #e2e8f0;
}

/* Основной контент */
.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
    height: calc(100vh - 380px);
    min-height: 600px;
}

.results-panel,
.map-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 20px;
    border-bottom: 2px solid #f7fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    color: #2d3748;
    font-size: 18px;
}

.panel-header span {
    color: #718096;
    font-size: 14px;
}

.map-controls {
    display: flex;
    gap: 8px;
}

.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.result-item {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.result-item:hover {
    background: #edf2f7;
    border-color: #667eea;
    transform: translateX(5px);
}

.result-item.active {
    border-color: #667eea;
    background: #e6f2ff;
}

.result-header {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.result-photo {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.result-photo.placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.result-info {
    flex: 1;
}

.result-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 16px;
    margin-bottom: 5px;
}

.result-dates {
    color: #718096;
    font-size: 13px;
}

.result-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 13px;
    color: #4a5568;
}

.result-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

#map {
    flex: 1;
    min-height: 400px;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 15px;
    border-top: 2px solid #f7fafc;
    flex-wrap: wrap;
}

.pagination button {
    min-width: 40px;
    padding: 8px 12px;
    background: #f7fafc;
    color: #4a5568;
    font-size: 14px;
}

.pagination button:hover:not(:disabled) {
    background: #e2e8f0;
}

.pagination button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #718096;
}

.modal-close:hover {
    color: #2d3748;
}

.modal-photo {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 20px;
}

.modal-info {
    display: grid;
    gap: 15px;
}

.modal-info-item {
    display: flex;
    border-bottom: 1px solid #f7fafc;
    padding-bottom: 10px;
}

.modal-info-label {
    font-weight: 600;
    color: #4a5568;
    min-width: 150px;
}

.modal-info-value {
    color: #2d3748;
}

/* Leaflet custom */
.leaflet-popup-content {
    margin: 15px;
    min-width: 200px;
}

.popup-photo {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.popup-name {
    font-weight: 600;
    font-size: 14px;
    color: #2d3748;
    margin-bottom: 5px;
}

.popup-info {
    font-size: 12px;
    color: #718096;
    line-height: 1.5;
}

/* Адаптив */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .results-panel {
        max-height: 400px;
    }
    
    #map {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .search-row {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .search-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-actions button {
        width: 100%;
    }
}
