/* css/drawing-controls.css */

/* Контейнер для кнопок рисования */
.water-drawing-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

/* Основная кнопка */
.btn-add-water-object {
    background: linear-gradient(135deg, #4299E1, #3182CE);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
    transition: all 0.3s ease;
    z-index: 1001;
}

.btn-add-water-object:hover {
    background: linear-gradient(135deg, #3182CE, #2C5282);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(66, 153, 225, 0.4);
}

.btn-add-water-object:active {
    transform: translateY(0);
}

/* Выпадающее меню */
.water-drawing-dropdown {
    background: white;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 200px;
    z-index: 1000;
}

.water-drawing-dropdown.show {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 10px;
}

.dropdown-header h4 {
    margin: 0;
    color: #2d3748;
    font-size: 14px;
}

.dropdown-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.water-type-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    border: 1px solid #e2e8f0;
}

.water-type-option:hover {
    background: #f7fafc;
    border-color: #4299E1;
}

.water-type-icon {
    font-size: 20px;
    width: 30px;
    text-align: center;
}

.water-type-info {
    flex: 1;
}

.water-type-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.water-type-desc {
    font-size: 12px;
    color: #718096;
    margin-top: 2px;
}

/* Инструкция при рисовании */
.drawing-instruction {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    max-width: 400px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.instruction-content h3 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 16px;
}

.instruction-content p {
    margin: 0 0 15px 0;
    color: #4a5568;
    font-size: 14px;
    line-height: 1.4;
}

.instruction-actions {
    display: flex;
    justify-content: flex-end;
}

/* Стили для модального окна сохранения */
.preview-info {
    background: #f7fafc;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    border: 1px solid #e2e8f0;
}

.preview-info h4 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 14px;
}

.preview-info p {
    margin: 5px 0;
    color: #4a5568;
    font-size: 13px;
}

/* Стили для управления видимостью */
.water-objects-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: white;
    border-radius: 50px;
    padding: 10px 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.water-objects-toggle:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.toggle-checkbox {
    display: none;
}

.toggle-slider {
    width: 36px;
    height: 20px;
    background: #cbd5e0;
    border-radius: 10px;
    position: relative;
    transition: background 0.3s ease;
}

.toggle-slider:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.toggle-checkbox:checked + .toggle-slider {
    background: #4299E1;
}

.toggle-checkbox:checked + .toggle-slider:after {
    transform: translateX(16px);
}

.toggle-label {
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

/* МОДАЛЬНОЕ ОКНО ВОДНЫХ ОБЪЕКТОВ - ИСПРАВЛЕННЫЕ СТИЛИ */
#save-water-object-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    animation: modalFadeIn 0.3s ease forwards;
}

#save-water-object-dialog .modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease forwards;
    margin: 0;
    padding: 0;
}

/* Анимации для модального окна */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
}

/* Запрещаем прокрутку страницы когда модальное окно открыто */
body.modal-open {
    overflow: hidden !important;
}

/* Стили для полей формы */
#save-water-object-dialog input {
    width: 100% !important;
    padding: 12px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
}

#save-water-object-dialog input:focus {
    border-color: #4299E1 !important;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1) !important;
    outline: none !important;
}

/* Кнопки в модальном окне */
#save-water-object-dialog .btn {
    padding: 10px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: none !important;
}

#save-water-object-dialog .btn-secondary {
    background: #e2e8f0 !important;
    color: #4a5568 !important;
}

#save-water-object-dialog .btn-secondary:hover {
    background: #cbd5e0 !important;
}

#save-water-object-dialog .btn-primary {
    background: linear-gradient(135deg, #4299E1, #3182CE) !important;
    color: white !important;
}

#save-water-object-dialog .btn-primary:hover {
    background: linear-gradient(135deg, #3182CE, #2C5282) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3) !important;
}

/* Стили для уведомлений */
.error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(245, 101, 101, 0.3);
    z-index: 10001;
    text-align: center;
    animation: modalFadeIn 0.3s ease;
    max-width: 400px;
}

.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(72, 187, 120, 0.3);
    z-index: 10001;
    text-align: center;
    animation: modalFadeIn 0.3s ease;
}

/* Адаптивность */
@media (max-width: 768px) {
    .water-drawing-controls {
        bottom: 10px;
        right: 10px;
    }
    
    .btn-add-water-object {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .water-drawing-dropdown {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 300px;
    }
    
    .drawing-instruction {
        width: 90%;
        top: 10px;
    }
    
    #save-water-object-dialog .modal-content {
        width: 95%;
        margin: 10px;
    }
}

/* Анимация закрытия модального окна */
@keyframes modalFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* ===== ВЫПАДАЮЩЕЕ МЕНЮ ДЛЯ ЕДИНЫХ КНОПОК УПРАВЛЕНИЯ ===== */

.water-drawing-dropdown {
    position: fixed;
    background: white;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 220px;
    z-index: 1001;
    border: 1px solid #e2e8f0;
    animation: slideIn 0.3s ease;
}

.water-drawing-dropdown.show {
    display: block;
}

.dropdown-header {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 10px;
}

.dropdown-header h4 {
    margin: 0;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
}

.dropdown-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.water-type-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.water-type-option:hover {
    background: #f7fafc;
    border-color: #4299E1;
    transform: translateY(-1px);
}

.water-type-icon {
    font-size: 20px;
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.water-type-info {
    flex: 1;
}

.water-type-title {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    margin-bottom: 2px;
}

.water-type-desc {
    font-size: 12px;
    color: #718096;
    line-height: 1.3;
}

/* Анимация появления */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .water-drawing-dropdown {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90%;
        max-width: 280px;
        margin: 0;
    }
}