/* Base styles */
body { 
  margin: 0; 
  font-family: Arial, sans-serif; 
  background-color: #2c2f33; 
  color: white; 
}

/* Navigation */
nav { 
  background: #23272a; 
  padding: 1rem 2rem; 
  display: flex; 
  justify-content: space-between; 
  position: sticky; 
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

nav .logo { 
  font-size: 1.5rem; 
  color: #7289da; 
  font-weight: bold; 
}

nav ul { 
  list-style: none; 
  display: flex; 
  gap: 1rem; 
  margin: 0; 
  padding: 0;
}

nav ul li a { 
  color: white; 
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

nav ul li a:hover {
  background-color: #40444b;
}

nav ul li a.active {
  background-color: #7289da;
}

/* Hero section */
.hero { 
  text-align: center; 
  padding: 4rem 2rem; 
}

.hero h1 { 
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.1rem;
  color: #a7b7cc;
  margin-top: 0.5rem;
}

/* Dashboard */
.dashboard-root {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.nodes-panel {
  background: #23272a;
  border-radius: 12px;
  padding: 24px 32px;
  margin-top: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

/* Category styling */
.category {
  background: linear-gradient(135deg, #23272a 0%, #1e2124 100%);
  border: 1px solid #40444b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border-radius: 12px;
}

.category h3 {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  color: #fff;
  font-weight: 700;
}

/* Node rows */
.node-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  transition: all 0.3s ease;
  padding: 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #23272a;
}

.node-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: #40444b;
  background: linear-gradient(135deg, #23272a 0%, #1e2124 100%);
}

.node-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.node-name {
  font-size: 1rem;
  font-weight: 700;
}

.node-sub {
  font-size: 0.85rem;
  font-weight: 400;
  color: #a7b7cc;
}

.node-health {
  display: flex;
  align-items: center;
  gap: 12px;
}

.node-time {
  color: #a7b7cc;
  font-size: 0.95rem;
}

/* Status badges */
.status-badge {
  font-weight: 700;
  border-radius: 12px;
  padding: 3px 12px;
  font-size: 0.95rem;
}

.status-badge.green { 
  background: #43b581; 
  color: #fff; 
}

.status-badge.red { 
  background: #f04747; 
  color: #fff; 
}

/* UptimeRobot-style timeline */
.uptime-timeline {
  margin-top: 1rem;
  padding: 0 1rem;
}

.uptime-bar-container {
  display: flex;
  gap: 1px;
  height: 24px;
  background: #1e2124;
  border-radius: 6px;
  padding: 3px;
  overflow: hidden;
}

.uptime-segment {
  flex: 1;
  border-radius: 2px;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.uptime-segment:hover {
  transform: scaleY(1.3);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.uptime-segment:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1d21;
  color: #fff;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  margin-bottom: 6px;
  border: 1px solid #40444b;
  font-family: Arial, sans-serif;
}

.uptime-segment:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 3px solid transparent;
  border-top-color: #40444b;
  z-index: 1000;
  margin-bottom: 3px;
}

/* Health bars (legacy - keeping for compatibility) */
.health-bars {
  display: flex;
  gap: 2px;
}

.health-bar {
  width: 5px;
  height: 16px;
  background: #43b581;
  border-radius: 2px;
}

/* Status item (legacy - keeping for compatibility) */
.status-item { 
  background: #23272a; 
  padding: 1rem; 
  border-radius: 5px; 
  margin-bottom: 1rem; 
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.checking {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Footer */
footer { 
  background: #23272a; 
  padding: 2rem; 
  text-align: center;
  margin-top: 4rem;
  border-top: 1px solid #40444b;
}

footer .footer-content { 
  display: flex; 
  flex-wrap: wrap; 
  justify-content: center; 
  gap: 2rem;
  margin-bottom: 1rem;
}

footer .brand { 
  font-size: 1.25rem; 
  color: #7289da;
  font-weight: bold;
}

footer .links { 
  display: flex; 
  gap: 1rem; 
  list-style: none; 
  padding: 0;
  margin: 0;
}

footer .links a { 
  color: white; 
  text-decoration: none;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

footer .links a:hover {
  background-color: #40444b;
}

footer p {
  color: #a7b7cc;
  font-size: 0.9rem;
  margin: 0;
}

/* Responsive design */
@media (max-width: 768px) {
  nav {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
  }

  nav ul {
    justify-content: center;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .dashboard-root {
    padding: 0 0.5rem;
  }

  .nodes-panel {
    padding: 16px 20px;
  }

  .category {
    padding: 1rem;
  }

  .uptime-bar-container {
    height: 20px;
  }

  .node-row {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .node-health {
    align-self: flex-end;
  }

  .uptime-timeline {
    padding: 0;
  }

  footer .footer-content {
    flex-direction: column;
    gap: 1rem;
  }

  footer .links {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .node-row {
    padding: 0.8rem;
  }

  .category {
    padding: 0.8rem;
  }

  .nodes-panel {
    padding: 12px 16px;
  }
}
