/* ==================== MÉTÉO PÊCHE - STYLES RESPONSIVE ==================== */
/* Version: 2.3 - Architecture modulaire */

/* ==================== LÉGENDE - AU-DESSUS DE LA CARTE ==================== */
.meteo-peche-legend-fixed {
  width: 100%;
  background: #ffffff !important;
  padding: 12px 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
  border: 1px solid #e0e0e0 !important;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333333;
  transition: all 0.3s ease;
  position: static;
  margin-bottom: 12px;
  z-index: 1000;
}

.meteo-peche-legend-fixed h4 {
  margin: 0 0 10px 0;
  text-align: center;
  color: #6a0dad !important; /* VIOLET */
  font-size: 16px;
  transition: color 0.3s ease;
  font-weight: 600;
}

.meteo-legend-compact {
  display: flex;
  flex-wrap: nowrap;
  gap: 15px;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 13px;
}

.meteo-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.2s ease;
  white-space: nowrap;
}

.meteo-legend-item:hover {
  transform: translateX(2px);
}

.meteo-legend-color {
  font-size: 14px;
  transition: transform 0.3s ease;
}

.meteo-legend-color-green { color: green; }
.meteo-legend-color-lightgreen { color: #32cd32; }
.meteo-legend-color-orange { color: orange; }
.meteo-legend-color-red { color: red; }

/* ==================== SECTION SPOTS PERSONNALISÉS ==================== */
.meteo-custom-spots-section {
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid #e0e0e0;
}

.meteo-add-custom-spot {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  background: #6a0dad !important; /* VIOLET */
  color: white !important;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.meteo-add-custom-spot:hover {
  background: #5a0b9d !important; /* VIOLET FONCÉ */
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* ==================== BOUTON RAFRAÎCHIR ==================== */
.meteo-refresh-btn {
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

.meteo-refresh-action {
  padding: 6px 12px;
  border: none;
  background: #6a0dad;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.meteo-refresh-action:hover {
  background: #5a0b9d;
  transform: translateY(-1px);
}

/* ==================== POPUPS LEAFLET COMPACTES ==================== */
.meteo-popup {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  max-width: 260px !important;
  padding: 0 !important;
}

.meteo-popup-header {
  background: white;
  color: white !important;
  padding: 10px 12px;
  margin: -12px -12px 8px -12px;
  border-radius: 6px 6px 0 0;
  text-align: center;
  border-bottom: 2px solid #6a0dad;
}

.meteo-popup-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #333 !important;
}

.meteo-popup-header small {
  font-size: 10px;
  opacity: 0.9;
  color: #666 !important;
}

.meteo-popup-section {
  padding: 8px;
  margin-bottom: 6px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  background: #fafafa;
  transition: all 0.3s ease;
}

.meteo-popup-section:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.meteo-popup-section-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 6px;
  color: white !important;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #6a0dad; /* VIOLET */
  padding: 4px 8px;
  margin: -8px -8px 6px -8px;
  border-radius: 3px 3px 0 0;
}

.meteo-popup-section-content {
  font-size: 12px;
  line-height: 1.3;
  color: #555;
}

.meteo-popup-section-content div {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 0;
  justify-content: space-between;
}

.meteo-label {
  color: #666;
  font-size: 11px;
  min-width: 120px;
}

.meteo-popup-section-content b {
  color: #333;
  font-size: 12px;
}

/* Sections colorées */
.meteo-popup-section-conditions {
  background: #f8f9fa !important;
  border-color: #dee2e6 !important;
}

.meteo-popup-section-pressure {
  background: #f8f9fa !important;
  border-color: #dee2e6 !important;
}

.meteo-popup-section-night {
  background: #f8f9fa !important;
  border-color: #dee2e6 !important;
}

/* Sections d'activité */
.meteo-popup-section-activity-excellent {
  background: #f0fff0;
  border-color: #90ee90;
  border-left: 3px solid green;
}

.meteo-popup-section-activity-good {
  background: #f0fff0;
  border-color: #90ee90;
  border-left: 3px solid #32cd32;
}

.meteo-popup-section-activity-moderate {
  background: #fff8f0;
  border-color: #ffd699;
  border-left: 3px solid orange;
}

.meteo-popup-section-activity-poor {
  background: #fff0f0;
  border-color: #ff9999;
  border-left: 3px solid red;
}

/* Badges de score */
.meteo-score-highlight {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  text-align: center;
  min-width: 60px;
  background: #6a0dad; /* VIOLET */
  color: white;
}

.meteo-score-highlight.excellent {
  background: green;
  color: white;
}

.meteo-score-highlight.good {
  background: #32cd32;
  color: #333;
}

.meteo-score-highlight.moderate {
  background: orange;
  color: white;
}

.meteo-score-highlight.poor {
  background: red;
  color: white;
}

/* Badge d'activité */
.meteo-activity-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 4px;
  text-align: center;
  width: 100%;
  transition: all 0.3s ease;
}

.meteo-activity-badge.excellent {
  background: green;
  color: white;
  box-shadow: 0 2px 4px rgba(0,128,0,0.3);
}

.meteo-activity-badge.good {
  background: #32cd32;
  color: #333;
  box-shadow: 0 2px 4px rgba(50,205,50,0.3);
}

.meteo-activity-badge.moderate {
  background: orange;
  color: white;
  box-shadow: 0 2px 4px rgba(255,165,0,0.3);
}

.meteo-activity-badge.poor {
  background: red;
  color: white;
  box-shadow: 0 2px 4px rgba(255,0,0,0.3);
}

/* Affichage du score */
.meteo-score-display {
  text-align: center;
  font-size: 12px;
  margin-top: 4px;
  font-weight: 600;
}

.meteo-score-display b {
  font-size: 13px;
}

/* Section de suppression */
.meteo-popup-delete-section {
  text-align: center;
  padding: 6px 0 0 0;
  margin-top: 6px;
  border-top: 1px solid #e0e0e0;
}

.meteo-delete-custom-spot {
  background: #dc3545;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.meteo-delete-custom-spot:hover {
  background: #c82333;
  transform: translateY(-1px);
}

/* ==================== INTERFACE ADMIN CONFIGURATION ==================== */
.meteo-config-section {
  background: #fff;
  padding: 20px;
  margin: 20px 0;
  border-radius: 8px;
  border: 1px solid #ccd0d4;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.meteo-config-section h2 {
  color: #6a0dad;
  border-bottom: 2px solid #6a0dad;
  padding-bottom: 10px;
  margin-top: 0;
}

.meteo-config-section h3 {
  color: #333;
  font-size: 16px;
}

.meteo-config-info {
  background: #f0f8ff;
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid #0073aa;
  margin: 20px 0;
}

.meteo-config-info h3 {
  color: #0073aa;
  margin-top: 0;
}

.meteo-config-info ul {
  margin: 10px 0;
  padding-left: 20px;
}

.meteo-config-info li {
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Styles des tables de configuration */
.meteo-config-section table.form-table {
  width: 100%;
  border-collapse: collapse;
}

.meteo-config-section table.form-table th {
  text-align: left;
  padding: 12px 10px 12px 0;
  width: 200px;
  font-weight: 600;
  color: #333;
}

.meteo-config-section table.form-table td {
  padding: 8px 10px;
}

.meteo-config-section input[type="number"] {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.meteo-config-section input[type="number"]:focus {
  border-color: #6a0dad;
  box-shadow: 0 0 0 1px #6a0dad;
  outline: none;
}

/* ==================== MARQUEURS LEAFLET PERSONNALISÉS ==================== */
.leaflet-marker-icon {
  transition: all 0.3s ease;
}

.leaflet-marker-icon:hover {
  transform: scale(1.1);
}

/* Styles pour les tooltips */
.leaflet-tooltip {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #6a0dad;
  border-radius: 4px;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 11px;
  padding: 6px 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.leaflet-tooltip:before {
  border-top-color: #6a0dad;
}

/* ==================== LOADING STATES ==================== */
.meteo-loading {
  opacity: 0.7;
  pointer-events: none;
}

.meteo-loading::after {
  content: "🔄 Chargement...";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(106, 13, 173, 0.9);
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 12px;
  z-index: 1000;
}

/* ==================== HAUTEUR DE LA CARTE ==================== */

/* DESKTOP - Grands écrans */
@media (min-width: 1200px) {
  #meteo-peche-map {
    height: 800px !important;
    min-height: 700px;
  }
}

/* DESKTOP - Écrans standards */
@media (min-width: 1025px) {
  #meteo-peche-map {
    height: 750px !important;
    min-height: 650px;
  }
}

/* TABLETTE - Landscape et grands tablettes */
@media (max-width: 1024px) and (min-width: 769px) {
  .meteo-peche-wrapper {
    gap: 10px;
  }
  
  #meteo-peche-map {
    height: 700px !important;
  }
  
  .meteo-peche-legend-fixed {
    background: #ffffff !important;
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  
  .meteo-peche-legend-fixed h4 {
    font-size: 15px;
  }
  
  /* Popups tablette */
  .meteo-popup {
    max-width: 240px !important;
  }
  
  .meteo-popup-section {
    padding: 6px;
  }
  
  .meteo-popup-section-title {
    font-size: 12px;
  }
  
  .meteo-popup-section-content {
    font-size: 11px;
  }
  
  .meteo-label {
    font-size: 10px;
    min-width: 110px;
  }
}

/* TABLETTE - Portrait et petits tablettes */
@media (max-width: 768px) {
  .meteo-peche-wrapper {
    gap: 8px;
  }
  
  #meteo-peche-map {
    height: 650px !important;
  }
  
  .meteo-peche-legend-fixed {
    background: #ffffff !important;
    padding: 8px 10px;
    margin-bottom: 8px;
  }
  
  /* Légende mobile */
  .meteo-legend-compact {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-around;
  }
  
  .meteo-legend-item {
    font-size: 12px;
  }
  
  /* Popups mobile */
  .meteo-popup {
    max-width: 220px !important;
  }
  
  .meteo-popup-header {
    padding: 8px 10px;
  }
  
  .meteo-popup-header h3 {
    font-size: 14px;
  }
  
  .meteo-popup-section {
    padding: 5px;
    margin-bottom: 4px;
  }
  
  .meteo-popup-section-title {
    font-size: 11px;
  }
  
  .meteo-popup-section-content {
    font-size: 10px;
  }
  
  .meteo-label {
    font-size: 9px;
    min-width: 100px;
  }
  
  .meteo-activity-badge {
    font-size: 11px;
    padding: 3px 6px;
  }
}

/* MOBILE - Petits écrans */
@media (max-width: 480px) {
  #meteo-peche-map {
    height: 600px !important;
  }
  
  .meteo-peche-legend-fixed {
    background: #ffffff !important;
    padding: 6px 8px;
  }
  
  /* Légende petit mobile */
  .meteo-legend-compact {
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
  }
  
  .meteo-legend-item {
    font-size: 11px;
  }
  
  /* Popups petit mobile */
  .meteo-popup {
    max-width: 200px !important;
  }
  
  .meteo-popup-header {
    padding: 6px 8px;
  }
  
  .meteo-popup-header h3 {
    font-size: 13px;
  }
  
  .meteo-popup-section {
    padding: 4px;
  }
  
  .meteo-popup-section-title {
    font-size: 10px;
  }
  
  .meteo-popup-section-content {
    font-size: 9px;
  }
  
  .meteo-popup-section-content div {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
  }
  
  .meteo-label {
    font-size: 8px;
    min-width: auto;
  }
  
  .meteo-score-highlight {
    font-size: 10px;
    padding: 2px 4px;
  }
}

/* MOBILE - Très petits écrans */
@media (max-width: 360px) {
  #meteo-peche-map {
    height: 500px !important;
  }
  
  .meteo-peche-legend-fixed {
    padding: 5px;
  }
  
  .meteo-add-custom-spot {
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* ==================== ANIMATIONS ==================== */
@keyframes meteo-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.meteo-pulse {
  animation: meteo-pulse 2s infinite;
}

/* ==================== ACCESSIBILITÉ ==================== */
@media (prefers-reduced-motion: reduce) {
  .meteo-popup-section,
  .meteo-add-custom-spot,
  .meteo-legend-item,
  .leaflet-marker-icon {
    transition: none;
  }
  
  .meteo-pulse {
    animation: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .meteo-popup-section {
    border-width: 2px;
  }
  
  .meteo-score-highlight {
    border: 1px solid currentColor;
  }
}

/* ==================== RÈGLE DE SECOURS ==================== */
#meteo-peche-map {
  height: 750px !important;
  width: 100%;
  background: #f8f9fa;
}

.meteo-peche-wrapper {
  position: relative;
  width: 100%;
}

/* États de erreur */
.meteo-error {
  background: #fff0f0 !important;
  border-color: #ffcccc !important;
  color: #cc0000;
}

.meteo-warning {
  background: #fff8f0 !important;
  border-color: #ffd699 !important;
  color: #cc6600;
}

/* Styles pour les données en cours */
.meteo-in-progress {
  background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 50%, #f0f0f0 50%, #f0f0f0 75%, transparent 75%, transparent);
  background-size: 20px 20px;
  animation: meteo-progress 1s linear infinite;
}

@keyframes meteo-progress {
  0% { background-position: 0 0; }
  100% { background-position: 20px 0; }
}