/* ==========================================================================
   SLIME SMP - COMPONENTS STYLESHEET
   Clean Modern Minecraft Web Panel Layout (Version 1 structure, No Emojis)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Header Server Banner
   -------------------------------------------------------------------------- */
.header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

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

.server-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 16px var(--accent-green-glow);
}

.server-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.header-titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.server-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.version-pill {
  background: var(--accent-green-subtle);
  color: var(--text-green);
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.status-badge.online {
  background: var(--status-online-bg);
  color: var(--status-online);
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.status-badge.offline {
  background: var(--status-offline-bg);
  color: var(--status-offline);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.online .pulse-dot {
  box-shadow: 0 0 8px var(--status-online);
}

.server-subtext {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-ip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  transition: var(--transition);
}

.btn-ip:hover {
  background: var(--bg-elevated);
  border-color: var(--accent-green);
}

.ip-mono {
  font-family: var(--font-mono);
  color: var(--text-green);
  font-weight: 700;
}

.btn-action-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-action-icon:hover {
  color: #fff;
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-action-icon.active {
  color: var(--text-green);
  border-color: var(--accent-green);
}

/* --------------------------------------------------------------------------
   2. Overview Metric Cards Grid
   -------------------------------------------------------------------------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.metric-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-info {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.metric-value {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   3. Horizontal Navigation Bar & Tabs
   -------------------------------------------------------------------------- */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.nav-tabs-group {
  display: flex;
  gap: 6px;
  background: var(--bg-surface);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.nav-tab-btn:hover {
  color: #fff;
  background: var(--bg-elevated);
}

.nav-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-green);
  border: 1px solid var(--border-hover);
  box-shadow: 0 0 10px var(--accent-green-glow);
}

.tab-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--bg-body);
  color: #fff;
}

.nav-tab-btn.active .tab-badge {
  background: var(--accent-green-subtle);
  color: var(--text-green);
}

.refresh-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
}

.refresh-bar-track {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.refresh-bar-fill {
  height: 100%;
  background: var(--accent-green);
  width: 100%;
  transition: width 1s linear;
}

/* --------------------------------------------------------------------------
   4. Tab Views & Content Sections
   -------------------------------------------------------------------------- */
.tab-pane {
  display: none;
  animation: tabFadeIn 0.25s ease-out;
}

.tab-pane.active {
  display: block;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card Wrapper */
.content-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

/* Online Players Grid */
.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.player-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--accent-green-glow);
}

.player-avatar-wrap {
  position: relative;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.player-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  image-rendering: pixelated;
}

.avatar-online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--status-online);
  border: 2px solid var(--bg-card);
}

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

.player-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-time {
  font-size: 0.8rem;
  color: var(--text-green);
  font-family: var(--font-mono);
}

.player-uuid-dim {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* History Table */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: #fff;
  font-size: 0.9rem;
  min-width: 280px;
  flex: 1;
  max-width: 420px;
}

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

.sort-select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: #fff;
  padding: 9px 12px;
  font-size: 0.88rem;
  cursor: pointer;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--bg-card);
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  background: var(--bg-surface);
}

.data-table tr {
  cursor: pointer;
  transition: var(--transition);
}

.data-table tr:hover td {
  background: var(--bg-card);
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.rank-1 { background: #ffd700; color: #000; font-weight: 800; }
.rank-2 { background: #e0e0e0; color: #000; font-weight: 800; }
.rank-3 { background: #cd7f32; color: #fff; font-weight: 800; }

/* Timeline Event Stream */
.timeline-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: var(--transition);
}

.timeline-row:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.timeline-meta-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.timeline-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  image-rendering: pixelated;
}

.timeline-title-text {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.timeline-desc-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-time-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.event-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.event-tag.join {
  background: var(--status-online-bg);
  color: var(--status-online);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.event-tag.leave {
  background: var(--status-offline-bg);
  color: var(--status-offline);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Chart */
.chart-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-btn-group {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.chart-btn {
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.chart-btn:hover { color: #fff; }
.chart-btn.active {
  background: var(--accent-green);
  color: #000;
}

.chart-canvas-box {
  position: relative;
  width: 100%;
  height: 340px;
}

/* --------------------------------------------------------------------------
   5. Modals & Toasts
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.modal-close-btn {
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close-btn:hover { color: #fff; }

.modal-profile-header {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.modal-skin-wrap {
  width: 80px;
  height: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-skin-img {
  height: 105px;
  image-rendering: pixelated;
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.modal-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.modal-stat-title {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.modal-stat-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

/* Toast Notifications */
.toast-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastSlide 0.2s ease-out;
}

@keyframes toastSlide {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 16px 12px 60px;
    gap: 18px;
  }

  .header-card {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .btn-ip {
    flex: 1;
    justify-content: center;
  }

  .nav-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-tabs-group {
    overflow-x: auto;
  }

  .nav-tab-btn {
    flex: 1;
    justify-content: center;
    white-space: nowrap;
  }

  .modal-stats-grid {
    grid-template-columns: 1fr;
  }
}
