/* === Mini interactive demo inside the browser frame === */
.demo-app {
  display: flex;
  height: 420px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 11px;
  color: #2d2a26;
  background: #faf7f2;
  overflow: hidden;
  user-select: none;
}

/* Sidebar */
.demo-sidebar {
  width: 150px;
  background: #fff;
  border-right: 1px solid #e2ddd5;
  padding: 8px 0;
  flex-shrink: 0;
  overflow-y: auto;
}
.demo-search input {
  width: calc(100% - 16px);
  margin: 4px 8px 8px;
  padding: 5px 8px;
  border: 1px solid #e2ddd5;
  border-radius: 4px;
  font-size: 10px;
  font-family: inherit;
  background: #faf7f2;
  outline: none;
}
.demo-nav-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 4px 10px 2px;
  font-weight: 600;
}
.demo-nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 5px 10px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 11px;
  color: #2d2a26;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.demo-nav-item:hover { background: #faf7f2; }
.demo-nav-item.active {
  background: #e6f2f2;
  color: #1e5f5f;
  font-weight: 600;
  border-left: 2px solid #2a7d7d;
}
.demo-nav-item span {
  font-size: 9px;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 8px;
  color: #64748b;
  font-weight: 600;
}
.demo-nav-item.active span { background: #2a7d7d; color: #fff; }

/* Main */
.demo-main {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  min-width: 0;
}

/* Spreadsheet */
.demo-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e2ddd5;
}
.demo-table th {
  background: #f5f1eb;
  padding: 6px 8px;
  text-align: left;
  font-size: 9px;
  font-weight: 700;
  color: #334155;
  border-bottom: 1px solid #e2ddd5;
}
.demo-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 10.5px;
  cursor: pointer;
  transition: background 0.1s;
}
.demo-table tr:hover td { background: #f0f9f9; }
.demo-table tr.active td { background: #e6f2f2; }
.demo-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 600;
}
.demo-badge-diagnosed { background: #dbeafe; color: #1e40af; }
.demo-badge-imputed { background: #fef3c7; color: #92400e; }
.demo-badge-qdtp { background: #dcfce7; color: #166534; }
.demo-badge-supp { background: #fef3c7; color: #92400e; }
.demo-badge-sub { background: #fee2e2; color: #991b1b; }
.demo-readiness {
  display: flex;
  align-items: center;
  gap: 4px;
}
.demo-readiness-bar {
  width: 36px;
  height: 5px;
  background: #e2ddd5;
  border-radius: 3px;
  overflow: hidden;
}
.demo-readiness-fill { height: 100%; border-radius: 3px; }

/* Detail panel */
.demo-detail {
  margin-top: 10px;
  background: #fff;
  border: 1px solid #e2ddd5;
  border-radius: 6px;
  overflow: hidden;
  animation: demo-slide-up 0.3s ease;
}
@keyframes demo-slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.demo-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e2ddd5;
  background: #faf7f2;
}
.demo-back {
  background: #2a7d7d;
  color: #fff;
  border: none;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.demo-student-name { font-weight: 700; font-size: 12px; color: #1e293b; }
.demo-badges { display: flex; gap: 4px; margin-left: auto; }

/* Tabs */
.demo-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e2ddd5;
  background: #fff;
}
.demo-tab {
  padding: 6px 10px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 10px;
  color: #64748b;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s;
}
.demo-tab:hover { color: #2a7d7d; }
.demo-tab.active { color: #2a7d7d; border-bottom-color: #2a7d7d; font-weight: 700; }

/* Tab content */
.demo-tab-content {
  padding: 10px 12px;
  font-size: 10.5px;
  line-height: 1.5;
  color: #475569;
  min-height: 140px;
  animation: demo-fade 0.2s ease;
}
@keyframes demo-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.demo-fact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.demo-fact {
  background: #faf7f2;
  padding: 6px 8px;
  border-radius: 4px;
  border-left: 2px solid #2a7d7d;
}
.demo-fact-label { font-size: 8px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.demo-fact-value { font-weight: 700; color: #1e293b; font-size: 11px; }
.demo-note {
  padding: 6px 8px;
  margin-bottom: 6px;
  background: #faf7f2;
  border-radius: 4px;
  border-left: 2px solid #e2ddd5;
}
.demo-note-header {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #94a3b8;
  margin-bottom: 2px;
}
.demo-note-header strong { color: #1e293b; }
.demo-tracker-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}
.demo-tracker-label { flex: 1; font-size: 10px; }
.demo-tracker-cell {
  width: 28px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-weight: 700;
  font-size: 10px;
  color: #1e293b;
}
.demo-readiness-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: linear-gradient(135deg, rgba(22,163,74,0.06), rgba(22,163,74,0.02));
  border-left: 3px solid #16a34a;
  border-radius: 6px;
  margin-bottom: 10px;
}
.demo-readiness-score { font-size: 20px; font-weight: 800; color: #16a34a; }
.demo-readiness-text { font-size: 10px; color: #475569; }

/* Fake cursor */
.demo-cursor {
  position: absolute;
  top: 50%;
  left: 30%;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.demo-cursor.clicking { transform: scale(0.85); }

/* Generate report button */
.demo-report-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 12px;
  background: #2a7d7d;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.demo-report-btn:hover { background: #1e5f5f; }
.demo-report-btn:disabled { opacity: 0.6; cursor: wait; }

/* Fake PDF report — slides out from below the browser frame like a printed page */
.demo-report {
  position: relative;
  z-index: 10;
  margin: 24px auto 0;
  max-width: 420px;
  transform-origin: top center;
  animation: demo-report-emerge 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes demo-report-emerge {
  0%   { opacity: 0; transform: translateY(-40px) scale(0.9) rotateX(8deg); }
  40%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1) rotateX(0deg); }
}
.demo-report-page {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 20px 22px;
  box-shadow:
    0 8px 30px rgba(30,41,59,0.12),
    0 2px 6px rgba(30,41,59,0.06),
    4px 4px 0 rgba(226,221,213,0.4),
    8px 8px 0 rgba(226,221,213,0.2);
  position: relative;
}
/* Little PDF icon tab at the top */
.demo-report-page::before {
  content: '📄 PDF';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: #dc2626;
  color: white;
  font-size: 8px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px 4px 0 0;
  letter-spacing: 0.04em;
}
.demo-report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 2px solid #2a7d7d;
  margin-bottom: 10px;
}
.demo-report-section {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.demo-report-section:last-of-type { border-bottom: none; }
.demo-report-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #2a7d7d;
  margin-bottom: 4px;
}
.demo-report-footer {
  display: flex;
  justify-content: space-between;
  font-size: 7px;
  color: #94a3b8;
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px solid #e2ddd5;
}

/* Dismiss button */
.demo-report-dismiss {
  position: absolute;
  top: -12px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: white;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: background 0.15s, color 0.15s;
  z-index: 20;
}
.demo-report-dismiss:hover { background: #fee2e2; color: #dc2626; }

/* === Responsive — demo inside browser frame === */
@media (max-width: 640px) {
  .demo-app { height: 360px; font-size: 10px; }
  .demo-sidebar { display: none; }
  .demo-main { padding: 6px; }
  .demo-table th,
  .demo-table td { padding: 5px 6px; font-size: 9.5px; }
  /* Hide Readiness column on small screens */
  .demo-table th:last-child,
  .demo-table td:last-child { display: none; }
  .demo-detail-header { padding: 6px 8px; gap: 6px; flex-wrap: wrap; }
  .demo-student-name { font-size: 11px; }
  .demo-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .demo-tab { padding: 5px 8px; font-size: 9px; white-space: nowrap; }
  .demo-tab-content { padding: 8px; min-height: 100px; font-size: 9.5px; }
  .demo-fact-grid { grid-template-columns: 1fr 1fr; gap: 4px; }
  .demo-fact { padding: 4px 6px; }
  .demo-fact-label { font-size: 7px; }
  .demo-fact-value { font-size: 10px; }
  .demo-tracker-cell { width: 24px; height: 18px; font-size: 9px; }
  .demo-report { max-width: 300px; margin-top: 16px; }
  .demo-report-page { padding: 14px 16px; }
}

/* Container needs position:relative for the cursor */
#miniDemo { position: relative; overflow: hidden; }
