/* css/additions.css — New feature styles on top of style.css */

/* ================================================================
   SKELETON LOADER
   ================================================================ */
.skeleton-block {
  height: 60px; background: var(--surface2); border-radius: 10px;
  margin-bottom: 14px;
  animation: shimmer 1.5s infinite linear;
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
}
.skeleton-block.short { height: 32px; width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ================================================================
   HOME PAGE
   ================================================================ */
.home-scroll { flex: 1; overflow-y: auto; }
.home-wrap { max-width: 820px; padding: 0 20px 40px; }

.home-header {
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.home-greeting-line { font-size: 0.85rem; font-weight: 600; color: var(--text-3); margin-bottom: 4px; }
.home-ws-title { font-size: 1.6rem; font-weight: 900; color: var(--text); letter-spacing: -0.03em; line-height: 1.2; }
.home-ws-meta { font-size: 0.78rem; color: var(--text-3); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.home-ws-meta i { font-size: 13px; }

.home-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.home-stat-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.hsc-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin: 0 auto 8px;
}
.hsc-num { font-size: 1.4rem; font-weight: 900; color: var(--text); letter-spacing: -0.03em; }
.hsc-lbl { font-size: 0.7rem; color: var(--text-3); font-weight: 600; margin-top: 2px; }

.home-section { margin-bottom: 24px; }
.home-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0px; }
.home-section-title { font-size: 0.88rem; font-weight: 700; margin-bottom: 12px; color: var(--text); display: flex; align-items: center; gap: 6px; }
.home-section-title i { font-size: 15px; color: var(--text-3); }
.home-see-all {
  font-size: 0.78rem; font-weight: 700; color: var(--accent);
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 2px;
  transition: opacity 0.15s;
}
.home-see-all:hover { opacity: 0.7; }
.home-see-all i { font-size: 14px; }

.home-see-all-block {
  width: 100%; padding: 10px;
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem; font-weight: 700; color: var(--text-2);
  cursor: pointer; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.15s;
}
.home-see-all-block:hover { background: var(--accent-muted); color: var(--accent); border-color: var(--accent-muted2); }

.home-files-row { display: flex; gap: 8px; flex-wrap: wrap; }
.home-file-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--fb, var(--surface));
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.76rem; font-weight: 600;
  color: var(--fc, var(--text-2));
  cursor: pointer; transition: all 0.15s;
}
.home-file-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.home-file-chip i { font-size: 14px; }
.home-file-chip.add-chip { border-style: dashed; color: var(--text-3); background: none; }
.home-file-chip.add-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-muted); }

.home-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.home-action-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: var(--shadow-sm);
}
.home-action-btn:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hab-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; margin-bottom: 10px;
}
.hab-label { font-size: 0.84rem; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.hab-sub { font-size: 0.72rem; color: var(--text-3); font-weight: 500; }

.home-item-list { display: flex; flex-direction: column; gap: 8px; }
.home-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.home-list-item:hover { border-color: var(--accent); background: var(--accent-muted); }
.hli-badge {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 900; flex-shrink: 0;
}
.hli-badge.badge-good { background: var(--success-bg); color: var(--success); }
.hli-badge.badge-ok { background: var(--warning-bg); color: var(--warning); }
.hli-badge.badge-bad { background: var(--danger-bg); color: var(--danger); }
.hli-info { flex: 1; min-width: 0; }
.hli-title { font-size: 0.85rem; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hli-meta { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }
.hli-right { font-size: 0.85rem; font-weight: 800; color: var(--text-2); flex-shrink: 0; }

.home-ws-list { display: flex; flex-direction: column; gap: 8px; }
.home-ws-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.home-ws-item:hover { border-color: var(--accent); }
.hwi-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-muted); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.hwi-info { flex: 1; }
.hwi-name { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.hwi-meta { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }

.home-empty-start {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 60px 20px;
}
.he-icon {
  width: 72px; height: 72px;
  background: var(--accent-muted); border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--accent); margin-bottom: 20px;
}
.he-title { font-size: 1.2rem; font-weight: 900; color: var(--text); margin-bottom: 8px; }
.he-sub { font-size: 0.85rem; color: var(--text-2); max-width: 340px; line-height: 1.7; margin-bottom: 24px; }

/* ================================================================
   WORKSPACES FULL PAGE
   ================================================================ */
.ws-full-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 14px; }
.ws-full-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s;
}
.ws-full-card:hover { box-shadow: var(--shadow-md); }
.ws-full-card.active { border-color: var(--accent); }
.wsfc-head { display: flex; align-items: center; gap: 12px; padding: 18px; cursor: pointer; }
.wsfc-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-muted); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0;
}
.ws-full-card.active .wsfc-icon { background: var(--accent); color: #fff; }
.wsfc-info { flex: 1; }
.wsfc-name { font-size: 0.92rem; font-weight: 800; color: var(--text); }
.wsfc-meta { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }
.wsfc-active-badge {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--accent); color: #fff; padding: 3px 8px; border-radius: 5px;
}
.wsfc-files {
  padding: 0 18px 14px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.wsfc-file-tag {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px;
  font-size: 0.72rem; font-weight: 600;
}
.wsfc-actions {
  display: flex; gap: 6px; padding: 12px 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ================================================================
   FLASHCARD SETS LIST
   ================================================================ */
.fc-set-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s;
}
.fc-set-card:hover { border-color: var(--accent); }
.fc-set-card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
}
.fc-set-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--accent-muted); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.fc-set-info { flex: 1; }
.fc-set-label { font-size: 0.88rem; font-weight: 800; color: var(--text); }
.fc-set-meta { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }
.fc-set-del {
  width: 28px; height: 28px; border-radius: 7px;
  background: none; border: 1px solid var(--border);
  color: var(--text-3); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.fc-set-del:hover { background: var(--danger-bg); border-color: #fecaca; color: var(--danger); }
.fc-set-preview { padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; }
.fc-set-preview-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fc-prev-q { font-size: 0.8rem; color: var(--text-2); line-height: 1.5; flex: 1; }
.fc-prev-tag { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; flex-shrink: 0; }
.fc-set-actions {
  display: flex; gap: 8px; padding: 12px 18px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* Expand modal cards */
.fc-expand-card {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 0; border-bottom: 1px solid var(--border-light);
}
.fc-expand-card:last-child { border-bottom: none; }
.fc-ec-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-muted); color: var(--accent);
  font-size: 0.72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fc-ec-body { flex: 1; }
.fc-ec-q { font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.fc-ec-a { font-size: 0.82rem; color: var(--text-2); line-height: 1.55; }
.fc-ec-hint { font-size: 0.76rem; color: var(--text-3); margin-top: 5px; font-style: italic; }

/* ================================================================
   QUIZ HISTORY
   ================================================================ */
.quiz-history-list { display: flex; flex-direction: column; gap: 10px; }
.qh-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.qh-item:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.qh-grade {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 900; flex-shrink: 0;
}
.qh-grade.grade-good { background: var(--success-bg); color: var(--success); }
.qh-grade.grade-ok { background: var(--warning-bg); color: var(--warning); }
.qh-grade.grade-bad { background: var(--danger-bg); color: var(--danger); }
.qh-info { flex: 1; min-width: 0; }
.qh-label { font-size: 0.88rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qh-meta { display: flex; gap: 12px; font-size: 0.72rem; color: var(--text-3); margin-top: 3px; }
.qh-meta span { display: flex; align-items: center; gap: 3px; }
.qh-config { font-size: 0.7rem; color: var(--text-4); margin-top: 3px; font-weight: 600; }
.qh-right { flex-shrink: 0; text-align: right; }
.qh-pct { font-size: 1rem; font-weight: 900; color: var(--text); }
.qh-bar-wrap { width: 60px; height: 4px; background: var(--border); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.qh-bar { height: 100%; border-radius: 2px; transition: width 0.4s; }

/* Quiz detail */
.qd-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px;
  background: var(--bg-off);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.qd-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 0.75rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.qd-body { flex: 1; }
.qd-q { font-size: 0.88rem; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.qd-opts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.qd-opt { display: flex; gap: 8px; font-size: 0.82rem; color: var(--text-2); }
.qd-opt.correct { color: var(--success); font-weight: 700; }
.qd-exp { font-size: 0.8rem; color: var(--text-2); line-height: 1.6; padding-top: 10px; border-top: 1px solid var(--border-light); }

/* ================================================================
   NOTES SETS LIST
   ================================================================ */
.notes-sets-list { display: flex; flex-direction: column; gap: 12px; }
.ns-item {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s;
}
.ns-item:hover { border-color: var(--accent); }
.ns-head { display: flex; align-items: center; gap: 12px; cursor: pointer; margin-bottom: 10px; }
.ns-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: #f0fdf4; color: #16a34a;
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.ns-info { flex: 1; }
.ns-label { font-size: 0.88rem; font-weight: 800; color: var(--text); }
.ns-meta { font-size: 0.72rem; color: var(--text-3); margin-top: 2px; }
.ns-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ns-prev-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px;
  font-size: 0.72rem; font-weight: 700;
}
.ns-prev-chip.high { background: var(--danger-bg); color: var(--danger); }
.ns-prev-chip.medium { background: var(--warning-bg); color: var(--warning); }
.ns-prev-chip.low { background: var(--success-bg); color: var(--success); }
.ns-prev-more { font-size: 0.72rem; color: var(--text-3); font-weight: 600; padding: 3px 0; align-self: center; }
.ns-overview { font-size: 0.8rem; color: var(--text-2); line-height: 1.6; margin-bottom: 12px; }

/* ================================================================
   SUMMARY
   ================================================================ */
.key-terms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 10px; margin-top: 10px; }
.key-term-card { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-off); }
.kt-term { font-size: 0.84rem; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.kt-def { font-size: 0.78rem; color: var(--text-2); line-height: 1.55; }

/* ================================================================
   SIDEBAR ADDITIONS
   ================================================================ */
.ws-empty-msg { font-size: 0.75rem; color: rgba(255,255,255,0.3); padding: 6px 10px; }
.ws-see-all {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  border: none; background: none; width: 100%; text-align: left;
  color: rgba(255,255,255,0.45); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s; margin-top: 2px;
}
.ws-see-all:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.8); }
.ws-see-all i:first-child { font-size: 14px; }

/* ================================================================
   PAGE HEADER (generic)
   ================================================================ */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}

/* ================================================================
   TOPBAR BACK BUTTON
   ================================================================ */
.topbar-back {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface); border: none;
  color: var(--text-2); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.15s;
}
.topbar-back:hover { background: var(--surface2); }

/* ================================================================
   CHAT SUGGESTIONS in messages area
   ================================================================ */
.chat-suggestions {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 0 0 42px;
  max-width: 800px;
}
.sug-chip {
  padding: 8px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem; font-weight: 500; color: var(--text-2);
  cursor: pointer; text-align: left;
  transition: all 0.15s;
  display: flex; align-items: center; gap: 6px;
  font-family: inherit;
}
.sug-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-muted); }
.sug-chip i { font-size: 14px; flex-shrink: 0; color: var(--text-3); }
.sug-chip:hover i { color: var(--accent); }

/* ================================================================
   SMALL BUTTON VARIANT
   ================================================================ */
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-sm i { font-size: 14px; }

/* ================================================================
   ANIM-IN
   ================================================================ */
.anim-in { animation: animIn 0.25s ease both; }
@keyframes animIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ================================================================
   SPIN ICON
   ================================================================ */
.spin-icon { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 640px) {
  .home-stats { grid-template-columns: repeat(2,1fr); }
  .home-actions-grid { grid-template-columns: repeat(2,1fr); }
  .ws-full-grid { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
  .home-actions-grid { grid-template-columns: 1fr 1fr; }
}
