/* Verb conjugations: the tool row under a revealed flashcard, the
   conjugation bottom sheet, and the Verb Conjugator page (Tools). See
   js/modules/conjugationUI.js. */

/* ---------- Tool row under the flashcard ---------- */
.card-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 4px;
}

.card-tool-btn {
  background: var(--accent-soft);
  color: var(--accent);
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.card-tool-btn:hover {
  filter: brightness(0.97);
}

/* ---------- Forms table (shared by sheet and page) ---------- */
.conj-group {
  margin-top: 14px;
}

.conj-group-title {
  margin: 0 0 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.conj-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.conj-group .conj-row:last-child {
  border-bottom: none;
}

.conj-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.conj-form {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.conj-main {
  font-size: 1.1rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.conj-kana {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.conj-speak {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.conj-speak:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.conj-head-main {
  font-size: 1.6rem;
  font-weight: 700;
}

.conj-head-kana {
  margin-left: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.conj-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.conj-class {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ---------- Bottom sheet ---------- */
body.conj-open {
  overflow: hidden;
}

.conj-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: background 0.2s ease;
}

.conj-overlay.is-open {
  background: rgba(0, 0, 0, 0.4);
}

.conj-sheet {
  background: var(--surface);
  color: var(--text);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  max-height: 85dvh;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.conj-overlay.is-open .conj-sheet {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .conj-overlay {
    align-items: center;
  }
  .conj-sheet {
    border-radius: var(--radius);
    transform: translateY(20px);
  }
}

.conj-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.conj-sheet-body {
  overflow-y: auto;
  margin-top: 4px;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Verb Conjugator page ---------- */
.conj-page {
  max-width: 640px;
  margin: 0 auto;
}

.conj-page-header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.conj-page-title {
  margin: 0;
  font-size: 1.3rem;
}

.conj-source {
  display: inline-flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 10px;
}

.conj-search {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.conj-search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.conj-count {
  margin: 10px 2px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.conj-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: var(--radius);
}

.conj-verb {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 8px;
}

.conj-verb summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
}

.conj-verb summary::-webkit-details-marker {
  display: none;
}

.conj-verb-head .conj-head-main {
  font-size: 1.2rem;
}

.conj-verb-head .conj-head-kana {
  font-size: 0.8rem;
}

.conj-verb-head {
  flex-shrink: 0;
}

.conj-verb-en {
  flex: 1;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conj-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.conj-verb[open] .conj-chevron {
  transform: rotate(180deg);
}

.conj-verb-body {
  padding: 0 14px 12px;
}
