/* ── Server detail page CSS ── */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.15s;
}
.back-btn:hover { color: var(--text); background: var(--surface-hover); border-color: var(--border-strong); }
.back-btn svg { width: 14px; height: 14px; stroke: currentColor; }

.page-loading {
  text-align: center;
  padding: 120px 20px;
  color: var(--text-muted);
}
.page-loading .spinner {
  width: 32px; height: 32px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

/* ── Hero ── */
.server-hero {
  background: linear-gradient(135deg, #1b4332 0%, #2d6a4f 60%, #40916c 100%);
  padding: 40px 0 36px;
  position: relative;
  overflow: hidden;
}
.server-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 80% 50%, rgba(64,145,108,0.35) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 10% 80%, rgba(27,67,50,0.5) 0%, transparent 60%);
  pointer-events: none;
}
.server-hero-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  position: relative;
}
.server-hero-left {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex: 1;
  min-width: 260px;
}
.server-hero-icon {
  width: 72px; height: 72px;
  border-radius: 16px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.server-hero-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-hero-icon span { font-size: 32px; }
.server-hero-name-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap;
}
.server-hero-name-row h1 {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700; letter-spacing: -0.4px; color: #fff;
  margin: 0;
}
.server-hero-ip {
  font-family: var(--mono); font-size: 13px;
  color: rgba(255,255,255,0.6); margin-bottom: 8px;
}
.server-hero-desc {
  font-size: 14px; color: rgba(255,255,255,0.65); line-height: 1.5;
}
.server-hero-right {
  display: flex; gap: 0; flex-shrink: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  overflow: hidden;
}
.hero-stat-block {
  display: flex; flex-direction: column; gap: 4px;
  text-align: center;
  padding: 18px 24px;
  border-right: 1px solid rgba(255,255,255,0.12);
}
.hero-stat-block:last-child { border-right: none; }
.hero-stat-value {
  font-size: 28px; font-weight: 700;
  font-family: var(--mono); color: #fff;
  letter-spacing: -0.5px;
  line-height: 1;
}
.hero-stat-label {
  font-size: 10px; color: rgba(255,255,255,0.6);
  text-transform: uppercase; letter-spacing: 0.8px;
  font-weight: 600; white-space: nowrap;
  margin-top: 2px;
}
.server-hero .status-badge.online {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}
.server-hero .status-badge.offline {
  background: rgba(220,53,69,0.35);
  color: #fff;
  border: 1px solid rgba(220,53,69,0.4);
}

/* ── Time Tabs ── */
.time-tabs {
  display: flex; gap: 4px;
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
  position: relative;
}
.time-tab {
  padding: 7px 18px;
  font-size: 13px; font-weight: 500;
  font-family: var(--sans);
  border: none; background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.15s;
  position: relative; z-index: 1;
}
.time-tab:hover { color: var(--text); }
.time-tab.active { color: var(--text); font-weight: 600; }
.tab-bg {
  position: absolute; top: 4px; height: calc(100% - 8px);
  background: var(--bg); border-radius: 7px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: left 0.22s cubic-bezier(.4,0,.2,1), width 0.22s cubic-bezier(.4,0,.2,1);
  z-index: 0;
}

/* live badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--online);
  background: var(--online-bg);
  border: 1px solid rgba(45,157,94,0.2);
  padding: 4px 10px;
  border-radius: 20px;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--online);
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}
.chart-header-right { display: flex; align-items: center; gap: 10px; }
.chart-countdown {
  font-size: 11px; font-family: var(--mono);
  color: var(--text-muted); opacity: 0.7;
}

/* ── Chart card ── */
.chart-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.chart-card-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.chart-card-title {
  font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 2px;
}
.chart-card-subtitle { font-size: 12px; color: var(--text-muted); }
.chart-legend {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
}
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-dot.online { background: var(--online); }

.chart-area { position: relative; height: 260px; overflow: visible; }
.chart-area canvas { width: 100% !important; height: 100% !important; cursor: crosshair; }
.chart-no-data {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; color: var(--text-muted);
}
.chart-no-data svg { width: 32px; height: 32px; stroke: var(--text-light); }
.chart-no-data p { font-size: 13px; }

.chart-tip {
  position: absolute;
  bottom: calc(100% + 10px);
  background: #1a2030;
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 10px;
  padding: 9px 13px;
  pointer-events: none;
  z-index: 20;
  display: none;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25), 0 0 0 1px rgba(74,222,128,0.1);
  backdrop-filter: blur(8px);
}
.chart-tip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a2030;
}
.ct-time {
  font-size: 10px;
  color: #7a8fa6;
  font-family: var(--mono);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}
.ct-val {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--mono);
  color: #4ade80;
  letter-spacing: -0.3px;
}

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 20px;
}
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  animation: cardIn 0.4s ease both;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.stat-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-2px); }
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 3px; height: 100%;
  border-radius: 3px 0 0 3px;
  opacity: 0; transition: opacity 0.2s;
}
.stat-card:hover::before { opacity: 1; }
.stat-card:nth-child(1)::before { background: var(--online); }
.stat-card:nth-child(2)::before { background: #1a73e8; }
.stat-card:nth-child(3)::before { background: #e67e22; }
.stat-card:nth-child(4)::before { background: #8b5cf6; }

.stat-card-top {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.stat-card-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card-icon svg { width: 18px; height: 18px; }
.stat-card-icon.green { background: var(--online-bg); }
.stat-card-icon.green svg { stroke: var(--online); }
.stat-card-icon.blue { background: #e8f0fe; }
.stat-card-icon.blue svg { stroke: #1a73e8; }
.stat-card-icon.orange { background: #fff4e6; }
.stat-card-icon.orange svg { stroke: #e67e22; }
.stat-card-icon.purple { background: #f3e8ff; }
.stat-card-icon.purple svg { stroke: #8b5cf6; }

.stat-card-change {
  font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 10px; font-family: var(--mono); flex-shrink: 0;
}
.stat-card-change.up { background: #f0faf5; color: #1a7f4b; }
.stat-card-change.down { background: #fff2f2; color: #c0392b; }

.stat-card-value {
  font-size: 26px; font-weight: 700;
  font-family: var(--mono); color: var(--text);
  line-height: 1; margin-bottom: 5px;
  letter-spacing: -0.8px;
}
.stat-card-value.updating { animation: valueFlash 0.35s ease; }
@keyframes valueFlash {
  0% { opacity: 0.3; transform: scale(0.94); }
  100% { opacity: 1; transform: scale(1); }
}
.stat-card-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  font-weight: 600; line-height: 1.3;
}
.stat-card-meta {
  font-size: 11px; color: var(--text-light);
  margin-top: 4px; font-family: var(--mono);
}

/* ── Hourly canvas ── */
.hourly-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.hourly-legend {
  display: flex; align-items: center; gap: 14px;
  margin-top: 12px;
  font-size: 11px; color: var(--text-muted);
  font-family: var(--mono);
}
.hourly-legend-dot {
  width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
}
.hourly-canvas-wrap {
  position: relative;
  height: 160px;
  margin-top: 10px;
  cursor: crosshair;
}
.hourly-canvas-wrap canvas { width: 100% !important; height: 100% !important; }
.hourly-tooltip-float {
  position: absolute;
  background: #1a2030;
  color: #e2e8f0;
  font-size: 11px; font-family: var(--mono);
  padding: 6px 11px; border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 10;
  transform: translateX(-50%);
  border: 1px solid rgba(74,222,128,0.2);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.hourly-tooltip-float.show { opacity: 1; }
.hourly-tooltip-float::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%; transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1a2030;
}

/* ── Info row ── */
.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px; margin-bottom: 32px;
}
@media (max-width: 720px) { .info-row { grid-template-columns: 1fr; } }

.info-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.info-card-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 14px;
}
.info-card-title svg { width: 13px; height: 13px; stroke: currentColor; }
.info-list { display: flex; flex-direction: column; }
.info-item {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.info-item:last-child { border-bottom: none; }
.info-item > span:first-child { color: var(--text-muted); flex-shrink: 0; }
.info-item > span:last-child { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--text); text-align: right; }

.motd-display-wrap { border-radius: 8px; overflow: hidden; margin-bottom: 4px; }
.motd-mc-server {
  font-family: var(--mono); font-size: 13px; line-height: 1.7;
  color: #AAAAAA; background: #111111;
  border: 1px solid #2a2a2a; border-radius: 8px;
  padding: 14px 16px; word-break: break-word;
}
.motd-no-data { font-size: 13px; color: var(--text-light); padding: 12px 0; }

.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.activity-dot.up { background: var(--online); }
.activity-dot.down { background: var(--offline); }
.activity-time { color: var(--text-muted); font-family: var(--mono); flex-shrink: 0; }
.activity-desc { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .server-hero-inner { flex-direction: column; }
  .server-hero-right { width: 100%; }
  .hero-stat-block { flex: 1; padding: 14px 16px; }
}
@media (max-width: 600px) {
  .server-hero-left { flex-direction: column; }
}

/* ── IP cell with copy button ── */
.info-ip-cell {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

.info-ip-text {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.info-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  padding: 0;
}
.info-copy-btn svg { width: 12px; height: 12px; stroke: currentColor; }
.info-copy-btn:hover { background: var(--accent-light); color: var(--accent); border-color: rgba(45,106,79,0.3); }
.info-copy-btn.copied { background: var(--online-bg); color: var(--online); border-color: rgba(45,157,94,0.3); }

.info-ip-domain {
  font-size: 10px;
  color: var(--text-light);
  font-family: var(--mono);
  margin-left: 2px;
}
