:root {
  --bg-dark: #0b0f19;
  --card-bg: #151c2c;
  --card-border: #232d42;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --accent-purple: #a855f7;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  padding: 24px;
  line-height: 1.5;
}

.app-container {
  max-width: 1280px;
  margin: 0 auto;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 32px;
}

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

.logo {
  font-size: 32px;
  background: linear-gradient(135deg, #3b82f6, #a855f7);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sub-title {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

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

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e293b;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 13px;
  border: 1px solid var(--card-border);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

.time-badge {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  background: #1e293b;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
}

/* Sections */
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* Slots Grid */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.slot-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.slot-card:hover {
  border-color: #3b82f660;
}

.slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

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

.slot-number {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.slot-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.status-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  letter-spacing: 0.05em;
}

.status-badge.idle {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.status-badge.connected {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* URL Display Box */
.url-box {
  background: #0d1322;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.url-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.url-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.url-display a {
  color: #60a5fa;
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  word-break: break-all;
  font-weight: 500;
}

.url-display a:hover {
  text-decoration: underline;
}

.btn-copy {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}

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

/* Details List */
.slot-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

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

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

.detail-val {
  font-family: var(--font-mono);
  font-weight: 500;
}

/* Metrics Row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.metric {
  background: #0f172a;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.metric-val {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  display: block;
}

.metric-val.success { color: var(--success); }
.metric-val.error { color: var(--error); }

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

/* CLI Helper */
.cli-helper {
  background: #090d16;
  border: 1px dashed var(--card-border);
  border-radius: 8px;
  padding: 12px;
}

.helper-title {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.cli-helper code {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #38bdf8;
  word-break: break-all;
  margin-bottom: 8px;
}

.btn-copy-sm {
  background: #1e293b;
  color: var(--text-main);
  border: 1px solid var(--card-border);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}

.btn-copy-sm:hover {
  background: #334155;
}

/* Logs Table */
.logs-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.logs-count {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.table-wrapper {
  overflow-x: auto;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.logs-table th {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
}

.logs-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #1e293b;
  font-family: var(--font-mono);
}

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

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
}

.method-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.method-GET { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.method-POST { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.method-PUT { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.method-DELETE { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.status-badge-sm {
  font-weight: 700;
}

.status-2xx { color: var(--success); }
.status-3xx { color: var(--warning); }
.status-4xx { color: var(--warning); }
.status-5xx { color: var(--error); }
