/* ==========================================================================
   ZelibVPN // Status Console
   Strict Monochrome / Grok & xAI Aesthetic
   ========================================================================== */

:root {
  --bg-page: #000000;
  --bg-card: #080808;
  --bg-surface: #0a0a0a;
  --bg-input: #050505;
  --bg-hover: #121212;
  --bg-active: #181818;

  --border-subtle: #141414;
  --border-base: #1c1c1c;
  --border-card: #1e1e1e;
  --border-hover: #333333;
  --border-focus: #555555;

  --text-primary: #f3f3f3;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-dim: #52525b;

  /* Micro status indicators only */
  --status-online: #10b981;
  --status-warn: #f59e0b;
  --status-offline: #ef4444;
  --uptime-empty: #18181b;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

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

html, body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Focused, console-like container */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* ==========================================================================
   Header: Minimalist 1-Row Console Style
   ========================================================================== */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-base);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-glyph {
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
  user-select: none;
}

.brand-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.brand-sep {
  color: var(--text-dim);
  font-weight: 400;
  margin: 0 2px;
}

.header-right {
  display: flex;
  align-items: center;
}

.btn-refresh {
  background: var(--bg-page);
  border: 1px solid #262626;
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.15s ease;
}

.btn-refresh:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: #ffffff;
}

.btn-refresh svg {
  transition: transform 0.4s ease;
}

.btn-refresh.spinning svg {
  transform: rotate(360deg);
}

/* ==========================================================================
   Global Status Banner (Strict Rectangle)
   ========================================================================== */

.global-status-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 13px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Tiny Micro Status Dot */
.radar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-online);
  display: inline-block;
  flex-shrink: 0;
}

.radar-dot.warn {
  background: var(--status-warn);
}

.radar-dot.error {
  background: var(--status-offline);
}

.status-text-wrap {
  display: flex;
  flex-direction: column;
}

.status-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.status-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.status-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
}

.time-label {
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.time-val {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ==========================================================================
   Summary: Unified Horizontal Bar with Vertical Thin Dividers
   Strict Monochrome: Numbers are PURE WHITE
   ========================================================================== */

.metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 14px;
}

.metric-segment {
  padding: 14px 18px;
  border-right: 1px solid var(--border-base);
  display: flex;
  flex-direction: column;
}

.metric-segment:last-child {
  border-right: none;
}

.metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 500;
}

.metric-val {
  font-size: 22px;
  font-weight: 500;
  color: #ffffff !important;
  font-family: var(--font-mono);
  margin-top: 4px;
  line-height: 1.2;
}

/* Demo Notice (Sleek Console Style) */
.demo-banner {
  background: var(--bg-surface);
  border: 1px solid #27272a;
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 11px;
  color: #a1a1aa;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--font-mono);
}

.demo-indicator {
  color: var(--status-warn);
  font-size: 10px;
}

/* ==========================================================================
   Section Headers
   ========================================================================== */

.section {
  margin-top: 36px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  padding: 0 2px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a1a1aa;
}

.section-sub {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Server Cards
   ========================================================================== */

.servers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.server-card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  transition: border-color 0.15s ease;
}

.server-card:hover {
  border-color: var(--border-hover);
}

.server-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

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

.server-title-group h3 {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.server-tag {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: #111111;
  border: 1px solid #202020;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.server-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.server-status-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-ping {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #e4e4e7;
  background: #0d0d0d;
  border: 1px solid #222222;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.pill-ping.slow {
  color: var(--status-offline);
  border-color: rgba(239, 68, 68, 0.3);
}

.pill-ping.medium {
  color: var(--status-warn);
}

/* Status Pill: No bright pill fill, strict dot + monochrome text */
.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: #d4d4d8;
  padding: 3px 6px;
}

.pill-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-online);
}

.pill-status.offline .dot {
  background: var(--status-offline);
}

.pill-status.offline {
  color: var(--status-offline);
}

/* 30-Bar Uptime Graph */
.uptime-section {
  margin-top: 14px;
}

.uptime-bars-wrap {
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 18px;
  position: relative;
}

.uptime-bar {
  flex: 1;
  height: 18px;
  border-radius: 2px;
  background-color: var(--status-online);
  transition: opacity 0.15s ease;
  position: relative;
  cursor: pointer;
}

.uptime-bar:hover {
  opacity: 0.75;
}

.uptime-bar.offline {
  background-color: var(--status-offline);
}

.uptime-bar.empty {
  background-color: var(--uptime-empty);
  cursor: default;
}

.uptime-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-top: 6px;
}

.uptime-percent {
  color: var(--text-secondary);
}

/* Tooltip for Uptime Bar */
.bar-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #111111;
  border: 1px solid #282828;
  color: #f3f3f3;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: var(--font-mono);
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  display: none;
}

.uptime-bar:hover .bar-tooltip {
  display: block;
}

/* Skeletons */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sk-line {
  background: #121212;
  border-radius: var(--radius-xs);
}

.sk-title {
  width: 30%;
  height: 14px;
}

.sk-sub {
  width: 50%;
  height: 10px;
}

.sk-bars {
  width: 100%;
  height: 18px;
}

/* ==========================================================================
   Bypasses / Split Tunneling: Table-style Listing
   ========================================================================== */

.bypasses-container {
  background: var(--bg-card);
  border: 1px solid var(--border-base);
  border-radius: var(--radius-lg);
  padding: 16px;
}

/* Toolbar Controls */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid #222222;
  border-radius: var(--radius-md);
  padding: 8px 12px 8px 34px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s ease;
}

.search-input:focus {
  border-color: var(--border-focus);
}

.search-input::placeholder {
  color: var(--text-dim);
}

.clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 11px;
  display: none;
}

.clear-btn:hover {
  color: #ffffff;
}

.toolbar-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-action {
  background: var(--bg-surface);
  border: 1px solid #242424;
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-action:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: #ffffff;
}

/* Category Filter Tabs */
.category-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.cat-tab {
  background: var(--bg-input);
  border: 1px solid #1c1c1c;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cat-tab:hover {
  border-color: #2e2e2e;
  color: var(--text-primary);
}

.cat-tab.active {
  background: var(--bg-active);
  border-color: #3f3f46;
  color: #ffffff;
}

.cat-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.cat-tab.active .cat-badge {
  color: #ffffff;
}

/* Bypasses Table-Style Rows */
.bypasses-list {
  display: flex;
  flex-direction: column;
}

.bypass-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #161616;
  border-radius: var(--radius-sm);
  transition: background-color 0.12s ease;
  gap: 12px;
}

.bypass-row:last-child {
  border-bottom: none;
}

.bypass-row:hover {
  background-color: #0d0d0d;
}

.bypass-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.bypass-domain-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.bypass-domain {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.bypass-name {
  font-size: 12px;
  color: var(--text-secondary);
}

.bypass-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.3;
}

.bypass-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.bypass-cat-pill {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  border: 1px solid #1c1c1c;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.btn-copy-card {
  background: #111111;
  border: 1px solid #242424;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  opacity: 0.7;
}

.bypass-row:hover .btn-copy-card {
  opacity: 1;
}

.btn-copy-card:hover {
  background: #181818;
  border-color: var(--border-hover);
  color: #ffffff;
}

.btn-copy-card.copied {
  color: var(--status-online);
  border-color: rgba(16, 185, 129, 0.4);
}

.no-results {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-dim);
  font-size: 13px;
  font-family: var(--font-mono);
}

/* ==========================================================================
   Guide Box
   ========================================================================== */

.guide-box {
  background: var(--bg-input);
  border: 1px solid #1a1a1a;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 14px;
}

.guide-box summary {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-box summary:hover {
  color: #ffffff;
}

.guide-marker {
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.guide-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #161616;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.guide-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-title {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  font-family: var(--font-mono);
}

.guide-col p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.guide-col code {
  font-family: var(--font-mono);
  font-size: 10px;
  background: #141414;
  border: 1px solid #222222;
  padding: 1px 4px;
  border-radius: var(--radius-xs);
  color: #e4e4e7;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-sep {
  color: #27272a;
}

.footer-links {
  display: flex;
  gap: 14px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #ffffff;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #111111;
  border: 1px solid #282828;
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast svg {
  color: var(--status-online);
  flex-shrink: 0;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 680px) {
  .container {
    padding: 20px 14px 48px;
  }

  .metrics-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-segment:nth-child(2) {
    border-right: none;
  }

  .metric-segment:nth-child(1),
  .metric-segment:nth-child(2) {
    border-bottom: 1px solid var(--border-base);
  }

  .server-card-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .server-status-pills {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar {
    flex-direction: column;
  }

  .toolbar-actions {
    width: 100%;
  }

  .btn-action {
    flex: 1;
    text-align: center;
  }

  .bypass-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .bypass-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 6px;
  }
}
