/* ====================================
   Variables CSS Seed I.T
   ==================================== */
:root {
  --seedit-primary: #037CFB;
  --seedit-primary-light: #4DB6FF;
  --seedit-bg-dark: #1a1a2e;
  --seedit-bg-darker: #16213e;
  --seedit-radius: 12px;
  --seedit-transition: 0.25s ease;
  --seedit-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);

  /* Variables spécifiques au widget de performance */
  --seedit-perf-good: #10ac84;
  --seedit-perf-warning: #f39c12;
  --seedit-perf-critical: #e74c3c;
  --seedit-perf-card-bg: rgba(255, 255, 255, 0.05);
}

/* ====================================
   Reset & Base
   ==================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--seedit-bg-dark) 0%, var(--seedit-bg-darker) 100%);
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ====================================
   Conteneur de démonstration
   ==================================== */
.seedit-perf-demo {
  width: 100%;
  max-width: 900px;
}

.seedit-perf-demo__container {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--seedit-radius);
  padding: 2.5rem;
  box-shadow: var(--seedit-shadow);
}

.seedit-perf-demo__title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--seedit-primary) 0%, var(--seedit-primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}

.seedit-perf-demo__subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin-bottom: 2.5rem;
}

/* ====================================
   Section
   ==================================== */
.seedit-perf-section {
  margin-bottom: 2rem;
}

/* ====================================
   Widget de Performance - Conteneur principal
   ==================================== */
.seedit-perf-widget {
  background: var(--seedit-perf-card-bg);
  border-radius: var(--seedit-radius);
  padding: 1.5rem;
  box-shadow: var(--seedit-shadow);
}

/* En-tête */
.seedit-perf-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.seedit-perf-widget__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.seedit-perf-widget__status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(16, 172, 132, 0.1);
  border-radius: 20px;
  border: 1px solid rgba(16, 172, 132, 0.3);
}

.seedit-perf-widget__status-dot {
  width: 8px;
  height: 8px;
  background: var(--seedit-perf-good);
  border-radius: 50%;
  animation: seedit-perf-pulse 2s ease-in-out infinite;
}

.seedit-perf-widget__status-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--seedit-perf-good);
}

/* Grille de métriques */
.seedit-perf-widget__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Métrique individuelle */
.seedit-perf-metric {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1.25rem;
  transition: all var(--seedit-transition);
}

.seedit-perf-metric:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.seedit-perf-metric__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.seedit-perf-metric__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(77, 182, 255, 0.1);
  color: var(--seedit-primary-light);
}

.seedit-perf-metric__icon--cpu {
  background: rgba(77, 182, 255, 0.1);
  color: var(--seedit-primary-light);
}

.seedit-perf-metric__icon--ram {
  background: rgba(155, 89, 182, 0.1);
  color: #9b59b6;
}

.seedit-perf-metric__icon--latency {
  background: rgba(243, 156, 18, 0.1);
  color: #f39c12;
}

.seedit-perf-metric__icon--throughput {
  background: rgba(16, 172, 132, 0.1);
  color: #10ac84;
}

.seedit-perf-metric__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.seedit-perf-metric__value {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.75rem;
  line-height: 1;
}

/* Barre de progression */
.seedit-perf-metric__bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.seedit-perf-metric__bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease, background-color 0.3s ease;
  width: 0%;
}

/* Couleurs adaptatives selon le niveau */
.seedit-perf-metric__bar-fill--good {
  background: var(--seedit-perf-good);
}

.seedit-perf-metric__bar-fill--warning {
  background: var(--seedit-perf-warning);
}

.seedit-perf-metric__bar-fill--critical {
  background: var(--seedit-perf-critical);
}

/* Graphique sparkline */
.seedit-perf-metric__chart {
  width: 100%;
  height: 40px;
  opacity: 0.7;
}

.seedit-perf-metric__chart-line {
  stroke: var(--seedit-primary-light);
  transition: stroke 0.3s ease;
}

.seedit-perf-metric--good .seedit-perf-metric__chart-line {
  stroke: var(--seedit-perf-good);
}

.seedit-perf-metric--warning .seedit-perf-metric__chart-line {
  stroke: var(--seedit-perf-warning);
}

.seedit-perf-metric--critical .seedit-perf-metric__chart-line {
  stroke: var(--seedit-perf-critical);
}

/* Légende */
.seedit-perf-widget__legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.seedit-perf-widget__legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

.seedit-perf-widget__legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.seedit-perf-widget__legend-dot--good {
  background: var(--seedit-perf-good);
}

.seedit-perf-widget__legend-dot--warning {
  background: var(--seedit-perf-warning);
}

.seedit-perf-widget__legend-dot--critical {
  background: var(--seedit-perf-critical);
}

/* Animation de pulsation */
@keyframes seedit-perf-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* ====================================
   Informations
   ==================================== */
.seedit-perf-demo__info {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 1rem;
}

.seedit-perf-demo__info-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.seedit-perf-demo__info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.seedit-perf-demo__info-list li {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  padding-left: 1.5rem;
  position: relative;
}

.seedit-perf-demo__info-list li::before {
  content: '•';
  position: absolute;
  left: 0.5rem;
  color: var(--seedit-primary-light);
  font-weight: bold;
}

.seedit-perf-demo__info-list li strong {
  color: var(--seedit-primary-light);
  font-weight: 600;
}

/* ====================================
   Responsive Design
   ==================================== */
@media (max-width: 768px) {
  .seedit-perf-demo__container {
    padding: 2rem 1.5rem;
  }

  .seedit-perf-demo__title {
    font-size: 1.5rem;
  }

  .seedit-perf-demo__subtitle {
    font-size: 0.875rem;
  }

  .seedit-perf-widget {
    padding: 1.25rem;
  }

  .seedit-perf-widget__title {
    font-size: 1.25rem;
  }

  .seedit-perf-widget__grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .seedit-perf-widget__legend {
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (max-width: 375px) {
  .seedit-perf-demo__container {
    padding: 1.5rem 1rem;
  }

  .seedit-perf-demo__title {
    font-size: 1.25rem;
  }

  .seedit-perf-demo__subtitle {
    font-size: 0.8125rem;
  }

  .seedit-perf-widget {
    padding: 1rem;
  }

  .seedit-perf-widget__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .seedit-perf-widget__title {
    font-size: 1.125rem;
  }

  .seedit-perf-metric {
    padding: 1rem;
  }

  .seedit-perf-metric__value {
    font-size: 1.5rem;
  }
}

/* ====================================
   Préférences utilisateur
   ==================================== */
@media (prefers-reduced-motion: reduce) {
  .seedit-perf-widget__status-dot {
    animation: none;
  }

  .seedit-perf-metric__bar-fill {
    transition: none;
  }

  .seedit-perf-metric:hover {
    transform: none;
  }
}
