/* ============================================================
   CWoMP Project Page – Custom overrides on top of Bootstrap 4
   Styled after WAFFLE (tau-vailab.github.io/WAFFLE)
   ============================================================ */

/* Section titles */
.title {
  text-align: center;
  margin-top: 8px;
  margin-bottom: 14px;
}

/* Abstract */
.abstract {
  text-align: justify;
  padding-left: 40px;
  padding-right: 40px;
}

/* Body text blocks */
.text-break {
  text-align: justify;
  font-size: 15px;
  margin: 8px 0;
}


/* ---------- Method / results figures ---------- */
.method-figure,
.results-figure {
  margin: 12px 0;
  text-align: center;
}

/* ---------- Demo browser ---------- */
.demo-card {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-top: 12px;
}

/* Language tabs */
.lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.lang-tab {
  padding: 4px 14px;
  border-radius: 999px;
  border: 1px solid #6c757d;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  color: #495057;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.lang-tab:hover {
  border-color: #007bff;
  color: #007bff;
}

.lang-tab.active {
  background: #007bff;
  border-color: #007bff;
  color: #fff;
}

/* Sentence navigator */
.sentence-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #007bff;
  border-radius: 4px;
  background: #fff;
  color: #007bff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-btn:hover { background: #007bff; color: #fff; }
.nav-btn:disabled { opacity: 0.35; cursor: default; }
.nav-btn:disabled:hover { background: #fff; color: #007bff; }

.sentence-index {
  font-size: 0.82rem;
  color: #6c757d;
}

/* Sentence display panel */
.sentence-display {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 14px;
  font-size: 14px;
}

.sentence-field {
  margin-bottom: 10px;
}

.field-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #adb5bd;
  font-weight: 600;
  margin-bottom: 2px;
}

.field-text.transcript {
  font-style: italic;
  font-size: 0.95rem;
}

.field-text.translation {
  color: #495057;
  font-size: 0.92rem;
}

.field-text.segmentation {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.82rem;
  color: #212529;
  background: #e9ecef;
  padding: 3px 8px;
  border-radius: 3px;
  display: inline-block;
}

/* Gloss table */
.gloss-table-wrap {
  overflow-x: auto;
}

.gloss-table-wrap.expanded {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
  overflow-x: auto;
  padding: 0 24px;
  box-sizing: border-box;
  background: #fff;
}

.gloss-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: #fff;
  border: 1px solid #007bff;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #007bff;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 8px;
}

.gloss-expand-btn:hover { background: #007bff; color: #fff; }

.gloss-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.76rem;
  min-width: 480px;
}

.gloss-table th {
  background: #e9ecef;
  color: #495057;
  font-weight: 600;
  padding: 6px 8px;
  text-align: left;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  white-space: nowrap;
  border-bottom: 2px solid #dee2e6;
}

.gloss-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 1px 0 0 #dee2e6;
}

.gloss-table td {
  padding: 5px 7px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
  white-space: nowrap;
}

.gloss-table tr:last-child td { border-bottom: none; }

.gloss-table tr.gloss-section-start td,
.gloss-table tr.gloss-section-start .method-label {
  border-top: 2px solid #ced4da;
}

.method-label {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #343a40;
  white-space: nowrap;
  min-width: 120px;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  box-shadow: 1px 0 0 #dee2e6;
}

/* Morpheme chips */
.morph-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.74rem;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  white-space: nowrap;
}

.chip-seg      { background: #f8f9fa; color: #495057; border: 1px solid #dee2e6; }
.chip-gt       { background: #e9ecef; color: #212529; border: 1px solid #ced4da; }
.chip-correct  { background: #e9ecef; color: #212529; border: 1px solid #ced4da; }
.chip-wrong    { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.chip-placeholder { background: #f8f9fa; color: #adb5bd; border: 1px solid #dee2e6; font-style: italic; }

/* Placeholder notice */
.placeholder-notice {
  font-size: 0.75rem;
  color: #6c757d;
  font-style: italic;
  margin-bottom: 10px;
}

.placeholder-notice::before {
  content: "ℹ ";
  font-style: normal;
  color: #007bff;
}

/* Lexicon toggle */
.lexicon-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: #fff;
  border: 1px solid #007bff;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #007bff;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 10px;
}

.lexicon-toggle-btn:hover { background: #007bff; color: #fff; }

.lexicon-panel {
  display: none;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 14px;
  margin-top: 4px;
  font-size: 13px;
}

.lexicon-panel.open { display: block; }

.lexicon-panel h3 {
  font-size: 0.82rem;
  font-weight: 600;
  color: #343a40;
  margin-bottom: 10px;
}

.lex-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

.lex-table th {
  text-align: left;
  padding: 4px 10px;
  background: #e9ecef;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #495057;
  border-bottom: 1px solid #dee2e6;
}

.lex-table td {
  padding: 3px 10px;
  border-bottom: 1px solid #f0f0f0;
  color: #343a40;
}

.lex-table tr:last-child td { border-bottom: none; }

.lex-note {
  font-size: 0.72rem;
  color: #adb5bd;
  font-style: italic;
  margin-top: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ---------- BibTeX ---------- */
.bibtex-wrap {
  position: relative;
}

.bibtex-block {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 14px 16px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #212529;
  white-space: pre;
  overflow-x: auto;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  background: #fff;
  border: 1px solid #007bff;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #007bff;
  cursor: pointer;
  transition: all 0.15s;
}

.copy-btn:hover { background: #007bff; color: #fff; }
.copy-btn.copied { background: #28a745; border-color: #28a745; color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 576px) {
  .abstract { padding-left: 0; padding-right: 0; }
  .demo-card { padding: 14px; }
}
