:root {
  /* Colors */
  --bg-color: #0b0f19;
  --panel-bg: rgba(17, 25, 40, 0.65);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-muted: #9ca3af;
  
  --color-primary: #06b6d4; /* Neon Cyan */
  --color-primary-glow: rgba(6, 182, 212, 0.4);
  --color-secondary: #8b5cf6; /* Neon Violet */
  --color-secondary-glow: rgba(139, 92, 246, 0.4);
  
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-warning: #f59e0b;
  
  /* Fonts */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Layout */
  --border-radius-lg: 20px;
  --border-radius-md: 12px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Background Gradients & Glow Orbs */
.glass-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  background: radial-gradient(circle at 50% 50%, #151d30 0%, #080b12 100%);
}

.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.25;
  pointer-events: none;
  animation: orb-bounce 25s infinite alternate ease-in-out;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--color-primary);
  top: -10%;
  right: -5%;
  animation-duration: 20s;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: var(--color-secondary);
  bottom: -15%;
  left: -10%;
  animation-duration: 28s;
}

@keyframes orb-bounce {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(50px, -40px) scale(1.1);
  }
  100% {
    transform: translate(-30px, 60px) scale(0.9);
  }
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--panel-border);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  z-index: 1;
}

/* Header */
.header-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(6, 182, 212, 0.4));
  animation: pulse 2s infinite ease-in-out;
}

.logo-text h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

#server-ip {
  font-family: var(--font-mono);
  color: var(--color-primary);
  font-weight: 500;
}

.status-badge-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.status-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.badge-online {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border-color: rgba(16, 185, 129, 0.2);
}

.badge-offline {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
  border-color: rgba(239, 68, 68, 0.2);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
  position: relative;
}

.badge-online .pulse-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: currentColor;
  animation: badge-pulse 1.5s infinite ease-out;
}

@keyframes badge-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Cards Generic */
.dashboard-grid section {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.dashboard-grid h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #fff;
  border-left: 3px solid var(--color-primary);
  padding-left: 10px;
}

.cpu-card h2 {
  border-left-color: var(--color-primary);
}

.mem-card h2 {
  border-left-color: var(--color-secondary);
}

/* System Card List */
.stats-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
  justify-content: center;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stat-val {
  font-weight: 500;
  font-size: 0.95rem;
}

.font-mono {
  font-family: var(--font-mono);
}

.color-accent {
  color: var(--color-primary);
}

.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 0;
}

/* Usage Cards (CPU & Memory) */
.usage-card {
  align-items: center;
}

.radial-progress-container {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px 0 20px 0;
}

.progress-ring {
  transform: rotate(-90deg);
  transform-origin: center;
}

.progress-ring__circle {
  transition: stroke-dashoffset 0.35s;
  /* Formula: 2 * PI * r = 2 * 3.14159 * 70 = 439.82 */
  stroke-dasharray: 439.82 439.82;
  stroke-dashoffset: 439.82;
  stroke-linecap: round;
}

.radial-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.radial-label .value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}

.radial-label .sub {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: -2px;
}

.details-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.detail-item span {
  color: var(--text-muted);
}

.detail-item strong {
  color: #fff;
  font-weight: 500;
}

/* Network Card (Full width on grid) */
.network-card {
  grid-column: span 3;
}

.table-container {
  overflow-x: auto;
  margin-top: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 600;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

tr:last-child td {
  border-bottom: none;
}

.font-bold {
  font-weight: 600;
  color: #fff;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
}

/* Footer Area */
.footer-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.refresh-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border: none;
  box-shadow: 0 4px 14px 0 rgba(6, 182, 212, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 rgba(6, 182, 212, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.refresh-status {
  font-size: 0.8rem;
}

.copyright {
  text-align: right;
}

/* Animations */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.05);
  }
}

/* Responsiveness */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .network-card {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .network-card {
    grid-column: span 1;
  }
  .header-panel {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .status-badge-container {
    align-items: flex-start;
  }
  .footer-area {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  .copyright {
    text-align: left;
  }
}
