/**
 * ============================================================================
 * DASHBOARD.CSS - Antarmuka Dashboard Guru, Bank Soal, Materi, & Kontrol Room
 * ============================================================================
 */

.dashboard-container {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f7ff 0%, #e0f2fe 40%, #f8fafc 100%);
}

/* Sidebar Navigasi Guru */
.dash-sidebar {
  width: 270px;
  background: #ffffff;
  border-right: 2px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 24px;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 20px;
}

.dash-brand-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  font-size: 1.6rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.dash-brand-text h2 {
  font-size: 1.25rem;
  color: #0f172a;
}

.dash-brand-text span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #0284c7;
  text-transform: uppercase;
}

.dash-nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.dash-nav-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.dash-nav-btn:hover {
  background: #f1f5f9;
  color: #0284c7;
}

.dash-nav-btn.active {
  background: #e0f2fe;
  color: #0369a1;
  border-left: 4px solid #0284c7;
}

.dash-nav-btn.nav-logout {
  color: #ef4444;
  margin-top: auto;
}

.dash-nav-btn.nav-logout:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Area Konten Utama */
.dash-main-content {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
  max-height: 100vh;
}

.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.dash-topbar h1 {
  font-size: 2rem;
  color: #0f172a;
}

.dash-user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
}

.dash-avatar {
  font-size: 1.4rem;
}

/* Tampilan View Konten */
.dash-view {
  display: none;
}

.dash-view.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

/* Kartu Statistik Overview */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 2px solid #e2e8f0;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 18px;
  transition: transform var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.icon-blue { background: #e0f2fe; color: #0284c7; }
.icon-orange { background: #ffedd5; color: #ea580c; }
.icon-purple { background: #ede9fe; color: #7c3aed; }
.icon-green { background: #dcfce7; color: #16a34a; }
.icon-pink { background: #fce7f3; color: #db2777; }

.stat-details h4 {
  font-size: 0.9rem;
  color: #64748b;
  font-family: var(--font-body);
  font-weight: 500;
}

.stat-details .stat-number {
  font-size: 1.8rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: #0f172a;
}

/* Tabel Data Global */
.table-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 12px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background: #f1f5f9;
  padding: 14px 18px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
  border-bottom: 2px solid #e2e8f0;
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.92rem;
  vertical-align: middle;
}

.custom-table tr:hover {
  background: #f8fafc;
}

.table-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.q-text-preview {
  max-width: 280px;
  font-weight: 500;
  color: #1e293b;
}

.q-options-mini {
  font-size: 0.82rem;
  color: #64748b;
  max-width: 300px;
}

/* Form Styles */
.form-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 2px solid #e2e8f0;
  padding: 32px;
  max-width: 820px;
  box-shadow: var(--shadow-sm);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 14px;
}

.img-preview-box {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius-sm);
  display: block;
  object-fit: contain;
}

/* ======================================================== */
/* UPLOAD FOTO SOAL & PREVIEW DI DASHBOARD GURU             */
/* ======================================================== */
.image-upload-dropzone {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 2px dashed #94a3b8;
  border-radius: var(--radius-md);
  background: #f8fafc;
  padding: 22px 20px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.image-upload-dropzone:hover {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateY(-1px);
}

.image-upload-dropzone.dragover {
  border-color: #0ea5e9;
  background: #e0f2fe;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dropzone-icon {
  font-size: 2.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropzone-main-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
}

.btn-link-action {
  background: none;
  border: none;
  color: #0284c7;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
  text-decoration: underline;
  display: inline;
}

.btn-link-action:hover {
  color: #0369a1;
}

.dropzone-sub-text {
  font-size: 0.8rem;
  color: #64748b;
}

/* Card Pratinjau Foto */
.image-preview-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s ease;
}

.preview-img-wrapper {
  width: 130px;
  height: 90px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.preview-info-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-badge-status {
  font-size: 0.82rem;
  font-weight: 700;
  color: #15803d;
  display: flex;
  align-items: center;
  gap: 4px;
}

.preview-meta-text {
  font-size: 0.8rem;
  color: #475569;
  word-break: break-all;
}

.preview-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.btn-toggle-link {
  background: none;
  border: none;
  color: #0284c7;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.btn-toggle-link:hover {
  color: #0369a1;
  text-decoration: underline;
}

/* Room Control Live Panel */
.room-control-hero {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.room-code-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 24px;
  border-radius: var(--radius-md);
  border: 2px dashed rgba(255, 255, 255, 0.6);
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 2px;
}

.room-live-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dash-player-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.dash-player-item .player-avatar {
  font-size: 1.5rem;
}

/* Responsive Dashboard */
@media (max-width: 900px) {
  .dashboard-container { flex-direction: column; }
  .dash-sidebar { width: 100%; border-right: none; border-bottom: 2px solid #e2e8f0; }
  .form-grid-2, .form-grid-4 { grid-template-columns: 1fr; }
}

/* Tab Switcher Live Room */
.dash-game-tabs button {
  transition: all 0.2s ease;
  cursor: pointer;
}

.dash-game-tabs button:hover {
  transform: translateY(-1px);
}

.dash-game-tabs button.active-tab {
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

/* Tarik Tambang Mini Track Visual */
.dash-tarik-mini-track {
  user-select: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

#dash-tarik-mini-knot {
  will-change: left;
}

