/* question table */
.q-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.q-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  position: relative;
}
.q-table tbody tr:last-child { border-bottom: none; }
.q-table tbody tr:hover {
  background: var(--surface2);
  box-shadow: inset 3px 0 0 var(--accent);
}
.q-table tbody tr.done-row { background: var(--done-bg); }
.q-table tbody tr.done-row:hover { background: rgba(var(--easy-rgb),0.07); box-shadow: inset 3px 0 0 var(--easy); }
.q-table tbody tr.solved-today {
  box-shadow: inset 3px 0 0 var(--easy);
  background: rgba(var(--easy-rgb),0.055) !important;
}
.q-table tbody tr.solved-today:hover { background: rgba(var(--easy-rgb),0.09) !important; }
.today-badge {
  display: inline-block; margin-left: 6px;
  padding: 1px 6px; border-radius: 4px;
  font-size: 9px; font-weight: 700; letter-spacing: 0.05em;
  background: rgba(var(--easy-rgb),0.15); color: var(--easy);
  border: 1px solid rgba(var(--easy-rgb),0.3);
  font-family: 'JetBrains Mono', monospace;
  vertical-align: middle;
  animation: todayPulse 2.5s ease-in-out infinite;
}
@keyframes todayPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}
.q-table td { padding: 12px 14px; vertical-align: top; }

/* checkbox */
.check-cell  { width: 40px; }
.custom-check {
  width: 17px; height: 17px; border: 2px solid var(--border2); border-radius: 5px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, border-color 0.2s, background-color 0.2s; flex-shrink: 0;
  position: relative; z-index: 1;
}
.custom-check:hover { border-color: var(--easy); transform: scale(1.25); }
.custom-check.checked {
  background: var(--easy); border-color: var(--easy);
}
.custom-check.checked::after { content: '✓'; color: #000; font-size: 11px; font-weight: 700; }

/* cells */
.prob-name   { width: 35%; }
.diff-cell   { width: 90px; }
td.spacer-cell, col.spacer-cell { width: 0 !important; padding: 0 !important; border: none !important; }
body.notes-hidden.solution-hidden td.spacer-cell, body.notes-hidden.solution-hidden col.spacer-cell { width: auto !important; }
.prob-name a { color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; transition: color 0.15s; display: block; margin-bottom: 3px; }
.prob-name a:hover { color: var(--accent); }
.done-row .prob-name a { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(var(--easy-rgb),0.4); }

.topic-tag { display: inline-block; background: var(--surface3); border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); letter-spacing: 0.03em; }
.tag-pill  { display: inline-block; background: rgba(var(--accent-rgb),0.1); border: 1px solid rgba(var(--accent-rgb),0.2); border-radius: 4px; padding: 1px 6px; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--accent); margin: 2px 2px 0 0; }

.diff-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; transition: transform 0.15s; }
.diff-badge:hover { transform: scale(1.05); }
.diff-badge.easy   { background: var(--easy-bg);   color: var(--easy);   border: 1px solid rgba(var(--easy-rgb),0.2); }
.diff-badge.medium { background: var(--medium-bg); color: var(--medium); border: 1px solid rgba(var(--medium-rgb),0.2); }
.diff-badge.hard   { background: var(--hard-bg);   color: var(--hard);   border: 1px solid rgba(var(--hard-rgb),0.2); }

/* solution box */
.sol-cell-wrap { position: relative; }
.expand-btn {
  position: absolute; top: 6px; right: 6px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 4px;
  padding: 4px 6px; font-size: 10px; color: var(--text-muted); cursor: pointer;
  transition: opacity 0.2s, background-color 0.2s, color 0.2s, border-color 0.2s; opacity: 0;
  min-width: 36px; min-height: 36px; display: flex; align-items: center; justify-content: center;
}
.sol-cell-wrap:hover .expand-btn { opacity: 1; }
.expand-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.sol-box  { width: 100%; min-height: 70px; background: var(--surface3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text); resize: vertical; outline: none; line-height: 1.6; transition: border-color 0.2s, background 0.2s; }
.sol-box::placeholder { color: var(--text-muted); font-size: 11px; }
.sol-box:focus       { border-color: var(--accent); background: #1a1a25; }
[data-theme="light"] .sol-box:focus { background: var(--surface2); }
.sol-box.has-content { border-color: rgba(var(--easy-rgb),0.3); background: rgba(var(--easy-rgb),0.03); }

/* notes box */
.notes-box  { width: 100%; min-height: 70px; background: var(--surface3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text); resize: vertical; outline: none; line-height: 1.6; transition: border-color 0.2s, background 0.2s; }
.notes-box::placeholder { color: var(--text-muted); font-size: 11px; }
.notes-box:focus       { border-color: rgba(var(--accent-rgb),0.5); background: #1a1a25; }
[data-theme="light"] .notes-box:focus { background: var(--surface2); }
.notes-box.has-content { border-color: rgba(var(--accent-rgb),0.3); background: rgba(var(--accent-rgb),0.03); }

/* view toggles */
body.tags-hidden     .tag-pills-wrap { display: none !important; }
body.topic-hidden    .topic-tag      { display: none !important; }

/* keep column count preserved to prevent table-layout: fixed colspan collapse */
body.solution-hidden span.sol-cell { display: none !important; }
body.solution-hidden td.sol-cell, body.solution-hidden col.sol-cell { width: 0 !important; padding: 0 !important; border: none !important; overflow: hidden !important; }
body.solution-hidden td.sol-cell > * { display: none !important; }

body.notes-hidden    span.notes-cell { display: none !important; }
body.notes-hidden    td.notes-cell, body.notes-hidden col.notes-cell { width: 0 !important; padding: 0 !important; border: none !important; overflow: hidden !important; }
body.notes-hidden    td.notes-cell > * { display: none !important; }

tr.filtered-out { display: none; }

/* review star & complexity */
.review-star {
  display: inline-block; cursor: pointer; color: var(--border2);
  margin-right: 6px; font-size: 14px; transition: color 0.2s, transform 0.2s;
  user-select: none;
}
.review-star:hover { color: rgba(var(--medium-rgb),0.6); transform: scale(1.1); }
.review-star.active { color: var(--medium); text-shadow: 0 0 8px rgba(var(--medium-rgb),0.4); }

.complexity-row {
  display: flex; gap: 8px; margin-bottom: 6px;
}
.complexity-select {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted); outline: none;
}
.complexity-select:focus { border-color: rgba(var(--accent-rgb),0.5); color: var(--text); }

/* mobile */
@media (max-width: 768px) {
  span.sol-cell, span.notes-cell { display: none !important; }
  td.sol-cell, col.sol-cell, td.notes-cell, col.notes-cell { width: 0 !important; padding: 0 !important; border: none !important; overflow: hidden !important; }
  td.sol-cell > *, td.notes-cell > * { display: none !important; }
  .q-table td { padding: 10px 10px; }
  .prob-name a { font-size: 13px; }
  .similar-item { min-width: 0; flex: 1 1 calc(50% - 4px); }
  .similar-item-name { max-width: none; }
}

/* similar problems */
.similar-btn {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  background: var(--surface2); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 6px; margin-left: 6px; cursor: pointer;
  transition: all 0.2s;
}
.similar-btn:hover:not(:disabled) {
  background: var(--accent-glow); color: var(--accent); border-color: rgba(var(--accent-rgb),0.4);
}
.similar-btn:disabled {
  opacity: 0.5; cursor: not-allowed;
}

.similar-tray {
  background: var(--surface2);
}
.similar-tray-inner {
  padding: 0 14px !important; border-bottom: 1px solid transparent;
  overflow: hidden; max-height: 0; transition: all 0.3s ease;
  box-sizing: border-box;
}
.similar-tray.open .similar-tray-inner {
  max-height: 300px; padding: 12px 14px !important; border-bottom-color: var(--border);
}

.similar-close-btn {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; padding: 0 4px;
  transition: color 0.15s; line-height: 1;
}
.similar-close-btn:hover {
  color: var(--hard);
}

.similar-loading, .similar-empty {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-muted); padding: 12px 14px; font-style: italic;
}
.similar-loading {
  animation: pulseLoadingText 1.5s infinite ease-in-out;
  color: var(--accent);
}

.similar-tray-header {
  font-family: 'Syne', sans-serif; font-size: 11px; font-weight: 600;
  color: var(--text-dim); margin-bottom: 8px; text-transform: uppercase;
  letter-spacing: 0.05em;
}

.similar-items {
  display: flex; gap: 8px; flex-wrap: wrap;
}

.similar-item {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; text-decoration: none;
  transition: all 0.2s; min-width: 140px;
}
.similar-item:hover {
  border-color: rgba(var(--accent-rgb),0.4); background: rgba(var(--accent-rgb),0.05);
  transform: translateY(-1px);
}

.similar-item-name {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}
.similar-item-topic {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--text-muted);
}
.similar-item-meta {
  display: flex; align-items: center; gap: 6px;
}

/* ai styles */
.sol-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ai-btn {
  background: rgba(124, 106, 247, 0.1);
  border: 1px solid rgba(124, 106, 247, 0.4);
  color: var(--accent);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ai-btn:hover:not(:disabled) {
  background: rgba(124, 106, 247, 0.2);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.ai-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-hint-btn {
  margin-left: 8px;
  vertical-align: middle;
}

.ai-hint-box, .ai-fb-box {
  background: rgba(124, 106, 247, 0.05);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  margin-top: 10px;
  border-radius: 4px;
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;

}

.ai-hint-box strong, .ai-fb-box strong {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

@keyframes pulseLoadingText {
  0% { opacity: 0.5; }
  50% { opacity: 0.9; box-shadow: 0 0 8px rgba(124, 106, 247, 0.4); }
  100% { opacity: 0.5; }
}

.ai-btn.loading {
  animation: pulseLoadingText 1.5s infinite ease-in-out;
  pointer-events: none;
}

.ai-fb-container {
  margin-top: 8px;
}

.ai-fb-toggle {
  background: transparent;
  border: none;
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  transition: color 0.2s;
}

.ai-fb-toggle:hover {
  color: var(--accent);
}

.ai-fb-toggle .fb-icon {
  font-size: 12px;
}

.ai-fb-toggle .fb-arrow {
  font-size: 9px;
  transition: transform 0.2s;
}

.ai-fb-toggle.open .fb-arrow {
  transform: rotate(180deg);
}

.ai-fb-content {
  margin-top: 6px;
}

/* skeleton loading */
.skeleton-row td {
  padding: 16px 14px;
}
.skeleton-box {
  background: var(--surface2);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.skeleton-box::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  animation: shimmer 1.5s infinite linear;
}

.skeleton-check    { width: 20px; height: 20px; border-radius: 6px; }
.skeleton-text     { width: 50%; height: 18px; margin-bottom: 6px; }
.skeleton-text-sub { width: 30%; height: 14px; }
.skeleton-badge    { width: 60px; height: 20px; border-radius: 12px; }
.skeleton-textarea { width: 100%; height: 60px; border-radius: 8px; }

/* skeleton section header */
.skeleton-section .section-header { cursor: default; pointer-events: none; }
.skeleton-section-num   { width: 28px; height: 20px; border-radius: 5px; flex-shrink: 0; }
.skeleton-section-title { height: 16px; border-radius: 5px; }
.skeleton-section-count { width: 44px; height: 12px; border-radius: 4px; }
.skeleton-section .section-col-headers { opacity: 0.35; pointer-events: none; }

/* rich ai feedback card */
.ai-rich-fb {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-top: 10px;

  font-family: 'Syne', sans-serif;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.ai-rich-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.approach-section .ai-rich-title {
  color: #a87ffb;
}
.efficiency-section .ai-rich-title {
  color: var(--accent);
}

.ai-rich-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}
.ai-rich-icon {
  width: 16px;
  height: 16px;
}

.ai-rich-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.ai-rich-key {
  color: var(--text-muted);
  min-width: 80px;
}

.ai-rich-val {
  color: var(--text);
  font-family: 'Syne', sans-serif;
}
.ai-rich-val.suggested {
  color: var(--easy);
}
.ai-rich-val.consideration {
  font-style: italic;
  color: var(--text-dim);
}
.ai-rich-val.bold-val {
  font-weight: 600;
}

.ai-rich-complexity {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 4px;
}
.ai-rich-complexity.optimal {
  color: #06d6a0;
  background: rgba(6, 214, 160, 0.1);
}

/* ai review card (.air-*) */
.air-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 10px;
  font-family: 'Syne', sans-serif;
  font-size: 13px;

  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

/* header: chips + thumbs */
.air-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.air-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.air-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 600;
  color: var(--accent);
  background: rgba(var(--accent-rgb),0.1);
  border: 1px solid rgba(var(--accent-rgb),0.25);
  border-radius: 20px;
  padding: 2px 9px;
}
.air-thumbs { display: flex; gap: 4px; }
.air-thumb {
  background: transparent; border: none;
  cursor: pointer; font-size: 15px; line-height: 1;
  padding: 2px 4px; border-radius: 6px;
  transition: transform 0.15s, background 0.15s;
}
.air-thumb:hover { background: rgba(255,255,255,0.06); transform: scale(1.15); }

/* summary bar */
.air-summary {
  font-size: 13px; font-weight: 600;
  color: var(--accent); line-height: 1.45;
  margin-bottom: 10px;
}

/* divider */
.air-divider {
  height: 1px; background: var(--border);
  margin: 10px 0;
}

/* sections */
.air-section { display: flex; flex-direction: column; gap: 6px; }

.air-stitle {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700;
  margin-bottom: 4px;
}
.air-stitle-approach { color: #a87ffb; }
.air-stitle-eff      { color: var(--accent); }
.air-stitle-style    { color: var(--text-dim); }

/* rows */
.air-row {
  display: flex; align-items: baseline;
  gap: 8px; font-size: 12.5px; line-height: 1.45;
}
.air-row-wrap { align-items: flex-start; }
.air-key {
  flex-shrink: 0; min-width: 88px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.air-val  { color: var(--text); flex: 1; font-size: 12.5px; }
.air-green { color: var(--easy); }
.air-dim   { color: var(--text-dim); font-style: italic; flex: 1; font-size: 12.5px; }

/* Complexity badge */
.air-cplx {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-style: italic;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  padding: 1px 7px; border-radius: 4px;
}
.air-cplx.air-green {
  color: var(--easy);
  background: rgba(var(--easy-rgb),0.08);
}

/* efficiency section: time / space tabs */
.air-eff-tabs {
  display: flex; gap: 6px; margin-bottom: 6px;
}
.air-tab {
  padding: 3px 12px; border-radius: 20px; border: 1px solid var(--border2);
  background: var(--surface2); color: var(--text-muted);
  font-size: 11.5px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.air-tab:hover { color: var(--text); border-color: var(--accent); }
.air-tab.active {
  background: rgba(var(--accent-rgb),0.15);
  border-color: var(--accent); color: var(--accent);
}
.air-eff-inner {
  display: flex; flex-direction: row;
  align-items: flex-start; gap: 12px;
}
.air-eff-left { flex: 1; display: flex; flex-direction: column; gap: 6px; }

/* complexity graph */
.air-graph-wrap {
  flex-shrink: 0; width: 108px;
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 6px;
}
.air-graph-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px; font-style: italic;
  font-weight: 800; color: var(--text-dim);
  line-height: 1; letter-spacing: -0.5px;
  align-self: flex-end;
}
.air-graph-svg { width: 102px; height: 66px; display: block; }

/* star rating */
.air-stars {
  font-size: 14px; color: var(--medium);
  letter-spacing: 1px;
}
.air-stars-empty { color: var(--border2); }

/* ── light mode overrides ── */
[data-theme="light"] .skeleton-box::after {
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.045), transparent);
}
[data-theme="light"] .ai-rich-fb {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
[data-theme="light"] .air-card {
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
[data-theme="light"] .air-thumb:hover {
  background: rgba(0,0,0,0.06);
}
[data-theme="light"] .ai-rich-complexity {
  background: rgba(0,0,0,0.04);
}
[data-theme="light"] .ai-rich-complexity.optimal {
  color: var(--easy);
  background: rgba(var(--easy-rgb),0.1);
}
[data-theme="light"] .air-cplx {
  background: rgba(0,0,0,0.04);
}
[data-theme="light"] .approach-section .ai-rich-title {
  color: var(--accent);
}
[data-theme="light"] .air-stitle-approach {
  color: var(--accent);
}
[data-theme="light"] .custom-check.checked::after {
  color: #fff;
}
[data-theme="light"] .review-star.active {
  text-shadow: none;
}
