/* RelayPulse - Main Styles */
/* Dark theme LLM relay monitoring dashboard */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1422;
  --bg-card: #111827;
  --bg-card-hover: #1a2235;
  --bg-input: #1a2235;
  --bg-modal: #13182a;
  
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-accent: rgba(59, 130, 246, 0.3);
  
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #60a5fa;
  
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-dim: rgba(59, 130, 246, 0.1);
  
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --gray: #4b5563;
  
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
  
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  
  --nav-height: 60px;
  --sidebar-width: 240px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: #2d3748;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #4a5568;
}

/* ========== Navigation ========== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.nav-logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: var(--text-accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: #22c55e;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  border: none;
  cursor: pointer;
}

.nav-btn:hover {
  background: var(--accent-hover);
}

.nav-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.nav-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* ========== Layout ========== */
.layout {
  display: flex;
  padding-top: var(--nav-height);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--nav-height));
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 4px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 8px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  cursor: pointer;
}

.sidebar-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-item.active {
  color: var(--text-accent);
  background: rgba(59, 130, 246, 0.08);
}

.sidebar-item-icon {
  width: 16px;
  text-align: center;
  font-size: 12px;
  flex-shrink: 0;
}

.sidebar-item-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-item-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  background: var(--accent-dim);
  color: var(--text-accent);
  flex-shrink: 0;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  padding: 28px 32px;
}

/* ========== Page Header ========== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.page-title p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========== Stats Bar ========== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.stat-card-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card.green .stat-card-value { color: var(--green); }
.stat-card.yellow .stat-card-value { color: var(--yellow); }
.stat-card.red .stat-card-value { color: var(--red); }
.stat-card.blue .stat-card-value { color: var(--accent); }

/* ========== Controls Bar ========== */
.controls-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* 漏斗图标 */
.filter-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 2px;
}

/* 胶囊 select 包裹层 */
.pill-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.pill-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 6px 30px 6px 14px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  outline: none;
  min-width: 88px;
  letter-spacing: 0.2px;
}

.pill-select:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.32);
  color: #f1f5f9;
}

.pill-select:focus {
  border-color: rgba(96,165,250,0.7);
  background: rgba(59,130,246,0.12);
  color: #f1f5f9;
}

/* 自定义箭头 */
.pill-chevron {
  position: absolute;
  right: 10px;
  pointer-events: none;
  color: rgba(255,255,255,0.55);
  flex-shrink: 0;
}

/* 下拉选项背景（保证深色主题下可读）*/
.pill-select option {
  background: #1a2235;
  color: #e2e8f0;
  font-weight: 500;
}

/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  min-width: 180px;
  max-width: 260px;
  transition: border-color 0.15s, background 0.15s;
}

.search-box:focus-within {
  border-color: var(--border-accent);
  background: rgba(255,255,255,0.08);
}

.search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 12px;
  width: 100%;
  font-family: var(--font);
}

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

/* 操作图标按钮组 */
.action-btn-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.action-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.action-icon-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
}

.action-icon-btn.green { color: var(--green); border-color: rgba(34,197,94,0.25); background: rgba(34,197,94,0.06); }
.action-icon-btn.green:hover { background: rgba(34,197,94,0.14); border-color: rgba(34,197,94,0.4); }

/* 保留 tab-group / tab-btn / filter-select 以防其他页面还在用 */
.tab-group { display:flex; background:var(--bg-input); border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.tab-btn { padding:6px 14px; font-size:12px; font-weight:500; color:var(--text-secondary); background:none; border:none; cursor:pointer; transition:all .15s; font-family:var(--font); white-space:nowrap; }
.tab-btn:hover { color:var(--text-primary); background:rgba(255,255,255,.05); }
.tab-btn.active { color:var(--text-primary); background:rgba(255,255,255,.1); }
.filter-select { background:var(--bg-input); border:1px solid var(--border); border-radius:var(--radius-sm); padding:6px 26px 6px 10px; color:var(--text-primary); font-size:12px; cursor:pointer; font-family:var(--font); transition:border-color .15s; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 8px center; }
.filter-select:focus { outline:none; border-color:var(--border-accent); }

/* ========== Board Tabs ========== */
.board-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.board-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.board-tab:hover {
  color: var(--text-primary);
}

.board-tab.active {
  color: var(--text-accent);
  border-bottom-color: var(--accent);
}

.board-tab-count {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.board-tab.active .board-tab-count {
  background: var(--accent-dim);
  color: var(--text-accent);
}

/* ========== Provider Cards ========== */
.providers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.provider-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.provider-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.provider-card.sponsored {
  border-color: rgba(59, 130, 246, 0.2);
}

.provider-card.sponsored:hover {
  border-color: rgba(59, 130, 246, 0.35);
}

.provider-card.cold-provider {
  opacity: 0.6;
}

.provider-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

.provider-header:hover .provider-name {
  color: var(--text-accent);
}

.provider-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-accent);
  flex-shrink: 0;
  border: 1px solid rgba(59, 130, 246, 0.2);
  letter-spacing: -0.5px;
}

.provider-info {
  flex: 1;
  min-width: 0;
}

.provider-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.provider-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.15s;
}

.sponsor-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.provider-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.provider-description {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-category {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.provider-category.commercial {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.provider-category.public {
  background: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.provider-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px 12px 66px;
}

.provider-sparkline {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

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

.provider-uptime strong {
  color: var(--green);
  font-weight: 600;
}

.provider-services-count {
  font-size: 12px;
  color: var(--text-muted);
}

.expand-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.provider-card.expanded .expand-icon {
  transform: rotate(180deg);
}

.provider-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}

.status-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-up .status-indicator-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-slow .status-indicator-dot { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.status-down .status-indicator-dot { background: var(--red); box-shadow: 0 0 6px var(--red); }
.status-unknown .status-indicator-dot { background: var(--gray); }

.status-up { color: var(--green); }
.status-slow { color: var(--yellow); }
.status-down { color: var(--red); }
.status-unknown { color: var(--gray); }

/* ========== Services Table ========== */
.services-section {
  border-top: 1px solid var(--border);
  padding: 0 16px 16px;
  display: none;
}

.provider-card.expanded .services-section {
  display: block;
}

.services-header {
  display: grid;
  grid-template-columns: 2fr 76px 90px 90px 2fr 140px;
  gap: 8px;
  padding: 10px 8px 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  margin-top: 12px;
}

.service-row {
  display: grid;
  grid-template-columns: 2fr 76px 90px 90px 2fr 140px;
  gap: 8px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  align-items: center;
  cursor: pointer;
}

.service-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.service-name-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.service-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.service-model {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-channel-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--text-accent);
  font-weight: 500;
}

.service-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
}

.service-uptime {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.service-latency {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.service-price {
  font-size: 11px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ========== History Bar Chart ========== */
.history-bars {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 36px;         /* 增高容器，让条形更明显 */
  min-width: 0;
  flex: 1;
}

.history-bar {
  flex: 1;
  min-width: 3px;
  max-width: 8px;
  border-radius: 2px 2px 1px 1px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  position: relative;
}

.history-bar:hover {
  opacity: 0.85 !important;
  transform: scaleY(1.08);
  transform-origin: bottom;
}

/* up = 全高绿条，带发光效果 */
.history-bar.up {
  background: var(--green);
  opacity: 1;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
}

/* slow = 中高黄条 */
.history-bar.slow {
  background: var(--yellow);
  opacity: 0.95;
  box-shadow: 0 0 3px rgba(245, 158, 11, 0.35);
}

/* down = 矮红条 */
.history-bar.down {
  background: var(--red);
  opacity: 0.9;
  box-shadow: 0 0 3px rgba(239, 68, 68, 0.35);
}

/* unknown = 极矮暗条 */
.history-bar.unknown {
  background: #2d3748;
  opacity: 0.7;
}

/* ========== Cold Board Notice ========== */
.cold-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: #ef4444;
  margin: 8px 0;
}

/* ========== Empty State ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  gap: 12px;
}

.empty-state-icon {
  font-size: 48px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ========== Tooltip ========== */
.tooltip {
  position: fixed;
  background: #1e293b;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 11px;
  color: var(--text-primary);
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.1s;
}

.tooltip.visible {
  opacity: 1;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 640px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.visible .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal-section {
  margin-bottom: 20px;
}

.modal-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.modal-stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}

.modal-stat-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.modal-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-full {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
}

.history-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.history-cell:hover { opacity: 0.7; }
.history-cell.up { background: var(--green); opacity: 0.75; }
.history-cell.slow { background: var(--yellow); opacity: 0.75; }
.history-cell.down { background: var(--red); opacity: 0.75; }
.history-cell.unknown { background: #1f2937; }

/* ========== Last Updated ========== */
.last-updated {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.update-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 3s infinite;
}

/* ========== Announcement Banner ========== */
.announcement {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 13px;
}

.announcement-icon {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.announcement-content {
  flex: 1;
}

.announcement-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

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

.announcement-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1;
}

/* ========== Features Section ========== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.feature-icon {
  font-size: 24px;
  margin-bottom: 12px;
}

.feature-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.feature-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========== SelfTest Page ========== */
.selftest-container {
  max-width: 680px;
}

.selftest-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

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

.form-input.mono {
  font-family: var(--font-mono);
  font-size: 12px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2364748b' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-color: var(--bg-input);
  padding-right: 28px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: var(--font);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-loading::after {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.test-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: none;
}

.test-result.visible {
  display: block;
}

.test-result.success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.03);
}

.test-result.error {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.03);
}

.test-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.test-result-status {
  font-size: 15px;
  font-weight: 700;
}

.test-result-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.result-code-block {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a5d6ff;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.6;
}

/* ========== About Page Specifics ========== */
.about-hero {
  text-align: center;
  padding: 48px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.about-hero h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #e2e8f0 0%, #60a5fa 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.about-hero p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

.about-section {
  max-width: 720px;
  margin: 0 auto 48px;
}

.about-section h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.about-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}

.about-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.about-step {
  display: flex;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.about-step-num {
  width: 28px;
  height: 28px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-accent);
  flex-shrink: 0;
}

.about-step-content h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.about-step-content p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .sidebar {
    display: none;
  }
  .main {
    margin-left: 0;
    padding: 20px 16px;
  }
  .features-grid {
    grid-template-columns: 1fr 1fr;
  }
  .services-header,
  .service-row {
    grid-template-columns: 2fr 70px 90px 90px 1.5fr;
  }
  .service-row .service-price {
    display: none;
  }
  .services-header .price-col {
    display: none;
  }
}

@media (max-width: 640px) {
  .nav {
    padding: 0 12px;
    gap: 8px;
  }
  .nav-links {
    display: none;
  }
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .modal-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .services-header,
  .service-row {
    grid-template-columns: 2fr 60px 80px 1.2fr;
  }
  .service-uptime,
  .service-latency {
    font-size: 11px;
  }
}

/* ========== Animations ========== */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fade-in 0.2s ease-out forwards;
}

.provider-card {
  animation: fade-in 0.3s ease-out both;
}

/* ========== Loading Skeleton ========== */
.skeleton {
  background: linear-gradient(90deg, #1a2235 25%, #1e2a3f 50%, #1a2235 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== Sponsor Pinned Row ========== */
.pinned-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  font-weight: 600;
}

/* ========== Uptime Color Classes ========== */
.uptime-excellent { color: var(--green); }
.uptime-good { color: #86efac; }
.uptime-fair { color: var(--yellow); }
.uptime-poor { color: var(--red); }

/* ========== Page-specific layouts ========== */
.page-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title-icon {
  width: 24px;
  height: 24px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
