/**
 * Styles pour le module de monitoring réseau
 * Indicateurs de connexion et notifications
 */

/* ========================================
   INDICATEUR DE STATUT DANS LE HEADER
   ======================================== */

.network-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  font-weight: 500;
  color: #333333;
  border: 1px solid rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1100;
  margin-right: 8px;
  pointer-events: auto;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.network-status-indicator:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border-color: var(--audiar-green, #80b288);
}

.network-status-icon {
  font-size: 1rem;
  line-height: 1;
}

.network-status-text {
  font-size: 0.85rem;
  white-space: nowrap;
}

/* États spécifiques */
.network-status-excellent {
  border-color: rgba(40, 167, 69, 0.3);
  background: rgba(40, 167, 69, 0.1);
}

.network-status-good {
  border-color: rgba(40, 167, 69, 0.3);
  background: rgba(40, 167, 69, 0.1);
}

.network-status-fair {
  border-color: rgba(255, 193, 7, 0.3);
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
}

.network-status-poor {
  border-color: rgba(220, 53, 69, 0.3);
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.network-status-offline {
  border-color: rgba(108, 117, 125, 0.3);
  background: rgba(108, 117, 125, 0.1);
  color: #6c757d;
}

/* ========================================
   NOTIFICATIONS DE CONNEXION
   ======================================== */

.network-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 400px;
  min-width: 320px;
  background: var(--bg-primary, #ffffff);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color, #e9ecef);
  z-index: 10000;
  animation: slideInRight 0.4s ease-out;
  overflow: hidden;
}

.network-notification-content {
  padding: 16px;
}

.network-notification-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.network-notification-icon {
  font-size: 1.2rem;
}

.network-notification-title {
  font-weight: 600;
  font-size: 1rem;
  flex: 1;
  color: var(--text-primary, #212529);
}

.network-notification-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted, #6c757d);
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.network-notification-close:hover {
  background: var(--bg-tertiary, rgba(0, 0, 0, 0.1));
  color: var(--text-secondary, #495057);
}

.network-notification-message {
  color: var(--text-secondary, #495057);
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 12px;
}

.network-notification-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.network-notification-action {
  background: var(--audiar-green, #80b288);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(128, 178, 136, 0.2);
}

.network-notification-action:hover {
  background: var(--audiar-green-dark, #6d9975);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(128, 178, 136, 0.3);
}

.network-notification-action:last-child {
  background: var(--text-muted, #6c757d);
}

.network-notification-action:last-child:hover {
  background: var(--text-secondary, #545b62);
  transform: translateY(-1px);
}

/* États de notification */
.network-notification-excellent,
.network-notification-good {
  border-left: 4px solid #28a745;
}

.network-notification-fair {
  border-left: 4px solid #ffc107;
}

.network-notification-poor {
  border-left: 4px solid #dc3545;
  background: #fff5f5;
}

.network-notification-offline {
  border-left: 4px solid #6c757d;
  background: #f8f9fa;
}

/* ========================================
   MODAL DE DÉTAILS DE CONNEXION
   ======================================== */

.network-details-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 15000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.network-details-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(128, 178, 136, 0.4) 0%, rgba(168, 201, 176, 0.6) 100%);
  backdrop-filter: blur(8px);
}

.network-details-content {
  position: relative;
  background: var(--bg-primary, #ffffff);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(128, 178, 136, 0.15);
  animation: slideInUp 0.3s ease-out;
  border: 1px solid var(--audiar-green-light, #a8c9b0);
}

.network-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--audiar-green-light, #a8c9b0);
  background: linear-gradient(135deg, var(--audiar-green, #80b288) 0%, var(--audiar-green-light, #a8c9b0) 100%);
  border-radius: 16px 16px 0 0;
  color: white;
}

.network-details-header h3 {
  margin: 0;
  color: white;
  font-size: 1.3rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.network-details-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.network-details-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  transform: scale(1.1);
}

.network-details-body {
  padding: 24px;
  background: white;
}

.network-status-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(128, 178, 136, 0.1) 0%, rgba(168, 201, 176, 0.1) 100%);
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--audiar-green-light, #a8c9b0);
}

.status-icon {
  font-size: 2rem;
  line-height: 1;
}

.status-info {
  flex: 1;
}

.status-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary, #212529);
}

.status-description {
  font-size: 0.95rem;
  color: var(--text-secondary, #6c757d);
  line-height: 1.4;
}

.network-metrics {
  margin-bottom: 24px;
}

.network-metrics h4 {
  margin: 0 0 16px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--audiar-green, #80b288);
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color, #f1f3f4);
}

.metric-row:last-child {
  border-bottom: none;
}

.metric-label {
  font-weight: 500;
  color: var(--audiar-green-dark, #6d9975);
}

.metric-value {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--audiar-green, #80b288);
}

.network-recommendations {
  margin-bottom: 16px;
}

.network-recommendations h4 {
  margin: 0 0 16px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--audiar-green, #80b288);
}

.recommendations-content {
  background: linear-gradient(135deg, rgba(128, 178, 136, 0.05) 0%, rgba(168, 201, 176, 0.05) 100%);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--audiar-green-light, #a8c9b0);
  border-left: 4px solid var(--audiar-green, #80b288);
}

.recommendation-item {
  font-size: 0.95rem;
  color: var(--audiar-green-dark, #6d9975);
  line-height: 1.5;
  margin-bottom: 12px;
}

.recommendation-item:last-child {
  margin-bottom: 0;
}

.recommendation-list {
  margin: 12px 0 0 0;
  padding-left: 20px;
}

.recommendation-list li {
  margin-bottom: 8px;
  line-height: 1.4;
  color: var(--audiar-green-dark, #6d9975);
}

.network-details-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--audiar-green-light, #a8c9b0);
  background: var(--bg-tertiary, #f1f3f4);
  border-radius: 0 0 16px 16px;
}

.network-details-modal .btn-primary {
  background: var(--audiar-green, #80b288);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(128, 178, 136, 0.3);
}

.network-details-modal .btn-primary:hover:not(:disabled) {
  background: var(--audiar-green-dark, #6d9975);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(128, 178, 136, 0.4);
}

.network-details-modal .btn-primary:disabled {
  background: var(--text-muted, #6c757d);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.network-details-modal .btn-secondary {
  background: var(--bg-tertiary, #f1f3f4);
  color: var(--text-primary, #212529);
  border: 1px solid var(--border-color, #e9ecef);
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.network-details-modal .btn-secondary:hover {
  background: var(--border-color, #e9ecef);
  transform: translateY(-1px);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .network-status-indicator {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .network-status-text {
    display: none;
  }

  .network-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    min-width: auto;
  }

  .network-details-content {
    width: 95%;
    max-height: 95vh;
    margin: 10px;
  }

  .network-details-header,
  .network-details-body,
  .network-details-footer {
    padding: 16px;
  }

  .network-status-summary {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .metric-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 0;
  }

  .network-details-footer {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .network-status-indicator {
    padding: 4px 8px;
  }

  .network-status-icon {
    font-size: 0.9rem;
  }
}

/* ========================================
   INTÉGRATION AVEC LE THÈME EXISTANT
   ======================================== */

/* S'assurer que l'indicateur s'intègre bien dans le header */
.header .network-status-indicator {
  margin-left: auto;
  order: 999;
}

/* Ajustements pour les couleurs du thème sombre si nécessaire */
@media (prefers-color-scheme: dark) {
  .network-notification {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .network-notification-title {
    color: #e2e8f0;
  }

  .network-notification-message {
    color: #a0aec0;
  }

  .network-details-content {
    background: #2d3748;
    color: #e2e8f0;
  }

  .network-details-header {
    border-bottom-color: #4a5568;
  }

  .network-status-summary {
    background: #4a5568;
  }

  .status-title {
    color: #e2e8f0;
  }

  .status-description {
    color: #a0aec0;
  }

  .metric-row {
    border-bottom-color: #4a5568;
  }

  .metric-label {
    color: #a0aec0;
  }

  .metric-value {
    color: #e2e8f0;
  }

  .recommendations-content {
    background: #4a5568;
  }

  .recommendation-item,
  .recommendation-list li {
    color: #a0aec0;
  }

  .network-details-footer {
    border-top-color: #4a5568;
  }
}
