html { scroll-behavior: smooth; }

:root {
  /* variables now in base.css */
}

/* ── Grille de vocabulaire ── */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.vocab-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.vocab-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(9, 145, 224, 0.12);
}

.vocab-card h4 {
  margin: 0 0 0.6rem 0;
  color: var(--color-primary);
  font-size: 1rem;
}

.vocab-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.vocab-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.3rem 0;
  border-bottom: 1px dotted #e8e8e8;
}

.vocab-item:last-child {
  border-bottom: none;
}

.vocab-fr {
  font-weight: 600;
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.92rem;
}

.vocab-en {
  font-style: italic;
  color: #4b4b4b;
  text-align: right;
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.92rem;
}

/* ── Section module ── */
.vocab-module-section {
  margin: 2.5rem 0 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.vocab-module-section h2 {
  margin: 0;
  font-size: 1.4rem;
}

.vocab-module-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  flex-shrink: 0;
}



/* ── Intro description ── */
.vocab-intro {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #444;
  margin-bottom: 1rem;
}

/* ── Barre d'outils sticky ── */
.vocab-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #f5f7fa;
  border: 1px solid #d0d5dd;
  padding: 0.6rem 1rem;
  margin: 1.25rem 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.vocab-search {
  flex: 1 1 200px;
  min-width: 160px;
  padding: 0.45rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.9rem;
  background: #fff;
}

.vocab-search:focus {
  outline: 2px solid var(--color-primary);
  border-color: var(--color-primary);
}

.vocab-toolbar-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.vocab-btn {
  padding: 0.35rem 0.65rem;
  border: 1px solid #bbb;
  background: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  border-radius: 3px;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.vocab-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.vocab-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.vocab-sep {
  width: 1px;
  height: 1.2rem;
  background: #ccc;
  margin: 0 0.15rem;
}

.vocab-counter {
  font-size: 0.8rem;
  color: #888;
  white-space: nowrap;
  margin-left: auto;
}

/* ── Navigation rapide ── */
.vocab-nav-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 0.75rem;
  padding: 0;
  list-style: none;
}

.vocab-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 0.82rem;
  text-decoration: none;
  color: #333;
  transition: all 0.15s;
}

.vocab-nav-pill:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.vocab-seances-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  margin: 0 0 1rem;
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
  border: 2px solid var(--color-primary);
  border-radius: 6px;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.15s;
}

.vocab-seances-cta:hover {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(9, 145, 224, 0.25);
}

.vocab-toggle-all {
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  margin-left: auto;
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.vocab-toggle-all:hover {
  background: #0779c0;
  border-color: #0779c0;
}

/* ── Sections pliables ── */
.vocab-module-section {
  cursor: pointer;
  user-select: none;
  position: relative;
}

.vocab-section-chevron {
  margin-left: auto;
  font-size: 1.1rem;
  transition: transform 0.2s;
  color: #888;
}

.vocab-module-section.collapsed .vocab-section-chevron {
  transform: rotate(-90deg);
}

.vocab-grid.grid-hidden {
  display: none;
}

/* ── Mode révision FR→EN ── */
.revision-fr .vocab-en {
  color: transparent;
  background: linear-gradient(135deg, #e8ecf1 25%, #dfe4ea 100%);
  border-radius: 3px;
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  transition: all 0.2s;
}

.revision-fr .vocab-en:hover {
  background: linear-gradient(135deg, #d0d8e4 25%, #c5cdd8 100%);
}

.revision-fr .vocab-en.revealed {
  color: var(--color-primary);
  background: rgba(9, 145, 224, 0.06);
  font-weight: 600;
}

/* ── Mode révision EN→FR ── */
.revision-en .vocab-fr {
  color: transparent;
  background: linear-gradient(135deg, #e8ecf1 25%, #dfe4ea 100%);
  border-radius: 3px;
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  transition: all 0.2s;
}

.revision-en .vocab-fr:hover {
  background: linear-gradient(135deg, #d0d8e4 25%, #c5cdd8 100%);
}

.revision-en .vocab-fr.revealed {
  color: #1a1a2e;
  background: rgba(9, 145, 224, 0.06);
}

/* ── Filtre : masquer éléments ── */
.vocab-item.filter-hidden { display: none; }
.vocab-card.filter-hidden { display: none; }
.vocab-module-section.filter-hidden { display: none; }
.vocab-module-section.filter-hidden + .vocab-grid { display: none; }

/* ── Responsive toolbar ── */
@media (max-width: 600px) {
  .vocab-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .vocab-toolbar-actions {
    justify-content: center;
  }
  .vocab-counter {
    text-align: center;
    margin-left: 0;
  }
  .vocab-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════
   Dark mode
   ══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] .vocab-intro {
  color: var(--dm-text);
}
html[data-theme="dark"] .vocab-toolbar {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .vocab-search {
  background: var(--dm-bg);
  border-color: var(--dm-border);
  color: var(--dm-text);
}
html[data-theme="dark"] .vocab-btn {
  background: var(--dm-bg);
  border-color: var(--dm-border);
  color: var(--dm-text);
}
html[data-theme="dark"] .vocab-btn:hover {
  border-color: var(--dm-link);
  color: var(--dm-link);
}
html[data-theme="dark"] .vocab-sep {
  background: var(--dm-border);
}
html[data-theme="dark"] .vocab-counter {
  color: var(--dm-text-muted);
}
html[data-theme="dark"] .vocab-nav-pill {
  background: rgba(148, 163, 184, 0.1);
  border-color: var(--dm-border);
  color: var(--dm-text-muted);
}
html[data-theme="dark"] .vocab-nav-pill:hover {
  background: var(--dm-link);
  border-color: var(--dm-link);
  color: #fff;
}
html[data-theme="dark"] .vocab-seances-cta {
  background: rgba(9, 145, 224, 0.1);
  border-color: var(--dm-link);
  color: var(--dm-link);
}
html[data-theme="dark"] .vocab-seances-cta:hover {
  background: var(--dm-link);
  color: #fff;
}
html[data-theme="dark"] .vocab-section-chevron {
  color: var(--dm-text-muted);
}
html[data-theme="dark"] .vocab-item {
  border-bottom-color: var(--dm-border);
}
/* Revision mode — hidden text bg */
html[data-theme="dark"] .revision-fr .vocab-en,
html[data-theme="dark"] .revision-en .vocab-fr {
  background: var(--dm-border);
}
html[data-theme="dark"] .revision-fr .vocab-en:hover,
html[data-theme="dark"] .revision-en .vocab-fr:hover {
  background: var(--dm-surface-hi);
}
html[data-theme="dark"] .revision-fr .vocab-en.revealed,
html[data-theme="dark"] .revision-en .vocab-fr.revealed {
  background: rgba(9, 145, 224, 0.1);
  color: var(--dm-link);
}
html[data-theme="dark"] .vocab-en {
  color: var(--dm-text-muted);
}
html[data-theme="dark"] .vocab-card {
  background: var(--dm-surface);
  border-color: var(--dm-border);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] .vocab-card:hover {
  border-color: var(--dm-link);
  box-shadow: 0 4px 12px rgba(123, 163, 216, 0.2);
}
html[data-theme="dark"] .vocab-card h4 {
  color: var(--dm-link);
}
html[data-theme="dark"] .vocab-module-section {
  border-bottom-color: var(--dm-link);
}
html[data-theme="dark"] .vocab-module-badge {
  background: var(--dm-link);
}
html[data-theme="dark"] .vocab-btn.active {
  background: var(--dm-link);
  border-color: var(--dm-link);
}
html[data-theme="dark"] .vocab-toggle-all {
  background: var(--dm-link);
  border-color: var(--dm-link);
}
html[data-theme="dark"] .vocab-toggle-all:hover {
  background: #6593c8;
  border-color: #6593c8;
}
