/* ══════════════════════════════════════════════════
   CloudLab Dashboard — Styles
   ShadCN-inspired minimalist design system
   ══════════════════════════════════════════════════ */

/* ── CSS Tokens ─────────────────────────────────── */
:root {
  --bg:          #ffffff;
  --bg-muted:    #f8f9fa;
  --bg-card:     #ffffff;
  --border:      #e4e4e7;
  --border-hover:#a1a1aa;
  --text:        #09090b;
  --text-muted:  #71717a;
  --text-subtle: #a1a1aa;
  --accent:      #18181b;
  --accent-fg:   #ffffff;
  --ring:        #3f3f46;
  --green:       #16a34a;
  --yellow:      #ca8a04;
  --red:         #dc2626;
  --blue:        #2563eb;
  --radius:      0.5rem;
  --shadow-sm:   0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow:      0 1px 3px 0 rgb(0 0 0 / .08), 0 1px 2px -1px rgb(0 0 0 / .08);
  --shadow-md:   0 4px 6px -1px rgb(0 0 0 / .07), 0 2px 4px -2px rgb(0 0 0 / .07);
}

[data-theme="dark"] {
  --bg:          #09090b;
  --bg-muted:    #111113;
  --bg-card:     #18181b;
  --border:      #27272a;
  --border-hover:#3f3f46;
  --text:        #fafafa;
  --text-muted:  #a1a1aa;
  --text-subtle: #52525b;
  --accent:      #fafafa;
  --accent-fg:   #09090b;
  --ring:        #d4d4d8;
  --shadow-sm:   0 1px 2px 0 rgb(0 0 0 / .3);
  --shadow:      0 1px 3px 0 rgb(0 0 0 / .4), 0 1px 2px -1px rgb(0 0 0 / .4);
  --shadow-md:   0 4px 6px -1px rgb(0 0 0 / .4), 0 2px 4px -2px rgb(0 0 0 / .4);
}

/* ── Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  transition: background-color .2s ease, color .2s ease;
}

/* ── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-muted); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 99px; }

/* ── Header / Nav ───────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.015em;
}

.nav-logo .logo-cloud-icon {
  width: 20px;
  height: 20px;
  color: var(--green);
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--green) 40%, transparent));
  animation: cloud-pulse 3s ease-in-out infinite;
}

@keyframes cloud-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--green) 40%, transparent)); }
  50%       { filter: drop-shadow(0 0 8px color-mix(in srgb, var(--green) 70%, transparent)); }
}

.nav-actions { display: flex; align-items: center; gap: .5rem; }

/* ── Icon Button ────────────────────────────────── */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: var(--shadow-sm);
}
.btn-icon:hover { border-color: var(--border-hover); color: var(--text); background: var(--bg-muted); }
.btn-icon svg   { width: 15px; height: 15px; }

/* ── Clock ──────────────────────────────────────── */
#clock {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--text-subtle);
}

/* ── Main layout ────────────────────────────────── */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ── Section label ──────────────────────────────── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: .75rem;
}

/* ── Hero ───────────────────────────────────────── */
.hero {
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .25rem .65rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .03em;
  margin-bottom: 1.25rem;
}
.hero-badge svg { width: 12px; height: 12px; }

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: .75rem;
}
.hero h1 span { color: var(--text-muted); }

.hero p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 2rem;
}

/* ── Stat pills ─────────────────────────────────── */
.stat-group { display: flex; flex-wrap: wrap; gap: .75rem; }

.stat-pill {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .85rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s;
}
.stat-pill:hover { border-color: var(--border-hover); }

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green  { background: var(--green); }
.dot-yellow { background: var(--yellow); }
.dot-blue   { background: var(--blue); }

.stat-pill .stat-val {
  font-family: 'Geist Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-left: .1rem;
}

/* ── Cards grid ─────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

/* ── Service Card ───────────────────────────────── */
.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: var(--bg-card);
  padding: 1.25rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  background: radial-gradient(
    80px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--accent) 6%, transparent),
    transparent
  );
  transition: opacity .3s;
  pointer-events: none;
}
.service-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: inherit;
  text-decoration: none;
}
.service-card:hover::before { opacity: 1; }

/* ── Offline card state ─────────────────────────── */
.service-card.card--offline {
  opacity: .5;
  cursor: default;
  pointer-events: none;
}
.service-card.card--offline:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  transform: none;
}
.service-card.card--offline::before { display: none; }

.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.card-icon svg { width: 18px; height: 18px; }

/* ── Status badge ───────────────────────────────── */
.card-status {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: 11px;
  font-weight: 500;
  padding: .2rem .55rem;
  border-radius: 99px;
  border: 1px solid var(--border);
}
.card-status .dot { width: 5px; height: 5px; border-radius: 50%; }

.status-online {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 25%, var(--border));
  background: color-mix(in srgb, var(--green) 8%, var(--bg-card));
}
.status-online .dot  { background: var(--green); }

.status-offline {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 25%, var(--border));
  background: color-mix(in srgb, var(--red) 8%, var(--bg-card));
}
.status-offline .dot { background: var(--red); }

.status-idle {
  color: var(--yellow);
  border-color: color-mix(in srgb, var(--yellow) 25%, var(--border));
  background: color-mix(in srgb, var(--yellow) 8%, var(--bg-card));
}
.status-idle .dot    { background: var(--yellow); }

/* ── Card body ──────────────────────────────────── */
.card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
  margin-bottom: .2rem;
}
.card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.1rem;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: .85rem;
  margin-top: auto;
}
.card-tag {
  font-family: 'Geist Mono', monospace;
  font-size: 11px;
  color: var(--text-subtle);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: .1rem .45rem;
  border-radius: calc(var(--radius) - 2px);
}
.card-arrow {
  color: var(--text-subtle);
  transition: color .15s, transform .15s;
}
.service-card:hover .card-arrow {
  color: var(--text-muted);
  transform: translateX(2px);
}
.card-arrow svg { width: 14px; height: 14px; }

/* ── Category separator ─────────────────────────── */
.category-sep {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 2rem 0 1rem;
}
.category-sep span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: .02em;
}
.category-sep::before,
.category-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.category-sep::before { max-width: 0; }

/* ── Quick links list ───────────────────────────── */
.quick-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.quick-item {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: background .12s;
}
.quick-item:last-child { border-bottom: none; }
.quick-item:hover      { background: var(--bg-muted); color: var(--text); text-decoration: none; }

.quick-icon {
  width: 30px;
  height: 30px;
  border-radius: calc(var(--radius) - 1px);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}
.quick-icon svg { width: 14px; height: 14px; }

.quick-name { font-size: 13px; font-weight: 500; flex: 1; }
.quick-url  { font-family: 'Geist Mono', monospace; font-size: 11px; color: var(--text-subtle); }

.quick-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--border-hover);
  margin-left: .5rem;
  transition: background .3s;
}
.quick-item.qs-online  .quick-status-dot { background: var(--green); box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 20%, transparent); }
.quick-item.qs-offline .quick-status-dot { background: var(--red);   }

/* ── Footer ─────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 3rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}
.footer-text { font-size: 12px; color: var(--text-subtle); }
.footer-text a { color: var(--text-muted); text-decoration: none; }
.footer-text a:hover { color: var(--text); }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 640px) {
  .hero h1    { font-size: 1.75rem; }
  .stat-group { gap: .5rem; }
}
