/* ═══════════════════════════════════════════════════════════════
   LABAS P1 — Hint System + ER Diagram + Diff styles
   Extends labas-v1.css. Loaded via base layout.
   ═══════════════════════════════════════════════════════════════ */

/* ── Hint Ladder Panel (siswa) ──────────────────────────────── */
.hints-panel { padding: 0.5rem 0; }
.hints-panel ol { list-style: none; padding: 0; margin: 0; }

.hint-item { margin-bottom: 0.5rem; }

.hint-card {
  border: 1px solid var(--border);
  background: #f8fafc;
  transition: all 0.2s;
}
.hint-card[data-unlocked="true"] {
  background: #f0fdfa; /* teal-50 */
  border-color: #99f6e4; /* teal-200 */
}
.hint-card[data-unlocked="false"] {
  background: #f1f5f9; /* slate-100 */
  border-color: #e2e8f0;
  opacity: 0.85;
}

.hint-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  user-select: none;
}
.hint-summary::-webkit-details-marker { display: none; }
.hint-card[data-unlocked="true"] .hint-summary { color: #0f766e; }

.hint-level-badge {
  background: #0d9488;
  color: white;
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  margin-right: 0.5rem;
}
.hint-card[data-unlocked="false"] .hint-level-badge {
  background: #94a3b8; /* slate-400 */
}

.hint-status {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hint-card[data-unlocked="true"] .hint-status::before {
  content: "🔓 Terbuka";
  color: #0d9488;
  font-weight: 700;
}
.hint-card[data-unlocked="false"] .hint-status::before {
  content: "🔒 Terkunci";
  color: #94a3b8;
}

.hint-content {
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.hint-feedback-btn {
  font-size: 0.7rem !important;
  padding: 0.25rem 0.65rem !important;
}
.hint-feedback-btn:hover { opacity: 0.85; }

.hint-voted {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #16a34a;
  font-weight: 600;
}

/* ── History Panel (siswa) ─────────────────────────────────── */
.history-panel { padding: 0.5rem 0; }
.history-panel ol { list-style: none; padding: 0; margin: 0; }

.history-item pre { font-family: 'Courier New', monospace; max-height: 120px; overflow-y: auto; }

.history-status { font-size: 0.65rem; }

/* ── Diff Viewer ───────────────────────────────────────────── */
#diff-viewer { animation: slideDown 0.2s ease-out; }
.diff-line {
  display: block;
  padding: 0.1rem 0.4rem;
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.diff-line[data-op="add"]    { background: #d1fae5; color: #065f46; }
.diff-line[data-op="remove"] { background: #fee2e2; color: #991b1b; text-decoration: line-through; }
.diff-line[data-op="equal"]  { color: #334155; }
.diff-line[data-op="add"]::before    { content: "+ "; color: #047857; font-weight: 700; }
.diff-line[data-op="remove"]::before { content: "- "; color: #be123c; font-weight: 700; }
.diff-line[data-op="equal"]::before  { content: "  "; }

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

/* ── ER Diagram Panel ──────────────────────────────────────── */
.er-panel { padding: 0.5rem 0; }
.er-panel .mermaid {
  background: white;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  font-family: 'Trebuchet MS', sans-serif;
  text-align: center;
  overflow-x: auto;
}

.er-status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  border-radius: 9999px;
  font-weight: 700;
}
.er-status-badge.ok    { background: #dcfce7; color: #166534; }
.er-status-badge.warn  { background: #fef3c7; color: #92400e; }
.er-status-badge.error { background: #fee2e2; color: #991b1b; }

/* ── Teacher Hint Form ─────────────────────────────────────── */
.hint-form-panel { padding: 0.5rem 0; }
.hint-edit-item textarea { font-family: 'Courier New', monospace; line-height: 1.4; resize: vertical; }

/* ── Teacher Hint Analytics ────────────────────────────────── */
.hint-analytics table { font-size: 0.85rem; }
.hint-analytics th { font-weight: 700; }
.hint-analytics td { padding: 0.5rem 0.25rem; }

/* ── Admin Catalog + Coverage ──────────────────────────────── */
#catalog-tbody tr:hover, #coverage-tbody tr:hover { background: #f8fafc; }
.badge-v1 { font-size: 0.65rem; }

/* ── Tab integration (console.html) ────────────────────────── */
.p1-tab-btn { font-size: 0.7rem; padding: 0.4rem 0.7rem; }
.p1-tab-btn i { margin-right: 0.3rem; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hint-card { padding: 0.75rem !important; }
  .hint-content { font-size: 0.8rem; }
}
