/* ============================================================
   LocEssentials – Translation Evaluations  |  styles.css
   Brand palette
     Pink         #ef91c6
     Light blue   #50A5E6
     Medium blue  #2b7bb9
     Dark blue    #1c6399
     Neon green   #60ff6c
     Dark green   #1f6944
     Dark pink    #691f44
     Yellow-orange #ffbc00
     Alabaster    #F5F7F9
   ============================================================ */



/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --pink:         #ef91c6;
  --pink-dark:    #691f44;
  --blue-light:   #50A5E6;
  --blue-mid:     #2b7bb9;
  --blue-dark:    #1c6399;
  --green-neon:   #60ff6c;
  --green-dark:   #1f6944;
  --yellow:       #ffbc00;
  --alabaster:    #F5F7F9;
  --white:        #ffffff;
  --text-primary: #1a2332;
  --text-secondary: #4a5568;
  --border:       #e2e8f0;
  --shadow-sm:    0 1px 3px rgba(28, 99, 153, 0.08);
  --shadow-md:    0 4px 16px rgba(28, 99, 153, 0.12);
  --shadow-lg:    0 8px 32px rgba(28, 99, 153, 0.16);
  --radius:       10px;
  --font-display: Arial, sans-serif;
  --font-body:    Arial, sans-serif;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  background-color: var(--alabaster);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ────────────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 60%, var(--blue-light) 100%);
  color: var(--white);
  padding: 36px 40px;
  border-radius: var(--radius);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2em;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ── Sections ──────────────────────────────────────────────── */
.section {
  background-color: var(--white);
  padding: 28px 32px;
  margin-bottom: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.section h2 {
  font-family: var(--font-display);
  font-size: 1.5em;
  font-weight: 550;
  color: var(--blue-dark);
  border-bottom: 2px solid var(--pink);
  padding-bottom: 10px;
  margin-top: 0;
  margin-bottom: 22px;
}

.section h3 {
  font-size: 1em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0 0 14px 0;
}

/* ── Translator Selection ──────────────────────────────────── */
.translator-selection {
  padding: 20px 28px;
}

.translator-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.translator-info h3 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1em;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.translator-info #translator-name {
  color: var(--blue-mid);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.translation-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.translation-selector label {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.translation-selector select {
  padding: 9px 14px;
  border: 2px solid var(--blue-mid);
  border-radius: 6px;
  background-color: var(--white);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95em;
  min-width: 200px;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.translation-selector select:disabled {
  background-color: var(--alabaster);
  color: var(--text-secondary);
  border-color: var(--border);
  cursor: not-allowed;
}

.translation-selector select:focus {
  outline: none;
  border-color: var(--blue-dark);
}

/* ── Legend ────────────────────────────────────────────────── */
.legend {
  margin-bottom: 24px;
  padding: 20px 24px;
  background-color: var(--alabaster);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.legend h3 {
  margin: 0 0 14px 0;
  font-family: var(--font-display);
  font-size: 1.05em;
  font-weight: 400;
  color: var(--blue-dark);
}

.legend-section {
  margin-bottom: 18px;
}

.legend-section:last-child {
  margin-bottom: 0;
}

.legend-section h4 {
  margin: 0 0 10px 0;
  color: var(--text-secondary);
  font-size: 0.78em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88em;
  color: var(--text-primary);
}

.legend-color {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.08);
  flex-shrink: 0;
}

/* ── Display Note ──────────────────────────────────────────── */
.notes-container {
  background-color: #fff8e1;
  border-left: 4px solid #f0c040;
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.notes-container h3 {
  margin: 0 0 6px 0;
  font-family: var(--font-body);
  font-size: 0.88em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7d5c00;
}

.notes-container p {
  margin: 0;
  font-size: 0.9em;
  color: #5a4000;
  line-height: 1.6;
}

/* ── Text Content (annotated translation) ──────────────────── */
.text-content {
  font-size: 1em;
  line-height: 1.85;
  color: var(--text-primary);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.text-content h1 {
  font-family: var(--font-display);
  font-size: 1.5em;
  font-weight: 400;
  margin: 28px 0 16px;
  color: var(--blue-dark);
  border-bottom: none;
  padding-bottom: 0;
}

.text-content h2 {
  font-family: var(--font-display);
  font-size: 1.25em;
  font-weight: 400;
  margin: 22px 0 12px;
  color: var(--blue-mid);
  border-bottom: none;
  padding-bottom: 0;
}

.text-content h3 {
  font-size: 1.05em;
  font-weight: 600;
  margin: 18px 0 10px;
  color: var(--text-secondary);
}

.text-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.93em;
}

.text-content table th,
.text-content table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.text-content table th {
  background-color: var(--blue-dark);
  color: var(--white);
  font-weight: 600;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.text-content ul, .text-content ol {
  margin: 10px 0;
  padding-left: 28px;
}

.text-content li { margin: 6px 0; }

.text-content p { margin: 10px 0; }

.text-content blockquote {
  margin: 18px 0;
  padding: 16px 22px;
  border-left: 4px solid var(--pink);
  background-color: #fdf5fa;
  font-style: italic;
  color: var(--text-secondary);
  border-radius: 0 6px 6px 0;
}

.text-content blockquote p { margin: 0; }

.text-content strong { font-weight: 700; }
.text-content em { font-style: italic; }

/* ── Highlights ────────────────────────────────────────────── */
.highlight {
  position: relative;
  cursor: default;
  padding: 2px 5px;
  border-radius: 0;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.highlight:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  z-index: 10;
}

.highlight.terminology             { background-color: #1f6944; color: #fff; }
.highlight.accuracy                { background-color: #FF4A4A; color: #fff; }
.highlight.style                   { background-color: #ef91c6; color: #fff; }
.highlight.linguistic-conventions  { background-color: #50A5E6; color: #fff; }
.highlight.locale-conventions      { background-color: #ffbc00; color: #333; }
.highlight.audience-appropriateness{ background-color: #691f44; color: #fff; }
.highlight.quality-marker          { background-color: #60ff6c !important; color: #333 !important; }

/* ── Tooltip ───────────────────────────────────────────────── */
.tooltip {
  position: absolute;
  background-color: var(--blue-dark);
  color: var(--white);
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 0.88em;
  max-width: 300px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  box-shadow: var(--shadow-lg);
  line-height: 1.45;
  pointer-events: none;
}

.tooltip.show {
  opacity: 1;
  visibility: visible;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: var(--blue-dark);
}

.tooltip-header {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--pink);
  font-size: 0.95em;
}

.tooltip-info    { margin-bottom: 4px; }
.tooltip-severity { margin-bottom: 6px; font-size: 0.85em; color: rgba(255,255,255,0.75); }

.tooltip-comment {
  font-style: italic;
  color: rgba(255,255,255,0.85);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

/* ── Summary Table ─────────────────────────────────────────── */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.9em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.summary-table th,
.summary-table td {
  padding: 13px 14px;
  text-align: left;
  border: 1px solid var(--border);
  vertical-align: top;
}

.summary-table th {
  background: var(--blue-dark);
  color: var(--white);
  font-weight: 600;
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
}

.summary-table tr:nth-child(even) { background-color: #f7f9fc; }
.summary-table tbody tr:hover           { background-color: #eef4fb; }

.summary-table td:last-child { border-right: none; }

.summary-table .text-segment {
  max-width: 200px;
  word-wrap: break-word;
  font-weight: 600;
  color: var(--blue-dark);
}

.summary-table .comments-cell {
  max-width: 300px;
  word-wrap: break-word;
  line-height: 1.5;
}

/* ── Badges ────────────────────────────────────────────────── */
.error-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.78em;
  font-weight: 700;
  margin-right: 4px;
}

.impact-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.78em;
  font-weight: 700;
}

.impact-neutral     { background-color: #dde3ea; color: #4a5568; }
.impact-moderate    { background-color: var(--yellow); color: #333; }
.impact-strong      { background-color: #e0621a; color: #fff; }
.impact-showstopper { background-color: #c0392b; color: #fff; }

.dimension-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.78em;
  font-weight: 700;
  color: #fff;
}
 
.dimension-badge.terminology              { background-color: #1f6944; }
.dimension-badge.accuracy                 { background-color: #FF4A4A; }
.dimension-badge.style                    { background-color: #ef91c6; color: #333; }
.dimension-badge.linguistic-conventions   { background-color: #50A5E6; }
.dimension-badge.locale-conventions       { background-color: #ffbc00; color: #333; }
.dimension-badge.audience-appropriateness { background-color: #691f44; }

.qm-badge {
  color: var(--yellow);
  font-size: 0.9em;
  margin-left: 4px;
}

/* ── Score Cards ───────────────────────────────────────────── */
.scores-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.score-card {
  background-color: var(--alabaster);
  padding: 28px 24px;
  border-radius: var(--radius);
  text-align: center;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.score-card:hover {
  box-shadow: var(--shadow-md);
}

.score-value {
  font-family: var(--font-display);
  font-size: 3em;
  font-weight: 400;
  color: var(--blue-dark);
  margin: 10px 0 4px;
  line-height: 1;
}

.score-label {
  font-size: 0.85em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.score-comment {
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 12px;
  font-size: 0.9em;
  line-height: 1.5;
}

/* ── Document Comments ─────────────────────────────────────── */
.document-comments {
  background-color: var(--alabaster);
  padding: 22px 26px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.document-comments:hover {
  box-shadow: var(--shadow-md);
}

.document-comments h3 {
  margin-top: 0;
  font-family: var(--font-display);
  font-size: 1.1em;
  font-weight: 400;
  color: var(--blue-dark);
  margin-bottom: 12px;
}

/* ── Effectiveness Table (info section) ────────────────────── */
.info-content {
  line-height: 1.7;
  color: var(--text-primary);
}
 
.info-content ul {
  margin: 14px 0;
  padding-left: 24px;
}
 
.info-content li { margin: 8px 0; }
 
.effectiveness-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 0.9em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
 
.effectiveness-table th,
.effectiveness-table td {
  padding: 13px 14px;
  text-align: left;
  border: 1px solid var(--border);
  vertical-align: top;
}
 
.effectiveness-table th {
  background: var(--blue-dark);
  color: var(--white);
  font-weight: 600;
  font-size: 0.82em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}
 
.effectiveness-table td:first-child { font-weight: 400; text-align: center; }
.effectiveness-table td:nth-child(2),
.effectiveness-table td:nth-child(3) { text-align: center; font-weight: 400; color: var(--blue-mid); }
 
.effectiveness-table tr:nth-child(even) { background-color: #f7f9fc; }
.effectiveness-table tbody tr:hover { background-color: #eef4fb; }

/* ── Loading / Error ───────────────────────────────────────── */
#content {
  display: none;
}

.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-secondary);
  font-style: italic;
}

.error {
  background-color: #c0392b;
  color: var(--white);
  padding: 20px 24px;
  border-radius: 8px;
  margin: 20px 0;
  font-weight: 500;
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 18px;
  border-radius: var(--radius);
  margin-top: 32px;
  font-size: 0.85em;
  position: relative;
  overflow: hidden;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  body { padding: 12px; }

  .section { padding: 18px 16px; }

  .translator-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .translation-selector { width: 100%; }
  .translation-selector select { min-width: auto; width: 100%; }

  .scores-container { grid-template-columns: 1fr; }

  .summary-table { font-size: 0.82em; }

  .tooltip {
    max-width: 240px;
    font-size: 0.82em;
  }

  .legend-items { gap: 10px; }
  .legend-section { margin-bottom: 14px; }

  h1 { font-size: 1.5em; }
}