/* ===== СТИЛИ МОДАЛЬНОГО ОКНА ДОБАВЛЕНИЯ ОТЧЁТА ===== */

/* Фон модального окна */
.fishing-report-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: none;
}

/* Основное модальное окно */
.fishing-report-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.fishing-report-modal-content {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--gray-200);
  animation: modalSlideIn 0.3s ease;
}

/* Заголовок модального окна */
.fishing-report-modal-header {
  padding: var(--space-5);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ocean-600);
  color: var(--white);
}

.fishing-report-modal-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.fishing-report-modal-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-title-icon {
  font-size: 20px;
}

.fishing-report-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--white);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.fishing-report-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Тело модального окна */
.fishing-report-modal-body {
  padding: var(--space-5);
  max-height: 70vh;
  overflow-y: auto;
}

/* Блок с координатами */
.coordinates-info {
  background: var(--ocean-50);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  border-left: 4px solid var(--ocean-500);
}

.info-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.info-content {
  flex: 1;
}

.info-label {
  font-size: 12px;
  color: var(--gray-600);
  font-weight: 500;
}

.info-value {
  font-size: 14px;
  color: var(--gray-800);
  font-weight: 600;
}

/* Секции формы */
.form-section {
  background: var(--gray-50);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  border: 1px solid var(--gray-200);
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--gray-200);
}

.section-header.compact {
  margin-bottom: var(--space-3);
  padding-bottom: 0;
  border-bottom: none;
}

.section-header h4 {
  margin: 0;
  color: var(--gray-800);
  font-size: 16px;
  font-weight: 600;
}

.section-icon {
  font-size: 18px;
}

/* Группы формы */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  color: var(--gray-700);
  font-size: 14px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--white);
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--ocean-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-control::placeholder {
  color: var(--gray-400);
}

.textarea {
  min-height: 80px;
  resize: vertical;
}

.form-control-file {
  width: 100%;
  padding: 10px 0;
  font-size: 14px;
}

.form-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: var(--space-1);
}

/* Строки формы */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* Секция с рыбой */
.fish-section {
  margin-top: var(--space-4);
}

.fish-rows-container {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--white);
  margin-top: var(--space-3);
}

.no-fish-message {
  color: var(--gray-500);
  text-align: center;
  padding: var(--space-4);
  font-style: italic;
  font-size: 14px;
}

/* Строка с рыбой */
.fish-row {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
  background: var(--white);
  position: relative;
}

.fish-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.fish-row-title {
  margin: 0;
  color: var(--gray-800);
  font-size: 14px;
  font-weight: 600;
}

.remove-fish-btn {
  background: var(--error);
  color: var(--white);
  border: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}

.fish-row-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.fish-row-notes {
  margin-top: var(--space-3);
}

.fish-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: var(--space-2);
}

/* Настройки приватности */
.privacy-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.privacy-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  border: 1px solid var(--gray-200);
}

.privacy-option:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.privacy-option input[type="radio"] {
  margin: 0;
}

.privacy-content {
  flex: 1;
}

.privacy-title {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 14px;
}

.privacy-description {
  color: var(--gray-600);
  font-size: 12px;
  margin-top: 2px;
}

.privacy-icon {
  font-size: 18px;
}

/* Превью фото */
.photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-3);
  min-height: 60px;
  padding: var(--space-3);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--gray-25);
}

.photo-preview-placeholder {
  color: var(--gray-500);
  text-align: center;
  width: 100%;
  padding: var(--space-4);
  font-size: 14px;
}

.photo-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-300);
}

/* Кнопки */
.form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--gray-200);
}

.btn-primary {
  background: var(--ocean-600);
  color: var(--white);
  border: 1.5px solid var(--ocean-600);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--ocean-700);
  border-color: var(--ocean-700);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: inherit;
}

.btn-secondary:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-icon {
  font-size: 14px;
}

/* Анимации */
@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Адаптивность */
@media (max-width: 768px) {
  .fishing-report-modal {
    padding: 10px;
  }
  
  .fishing-report-modal-content {
    max-width: 100%;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .fish-row-fields {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* Исправляем стили для кнопки "Добавить рыбу" */
#add-fish-btn {
    background: var(--white);
    color: var(--gray-700);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: inherit;
}

#add-fish-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* Улучшаем скроллинг модального окна */
.fishing-report-modal-body {
  padding: var(--space-5);
  max-height: 70vh;
  overflow-y: auto;
  scroll-behavior: smooth; /* Плавный скроллинг */
}

/* Стили для скроллбара */
.fishing-report-modal-body::-webkit-scrollbar {
  width: 6px;
}

.fishing-report-modal-body::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 3px;
}

.fishing-report-modal-body::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 3px;
}

.fishing-report-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* Анимация появления с прокруткой к верху */
@keyframes modalSlideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fishing-report-modal-content {
  animation: modalSlideInFromTop 0.3s ease;
}

/* Улучшаем фокус на полях ввода */
.form-control:focus {
  outline: none;
  border-color: var(--ocean-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* Подсветка первого поля при открытии */
.form-control:first-of-type {
  border-color: var(--ocean-400);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.15);
}

/* Стили для валидации */
.form-control:invalid {
  border-color: #e74c3c;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.1);
}

.form-control:valid {
  border-color: #27ae60;
}

.validation-error {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.validation-success {
  color: #27ae60;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

/* Подсветка обязательных полей */
.form-label span[style*="color: red"] {
  font-weight: bold;
}

/* Стили для фото в форме редактирования */
.current-photos, .photos-preview {
    margin-top: 10px;
}

.photo-item {
    position: relative;
    display: inline-block;
    margin: 5px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.photo-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
}

.remove-photo-btn, .remove-new-photo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    padding: 0;
}

.remove-photo-btn:hover, .remove-new-photo-btn:hover {
    background: #e74c3c;
}

.photo-actions {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
}

.btn-photo-action {
    background: rgba(52, 152, 219, 0.9);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    padding: 0;
}

.btn-photo-action:hover {
    background: #3498db;
}

.new-photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.photo-warning {
    color: #e67e22;
    font-size: 12px;
    margin-top: 10px;
    padding: 5px;
    background: #fef9e7;
    border-radius: 4px;
    text-align: center;
}

.no-photos {
    color: #7f8c8d;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Модальное окно просмотра фото */
.image-view-modal .modal-content {
    max-width: 90vw;
    max-height: 90vh;
    background: transparent;
    box-shadow: none;
}

.image-view-modal .modal-header {
    background: rgba(0,0,0,0.7);
    color: white;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    /* Улучшаем выпадающие списки для мобильных */
    .fish-species, #edit-gear-type, #edit-lure-type, 
    #edit-fishing-type, #edit-fishing-location, 
    #edit-time-of-day {
        font-size: 16px !important; /* Предотвращает масштабирование в iOS */
        padding: 12px 8px !important;
        min-height: 44px !important; /* Минимальная высота для удобного касания */
    }
    
    /* Улучшаем контейнеры с рыбой для мобильных */
    .fish-row {
        padding: 10px !important;
        margin-bottom: 8px !important;
    }
    
    .fish-row-fields {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    /* Улучшаем кнопки для мобильных */
    .remove-fish-btn, .btn-photo-action, .remove-photo-btn, .remove-new-photo-btn {
        min-width: 44px !important;
        min-height: 44px !important;
        font-size: 14px !important;
    }
    
    /* Улучшаем превью фото для мобильных */
    .photo-item {
        margin: 3px !important;
    }
    
    .photo-item img {
        width: 70px !important;
        height: 70px !important;
    }
    
    /* Улучшаем форму редактирования */
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .form-section {
        padding: 15px !important;
    }
    
    /* Улучшаем модальное окно для мобильных */
    .fishing-report-modal-content {
        margin: 10px !important;
        max-height: 85vh !important;
        max-width: 95vw !important;
    }
    
    .fishing-report-modal-body {
        max-height: 60vh !important;
        padding: 15px !important;
    }
}

/* Дополнительные улучшения для очень маленьких экранов */
@media (max-width: 480px) {
    .fish-species, #edit-gear-type, #edit-lure-type {
        font-size: 14px !important;
    }
    
    .photo-item img {
        width: 60px !important;
        height: 60px !important;
    }
    
    .coordinates-info {
        padding: 10px !important;
    }
    
    .section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .section-header.compact {
        flex-direction: row !important;
    }
}

/* Улучшенные стили для фото */
.photo-info {
    font-size: 10px;
    color: #666;
    text-align: center;
    margin-top: 4px;
    word-break: break-all;
    max-width: 80px;
}

.photo-item {
    transition: all 0.3s ease;
}

.photo-item.marked-for-removal {
    opacity: 0.3;
    border: 2px solid #e74c3c !important;
}

/* Улучшения для мобильных */
@media (max-width: 768px) {
    .photo-info {
        font-size: 9px;
        max-width: 70px;
    }
    
    .mobile-friendly-btn {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .mobile-optimized {
        font-size: 14px;
    }
}

/* Улучшения для очень маленьких экранов */
@media (max-width: 480px) {
    .photo-info {
        font-size: 8px;
        max-width: 60px;
    }
}

/* Улучшенные стили для кнопок удаления фото */
.remove-photo-btn, .remove-new-photo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    padding: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.remove-photo-btn:hover, .remove-new-photo-btn:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

/* Стили для кнопки восстановления */
.remove-photo-btn.restore-mode {
    background: rgba(52, 152, 219, 0.9) !important;
}

.remove-photo-btn.restore-mode:hover {
    background: #3498db !important;
}

/* Улучшения для мобильных */
@media (max-width: 768px) {
    .remove-photo-btn, .remove-new-photo-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}