/* Основные стили - адаптированы под ваш дизайн */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #4CAF50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --text-color: #333;
    --bg-color: #f5f7fa;
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    color: var(--text-color);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2em;
    font-weight: 300;
    margin-bottom: 10px;
}

.map-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.map-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    border: 2px dashed #e0e6ed;
    border-radius: var(--border-radius);
    background: #f8f9fa;
}

.regions-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.region-btn {
    padding: 15px;
    border: none;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9em;
    font-weight: 600;
}

.region-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.region-btn.selected {
    background: linear-gradient(135deg, var(--success-color) 0%, #45a049 100%);
    color: white;
}

/* SVG карта стили */
.region {
    cursor: pointer;
    transition: all 0.3s ease;
    stroke: #ffffff;
    stroke-width: 2;
}

.region:hover {
    stroke-width: 4;
    filter: brightness(1.15) drop-shadow(0 0 15px rgba(0,0,0,0.3));
}

.region.selected {
    stroke: #007bff;
    stroke-width: 4;
    filter: brightness(1.2) drop-shadow(0 0 20px rgba(0,123,255,0.5));
}

.region-label-main {
    font-size: 12px;
    font-weight: 700;
    text-anchor: middle;
    fill: #333;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

.region-label-sub {
    font-size: 8px;
    text-anchor: middle;
    fill: #555;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

/* Модальное окно */
.modal-overlay {
    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: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.cities-list {
    display: grid;
    gap: 10px;
}

.city-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.city-item:hover {
    background-color: #f8f9fa;
}

.city-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Кнопки */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-save {
    background: var(--success-color);
    color: white;
    font-size: 1.1em;
}

.btn-clear {
    background: var(--danger-color);
    color: white;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

/* Выбранные элементы */
.selection-summary {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.selected-items {
    margin-top: 15px;
}

.selected-region {
    background: #e3f2fd;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.selected-region h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.selected-cities {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.city-tag {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
}

.no-selection {
    color: #666;
    font-style: italic;
}

/* Действия */
.actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

/* Статус сообщения */
.status-message {
    text-align: center;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .regions-grid {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        justify-content: center;
    }
}
