/* ===== CSS VARIABLES ===== */
:root {
  --bg: #0a0e27;
  --card: #0f1535;
  --accent: #10b981;
  --muted: #6b7280;
  --danger: #ef4444;
  --secondary: #3b82f6;
  --glass: rgba(255, 255, 255, 0.05);
}

/* ===== GLOBAL STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  background: var(--bg);
  color: #e5e7eb;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(59, 130, 246, 0.1));
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  margin: 20px 0;
}

/* ===== SIDEBAR ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 80px;
  height: fit-content;
  z-index: 20;
}

.side-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.side-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, var(--card), rgba(16, 185, 129, 0.05));
}

.side-card.highlight {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--card), rgba(16, 185, 129, 0.1));
}

.side-title {
  font-weight: 600;
  font-size: 13px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.side-title::after {
  content: '▸';
  display: inline-block;
  transition: transform 0.3s ease;
  color: var(--accent);
}

.side-card.expanded .side-title::after {
  transform: rotate(90deg);
}

.side-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-label {
  color: var(--muted);
}

.meta-value {
  color: #fff;
  font-weight: 500;
}

.side-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding-top 0.3s ease;
  padding-top: 0;
}

.side-card.expanded .side-details {
  max-height: 600px;
  padding-top: 10px;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.detail-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 12px;
  color: #fff;
}

/* ===== PROGRESS BARS ===== */
.progress {
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress.small {
  height: 16px;
}

.progress-fill {
  height: 100%;
  transition: width 0.3s ease;
  background: linear-gradient(90deg, var(--accent), #06b6d4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
  border-radius: 10px;
}

.mini-fill {
  height: 6px;
  background: linear-gradient(90deg, var(--accent), #06b6d4);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* ===== THRESHOLD COLORS ===== */
.progress-fill.high,
.mini-fill.high {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.progress-fill.med,
.mini-fill.med {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.progress-fill.low,
.mini-fill.low {
  background: linear-gradient(90deg, var(--accent), #10b981);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 0;
}

.filler {
  padding: 20px;
  text-align: center;
}

.filler h2 {
  margin-bottom: 10px;
  color: var(--accent);
}

.filler p {
  color: var(--muted);
  margin-bottom: 20px;
}

/* ===== CONTENT BOXES ===== */
.content-box {
  background: linear-gradient(135deg, var(--card), rgba(16, 185, 129, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.content-box:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.15);
  transform: translateY(-2px);
}

.content-box h2 {
  color: var(--accent);
  font-size: 20px;
  margin-bottom: 16px;
  margin-top: 0;
}

.content-box p {
  color: #d1d5db;
  line-height: 1.7;
  margin-bottom: 12px;
}

.content-box p:last-of-type {
  margin-bottom: 0;
}

.content-box ul {
  color: #d1d5db;
  line-height: 1.8;
  margin: 12px 0;
  padding-left: 24px;
}

.content-box li {
  margin-bottom: 8px;
}

.content-box strong {
  color: #f0fdf4;
  font-weight: 600;
}

/* ===== PAGE SECTIONS ===== */
.page-section {
  width: 100%;
  display: block;
  visibility: visible;
}

/* Servers grid */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.server-card {
  background: linear-gradient(135deg, var(--card), rgba(16,185,129,0.03));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 16px;
}

.server-card h3 {
  margin-bottom: 8px;
  color: var(--accent);
}

.server-card pre {
  background: rgba(0,0,0,0.12);
  padding: 8px;
  border-radius: 6px;
  overflow: auto;
  font-size: 12px;
}

.server-card .card-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.server-card .owner {
  color: #d1d5db;
  margin-bottom:8px;
}

.spec-list {
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:8px;
}

.spec-item {
  display:flex;
  align-items:center;
  gap:6px;
  color:#d1d5db;
  font-size:13px;
}

.diode {
  width:12px;
  height:12px;
  border-radius:50%;
  box-shadow:0 0 6px rgba(0,0,0,0.4);
  margin-left:8px;
}

.diode.online { background: #22c55e; box-shadow:0 0 8px rgba(34,197,94,0.6);} 
.diode.offline { background: #ef4444; box-shadow:0 0 8px rgba(239,68,68,0.6);} 

.server-meta-row { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.server-ip { color: var(--muted); font-size:13px; }

.server-ip-row {
  color: #d1d5db;
  margin: 12px 0 8px 0;
  font-size: 13px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .nav-links {
    gap: 10px;
  }

  .nav-links a {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .nav h1 {
    font-size: 18px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .side-card {
    padding: 10px;
  }
}
