/* ==========================================================================
   Server Dashboard Control Panel Styles
   ========================================================================== */

.admin-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(22, 17, 34, 0.6);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(138, 79, 255, 0.15);
  border-radius: 24px;
  padding: 24px;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.admin-header {
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

.admin-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(120deg, #a78bfa, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Stats metrics rows */
.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 79, 255, 0.2);
}

.stat-card .val {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #c084fc;
}

.stat-card .lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Dashboard view switching tabs */
.admin-tabs-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 10px;
}

.admin-tabs-row button {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.admin-tabs-row button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.admin-tabs-row button.admin-tabactive {
  color: #ffffff;
  background: rgba(138, 79, 255, 0.15);
  border: 1px solid rgba(138, 79, 255, 0.3);
}

/* Tab Display Areas */
.admin-tab-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-db-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-container {
  flex: 1;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

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

thead {
  background: #110d1b;
  position: sticky;
  top: 0;
  z-index: 2;
}

th {
  padding: 12px 16px;
  color: #cbd5e1;
  font-weight: 600;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.08);
}

td {
  padding: 12px 16px;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

/* Console Logger UI */
.logs-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}

#clearLogsBtn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

#clearLogsBtn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.logs-console {
  flex: 1;
  background: #09060f;
  border: 1px solid rgba(138, 79, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-y: auto;
}

.log-line {
  margin-bottom: 6px;
  word-break: break-all;
}

.log-line.info { color: #38bdf8; }
.log-line.post { color: #f472b6; }
.log-line.get { color: #34d399; }
.log-line.error { color: #f87171; }
.log-line.success { color: #a78bfa; }

/* Coach Link Button styles */
.coach-link-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  color: #ffffff;
  text-decoration: none;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  transition: all 0.2s ease;
}

.coach-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
  background: linear-gradient(135deg, #c084fc, #a78bfa);
}

.coach-link-btn:active {
  transform: translateY(0);
}

/* Hide coach link button when student dashboard is shown */
.admin-panel:has(#studentDashboardView:not([style*="display: none"])) #webCoachLinkBtn {
  display: none !important;
}

