/* Reset и базовые стили */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0e0e0e;
  color: #f2f2f2;
  line-height: 1.6;
}

.monitoring {
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  text-align: center;
  background: linear-gradient(90deg, #00ff99, #00ccff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
}

h1 small {
  font-size: 0.5em;
  color: #aaa;
  margin-top: 0.5rem;
  display: block;
}

/* Контейнер статуса */
.status-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 3rem;
}

/* Блоки статуса */
.status-box {
  background: #1b1b1b;
  border: 1px solid #333;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 255, 200, 0.1);
  transition: all 0.3s ease;
}

.status-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 255, 200, 0.15);
}

.status-box.online {
  border-left: 6px solid #00ff99;
}

.status-box.offline {
  border-left: 6px solid #ff2f2f;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.status-name {
  font-weight: 700;
  font-size: 1.1rem;
  text-align: left;
  color: #fff;
}

.status-type {
  font-size: 0.85rem;
  color: #888;
  background: #2a2a2a;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  color: #ccc;
  justify-content: flex-start;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background: #00ff99;
  box-shadow: 0 0 10px rgba(0, 255, 153, 0.5);
}

.status-dot.offline {
  background: #ff2f2f;
  box-shadow: 0 0 10px rgba(255, 47, 47, 0.5);
}

.status-ping {
  margin-left: auto;
  font-size: 0.9rem;
  color: #999;
  font-family: 'Courier New', monospace;
}

.status-message {
  font-size: 0.85rem;
  color: #ff6b6b;
  text-align: left;
  background: rgba(255, 107, 107, 0.1);
  padding: 0.5rem;
  border-radius: 4px;
  border-left: 3px solid #ff6b6b;
}

/* Контейнер статистики */
.stats-container {
  width: 100%;
  margin-top: 3rem;
}

.stats-section h2 {
  color: #00ccff;
  margin-bottom: 2rem;
  font-size: 1.8rem;
  text-align: center;
  font-weight: 600;
}

/* Новый дизайн графиков - 3 в ряд */
.charts-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.chart-box {
  background: linear-gradient(145deg, #1a1a1a, #222);
  border: 1px solid #333;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 255, 200, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.chart-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #00ff99, #00ccff);
}

.chart-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 255, 200, 0.12);
  border-color: #444;
}

.chart-box h3 {
  margin: 0 0 1.5rem 0;
  color: #fff;
  font-size: 1.2rem;
  text-align: center;
  font-weight: 600;
}

/* Улучшенные графики */
.chart-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chart-bars {
  display: flex;
  align-items: end;
  justify-content: space-between;
  height: 140px;
  margin-bottom: 0.5rem;
  gap: 0.4rem;
  padding: 0 0.5rem;
}

.chart-bar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  position: relative;
  min-width: 30px;
}

.chart-bar {
  width: 100%;
  min-height: 5px;
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: all 0.4s ease;
  cursor: pointer;
  background: linear-gradient(to top, currentColor, rgba(255,255,255,0.3));
}

.chart-bar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px currentColor;
  filter: brightness(1.2);
}

.bar-value {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: #fff;
  white-space: nowrap;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.8);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  backdrop-filter: blur(10px);
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.chart-label {
  font-size: 0.75rem;
  color: #888;
  text-align: center;
  flex: 1;
  font-weight: 500;
}

/* Статистика под графиком */
.chart-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.stat-label {
  color: #aaa;
}

.stat-value {
  font-weight: 600;
}

.uptime-value {
  color: #00ff99;
}

.checks-value {
  color: #00ccff;
}

.failures-value {
  color: #ff6b6b;
}

/* Прогресс-бар для общего uptime */
.uptime-progress {
  width: 100%;
  height: 6px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.uptime-progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Утилиты */
.loading {
  font-style: italic;
  color: #888;
  animation: pulse 1.5s infinite;
  font-size: 1.1rem;
  text-align: center;
}

.error-message {
  background: rgba(255, 47, 47, 0.1);
  border: 1px solid #ff2f2f;
  border-radius: 8px;
  padding: 1rem;
  color: #ff6b6b;
  margin: 1rem 0;
  text-align: center;
}

.last-update {
  margin-top: 3rem;
  color: #666;
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
}

/* Анимации */
@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chart-box {
  animation: slideIn 0.6s ease-out;
}

/* Адаптивность */
@media (max-width: 1024px) {
  .charts-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }
}

@media (max-width: 768px) {
  .monitoring {
    padding: 1rem 0.5rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .status-box {
    padding: 1rem;
    gap: 0.5rem;
  }
  
  .status-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .status-indicator {
    justify-content: space-between;
  }
  
  .status-ping {
    margin-left: 0;
  }
  
  .charts-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .chart-bars {
    height: 120px;
  }
  
  .chart-bar {
    min-width: 25px;
  }
  
  .bar-value {
    font-size: 0.7rem;
    top: -25px;
  }
  
  .stats-section h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }
  
  .status-name {
    font-size: 1rem;
  }
  
  .status-indicator {
    font-size: 0.9rem;
    flex-wrap: wrap;
  }
  
  .chart-box {
    padding: 1rem;
  }
  
  .chart-bars {
    height: 100px;
  }
  
  .chart-bar {
    min-width: 20px;
  }
  
  .bar-value {
    font-size: 0.65rem;
    top: -22px;
    padding: 0.1rem 0.3rem;
  }
}
/* Стили для точечных графиков в стиле CPU Monitor */
.charts-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.chart-box {
  background: linear-gradient(145deg, #0f0f0f, #1a1a1a);
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.chart-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #00ff99, #00ccff, #ff2f2f);
  opacity: 0.8;
}

.chart-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 255, 200, 0.1);
}

.chart-box h3 {
  margin: 0 0 1.5rem 0;
  color: #fff;
  font-size: 1.1rem;
  text-align: center;
  font-weight: 600;
}

/* Контейнер для точечного графика */
.chart-scatter {
  position: relative;
  height: 120px;
  margin-bottom: 1rem;
  background: 
    linear-gradient(90deg, transparent 49%, #333 49%, #333 51%, transparent 51%),
    linear-gradient(0deg, transparent 49%, #333 49%, #333 51%, transparent 51%);
  background-size: 20% 100%, 100% 25%;
  border-radius: 8px;
  overflow: hidden;
}

/* Сетка графика */
.chart-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.grid-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.05);
}

.grid-line.horizontal {
  left: 0;
  right: 0;
  height: 1px;
}

.grid-line.vertical {
  top: 0;
  bottom: 0;
  width: 1px;
}

/* Точки на графике */
.scatter-points {
  position: relative;
  width: 100%;
  height: 100%;
}

.scatter-point {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
  box-shadow: 0 0 8px currentColor;
}

.scatter-point:hover {
  transform: translate(-50%, -50%) scale(1.8);
  z-index: 10;
}

/* Цвета точек в зависимости от uptime */
.point-excellent { background: #00ff99; } /* 95-100% */
.point-good { background: #66ff66; }      /* 90-94% */
.point-fair { background: #ffcc00; }      /* 80-89% */
.point-poor { background: #ff6666; }      /* 70-79% */
.point-bad { background: #ff2f2f; }       /* 0-69% */

/* Ось Y (проценты) */
.y-axis {
  position: absolute;
  left: -25px;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #666;
  font-size: 0.7rem;
  width: 20px;
}

.y-label {
  text-align: right;
  transform: translateY(50%);
}

/* Ось X (даты) */
.x-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  padding: 0 0.5rem;
}

.x-label {
  font-size: 0.7rem;
  color: #666;
  transform: rotate(-45deg);
  transform-origin: left top;
  white-space: nowrap;
}

/* Статистика под графиком */
.chart-stats {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #333;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  color: #888;
  font-size: 0.8rem;
}

.stat-value {
  font-weight: 600;
  font-size: 0.9rem;
}

.uptime-value { color: #00ff99; }
.checks-value { color: #00ccff; }
.failures-value { color: #ff6b6b; }

/* Прогресс-бар для текущего статуса */
.current-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-online { background: #00ff99; box-shadow: 0 0 6px #00ff99; }
.status-offline { background: #ff2f2f; box-shadow: 0 0 6px #ff2f2f; }

.status-text {
  font-size: 0.8rem;
  color: #ccc;
}

/* Легенда графика */
.chart-legend {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  color: #888;
}

.legend-color {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Анимации для точек */
@keyframes pointPulse {
  0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.scatter-point {
  animation: pointPulse 2s ease-in-out infinite;
}

.scatter-point:nth-child(2n) {
  animation-delay: 0.3s;
}

.scatter-point:nth-child(3n) {
  animation-delay: 0.6s;
}

/* Адаптивность */
@media (max-width: 1024px) {
  .charts-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .charts-container {
    grid-template-columns: 1fr;
  }
  
  .chart-scatter {
    height: 100px;
  }
  
  .scatter-point {
    width: 5px;
    height: 5px;
  }
}

@media (max-width: 480px) {
  .chart-box {
    padding: 1rem;
  }
  
  .chart-scatter {
    height: 80px;
  }
  
  .scatter-point {
    width: 4px;
    height: 4px;
  }
  
  .y-axis {
    left: -20px;
  }
  
  .x-label {
    font-size: 0.6rem;
  }
}
/* Стили для анимированных индикаторов статуса */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  color: #ccc;
  justify-content: flex-start;
}

/* Анимированные точки статуса */
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.status-dot.online {
  background: #00ff99;
  box-shadow: 0 0 10px rgba(0, 255, 153, 0.5);
  animation: pulseOnline 2s ease-in-out infinite;
}

.status-dot.offline {
  background: #ff2f2f;
  box-shadow: 0 0 10px rgba(255, 47, 47, 0.5);
  animation: pulseOffline 1.5s ease-in-out infinite;
}

/* Анимация для онлайн статуса */
@keyframes pulseOnline {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 10px rgba(0, 255, 153, 0.5);
  }
  50% { 
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 153, 0.8);
  }
}

/* Анимация для оффлайн статуса */
@keyframes pulseOffline {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 10px rgba(255, 47, 47, 0.5);
  }
  50% { 
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 47, 47, 0.8);
  }
}

/* Контейнер дополнительной информации */
.status-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border-left: 3px solid;
}

.status-details.online {
  border-left-color: #00ff99;
  background: rgba(0, 255, 153, 0.05);
}

.status-details.offline {
  border-left-color: #ff2f2f;
  background: rgba(255, 47, 47, 0.05);
}

/* Иконки статуса */
.status-icon {
  font-size: 1rem;
  animation: bounce 2s ease-in-out infinite;
}

.status-text {
  flex: 1;
}

.connection-info {
  font-size: 0.75rem;
  color: #666;
  font-family: 'Courier New', monospace;
}

/* Анимация для иконок */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* Анимированные символы */
.online-symbol {
  color: #00ff99;
  animation: spin 3s linear infinite;
}

.offline-symbol {
  color: #ff2f2f;
  animation: shake 0.5s ease-in-out infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}