/* IJLAAS AI class summary (TC-IJLAAS-052): report page and lesson notes page.
   Uses the ijlaas-theme.css colour tokens (--ij-*). */

.ai-card {
  margin-bottom: 22px;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid #d8e3f2;
  background: linear-gradient(180deg, #f5f8fd 0%, var(--ij-surface, #fff) 140px);
  box-shadow: 0 10px 30px rgba(23, 31, 42, .05);
  animation: aiIn .45s ease-out both;
}
.ai-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ai-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px;
  background: linear-gradient(90deg, #3b6fa0, #6d5bd0); color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
}
.ai-badge i { animation: aiSpark 2.4s ease-in-out infinite; }
.ai-meta { color: var(--ij-muted-fg, #69717d); font-size: .82rem; }
.ai-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-tools .ij-btn, .ai-tools form .ij-btn { min-height: 38px; padding: 0 14px; font-size: .85rem; }
.ai-tools form { display: flex; gap: 6px; margin: 0; }
.ai-tools select { height: 38px; border-radius: 10px; border: 1px solid var(--ij-border, #dfe3e8); padding: 0 8px; background: #fff; }

.ai-overview { margin: 0 0 16px; font-size: 1.04rem; line-height: 1.6; }
.ai-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin-bottom: 14px; }
.ai-block {
  padding: 14px 16px; border-radius: 14px; background: var(--ij-surface, #fff);
  border: 1px solid var(--ij-border, #dfe3e8); animation: aiIn .45s ease-out both;
}
.ai-block + .ai-block { margin-top: 0; }
.ai-revision, .ai-questions, .ai-terms { margin-top: 14px; }
.ai-block h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .95rem; }
.ai-block h3 i { color: var(--ij-brand, #3b6fa0); }
.ai-block ul, .ai-block ol { margin: 0; padding-left: 20px; }
.ai-block li { margin: 0 0 7px; line-height: 1.5; }
.ai-takeaways li { animation: aiIn .4s ease-out both; }
.ai-takeaways li::marker { color: var(--ij-success, #22a06b); }

.ai-actions ul { list-style: none; padding: 0; }
.ai-actions li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; padding: 9px 10px; margin-bottom: 8px;
  border-radius: 10px; background: #fffaf0; border: 1px solid #f6e3b8;
}
.ai-chip { padding: 1px 9px; border-radius: 999px; background: #fde68a; color: #7c4a03; font-size: .75rem; font-weight: 700; }
.ai-task { flex: 1 1 200px; }
.ai-due { color: #b45309; font-size: .82rem; font-weight: 600; white-space: nowrap; }

.ai-topic { border-top: 1px solid var(--ij-border, #dfe3e8); padding: 8px 0; }
.ai-topic:first-of-type { border-top: 0; }
.ai-topic summary, .ai-questions summary { cursor: pointer; font-weight: 600; list-style: none; }
.ai-topic summary::-webkit-details-marker, .ai-questions summary::-webkit-details-marker { display: none; }
.ai-topic summary::before { content: "\25B8"; display: inline-block; margin-right: 8px; color: var(--ij-brand, #3b6fa0); transition: transform .2s ease; }
.ai-topic[open] summary::before { transform: rotate(90deg); }
.ai-topic ul { margin-top: 8px; }
.ai-questions li { margin-bottom: 10px; }
.ai-questions summary { font-weight: 500; }
.ai-reveal { margin-left: 8px; color: var(--ij-brand, #3b6fa0); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.ai-questions details[open] .ai-reveal { display: none; }
.ai-questions details p { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: #ecfdf5; animation: aiIn .25s ease-out both; }
.ai-terms dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 0; }
.ai-terms dl div { padding: 10px 12px; border-radius: 10px; background: var(--ij-muted, #eef0f3); }
.ai-terms dt { font-weight: 700; }
.ai-terms dd { margin: 2px 0 0; color: var(--ij-muted-fg, #69717d); font-size: .9rem; }

/* Writing / empty / failed states */
.ai-state { display: flex; align-items: center; gap: 14px; padding: 6px 2px; color: var(--ij-muted-fg, #69717d); }
.ai-state strong { display: block; color: var(--ij-fg, #20242b); }
.ai-state i { font-size: 1.4rem; color: var(--ij-brand, #3b6fa0); }
.ai-shimmer { display: grid; gap: 10px; margin-top: 14px; }
.ai-shimmer span {
  height: 12px; border-radius: 6px;
  background: linear-gradient(90deg, #e8edf4 0%, #f6f8fb 50%, #e8edf4 100%); background-size: 200% 100%;
  animation: aiShimmer 1.3s linear infinite;
}
.ai-shimmer span:nth-child(2) { width: 85%; }
.ai-shimmer span:nth-child(3) { width: 65%; }

@keyframes aiIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes aiShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes aiSpark { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.2) rotate(12deg); } }

@media (max-width: 760px) {
  .ai-card { padding: 16px 14px; border-radius: 16px; }
  .ai-grid { grid-template-columns: 1fr; }
  .ai-tools { width: 100%; }
  .ai-tools > .ij-btn, .ai-tools form { flex: 1 1 100%; }
  .ai-tools form select { flex: 1; }
  .ai-terms dl { grid-template-columns: 1fr; }
}

@media print {
  .ai-tools, .ai-reveal { display: none !important; }
  .ai-card, .ai-block, .ai-takeaways li, .ai-questions details p { animation: none !important; box-shadow: none !important; }
  .ai-card { background: #fff; border-color: #ccc; }
  .ai-grid { grid-template-columns: 1fr 1fr; }
  .ai-topic, .ai-questions details { break-inside: avoid; }
}
