/**
 * Styles pour le module d'alertes intelligentes Gemini
 */

/* ==================== CONTAINER ==================== */

.gemini-alerts-section {
  background: var(--card-background, #ffffff);
  border-radius: var(--border-radius, 12px);
  padding: 20px;
  box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,0.1));
  margin-bottom: 30px;
}

.gemini-alerts-section .section-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.gemini-alerts-section .section-header h2 {
  margin: 0 0 0.4rem 0;
  font-size: 1.1rem;
  color: var(--text-secondary, #555);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gemini-alerts-section .section-header h2 i {
  color: #2196F3;
}

.gemini-alerts-section .section-description {
  margin: 0;
  color: #888;
  font-size: 0.85rem;
}

#gemini-alerts-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ==================== ALERT CARDS ==================== */

.alert-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  border-left: 5px solid #ddd;
}

.alert-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* Couleurs par sévérité */
.alert-card.alert-ok {
  border-left-color: #4CAF50;
  background: linear-gradient(to right, rgba(76, 175, 80, 0.05), white);
}

.alert-card.alert-warning {
  border-left-color: #FF9800;
  background: linear-gradient(to right, rgba(255, 152, 0, 0.05), white);
}

.alert-card.alert-critical {
  border-left-color: #F44336;
  background: linear-gradient(to right, rgba(244, 67, 54, 0.05), white);
}

/* ==================== ALERT HEADER ==================== */

.alert-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.alert-icon {
  font-size: 2rem;
  min-width: 2.5rem;
  text-align: center;
}

.alert-ok .alert-icon { color: #4CAF50; }
.alert-warning .alert-icon { color: #FF9800; }
.alert-critical .alert-icon { color: #F44336; }

.alert-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.alert-severity {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alert-ok .alert-severity { color: #4CAF50; }
.alert-warning .alert-severity { color: #FF9800; }
.alert-critical .alert-severity { color: #F44336; }

.alert-time {
  font-size: 0.85rem;
  color: #666;
}

.alert-dismiss {
  background: transparent;
  border: none;
  color: #999;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.alert-dismiss:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #333;
}

/* ==================== ALERT BODY ==================== */

.alert-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.alert-summary {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #333;
  font-weight: 500;
}

/* Statut baignade */
.swim-status {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.swim-status i {
  font-size: 1.3rem;
}

.swim-status.swim-ok {
  background: #E8F5E9;
  color: #2E7D32;
  border: 1px solid #A5D6A7;
}

.swim-status.swim-not-ok {
  background: #FFEBEE;
  color: #C62828;
  border: 1px solid #EF9A9A;
}

/* Problèmes détectés */
.alert-issues {
  background: #FFF3E0;
  padding: 1rem;
  border-radius: 8px;
  border-left: 3px solid #FF9800;
}

.alert-issues h5 {
  margin: 0 0 0.75rem 0;
  color: #E65100;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-issues ul {
  margin: 0;
  padding-left: 1.5rem;
}

.alert-issues li {
  margin: 0.5rem 0;
  line-height: 1.5;
}

.alert-issues small {
  color: #666;
  font-size: 0.85rem;
}

/* Recommandations */
.alert-recommendations {
  background: #E3F2FD;
  padding: 1rem;
  border-radius: 8px;
  border-left: 3px solid #2196F3;
}

.alert-recommendations h5 {
  margin: 0 0 0.75rem 0;
  color: #0D47A1;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-recommendations ol {
  margin: 0;
  padding-left: 1.5rem;
}

.recommendation {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: white;
  border-radius: 6px;
  border: 1px solid rgba(33, 150, 243, 0.2);
}

.recommendation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.recommendation strong {
  color: #1565C0;
}

.recommendation p {
  margin: 0.5rem 0;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.5;
}

.recommendation .quantity {
  color: #666;
  font-style: italic;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Badges de priorité */
.priority-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.priority-high {
  background: #FFCDD2;
  color: #C62828;
}

.priority-medium {
  background: #FFE0B2;
  color: #E65100;
}

.priority-low {
  background: #C8E6C9;
  color: #2E7D32;
}

/* Diagnostic détaillé */
.alert-reasoning {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #F5F5F5;
  border-radius: 6px;
  border: 1px solid #E0E0E0;
}

.alert-reasoning summary {
  cursor: pointer;
  font-weight: 600;
  color: #555;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}

.alert-reasoning summary:hover {
  color: #333;
}

.alert-reasoning p {
  margin: 0.75rem 0 0 0;
  color: #666;
  line-height: 1.6;
}

/* Mesures au moment de l'alerte */
.alert-measurements {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #E0E0E0;
}

.alert-measurements h6 {
  margin: 0 0 0.75rem 0;
  font-size: 0.85rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.measurements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}

.measurements-grid > div {
  padding: 0.5rem;
  background: #F9F9F9;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #666;
}

.measurements-grid strong {
  color: #333;
  font-weight: 600;
}

/* ==================== ALERT FOOTER ==================== */

.alert-footer {
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.02);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.alert-footer small {
  color: #999;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==================== BOUTONS ==================== */

.btn-retry {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: #2196F3;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-retry:hover {
  background: #1976D2;
  transform: translateY(-1px);
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .alert-card {
    border-radius: 8px;
  }

  .alert-header {
    padding: 0.75rem;
  }

  .alert-icon {
    font-size: 1.5rem;
    min-width: 2rem;
  }

  .alert-body {
    padding: 1rem;
  }

  .alert-summary {
    font-size: 1rem;
  }

  .measurements-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .recommendation-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ==================== ANIMATIONS ==================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-card {
  animation: fadeIn 0.3s ease;
}

/* Animation de chargement */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.alert-card.loading {
  animation: pulse 1.5s ease-in-out infinite;
}
