/* =========================================================
   EvalLoop AI — Evaluation Workspace
   ========================================================= */

/* ---------------------------------------------------------
   1. DESIGN TOKENS
   --------------------------------------------------------- */

:root {
  --bg: #101211;
  --panel: #171b18;
  --panel2: #1d221f;

  --ink: #f1f1ef;
  --muted: #a4aaa6;
  --dim: #727974;

  --line: rgba(241, 241, 239, .14);

  --green: #3ecf8e;
  --green2: #85e7ba;
  --darkgreen: #13261c;

  --sans: Inter, system-ui, sans-serif;
  --mono: "DM Mono", monospace;
}

/* ---------------------------------------------------------
   2. RESET
   --------------------------------------------------------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;

  background: var(--bg);
  color: var(--ink);

  font-family: var(--sans);
  font-weight: 400;

  line-height: 1.6;

  overflow-x: hidden;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ---------------------------------------------------------
   3. BACKGROUND
   --------------------------------------------------------- */

.background-grid {
  position: fixed;

  inset: 0;

  pointer-events: none;

  z-index: -3;

  background-image:
    linear-gradient(
      rgba(241, 241, 239, .025) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(241, 241, 239, .025) 1px,
      transparent 1px
    );

  background-size: 48px 48px;

  mask-image: linear-gradient(
    to bottom,
    black,
    transparent 90%
  );
}

.background-glow {
  position: fixed;

  width: 700px;
  height: 700px;

  top: -420px;
  left: 50%;

  transform: translateX(-50%);

  pointer-events: none;

  z-index: -2;

  background: radial-gradient(
    circle,
    rgba(62, 207, 142, .13),
    transparent 65%
  );
}

/* ---------------------------------------------------------
   4. HEADER
   --------------------------------------------------------- */

.app-header {
  position: sticky;

  top: 0;

  z-index: 20;

  border-bottom: 1px solid var(--line);

  background: rgba(16, 18, 17, .88);

  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1200px, calc(100% - 40px));

  min-height: 72px;

  margin: auto;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 24px;
}

/* ---------------------------------------------------------
   BRAND
   --------------------------------------------------------- */

.brand {
  display: inline-flex;
  align-items: center;

  font-family: var(--mono);

  font-size: 17px;

  letter-spacing: -.02em;

  color: var(--ink);
}

.brand > span {
  color: var(--green);
}

/*
 * Blinking underscore.
 *
 * This matches the terminal-style cursor
 * used by the EvalLoop AI brand.
 */

.brand .cursor {
  display: inline-block;

  color: var(--green);

  animation:
    brandCursorBlink 1s steps(1, end) infinite;
}

@keyframes brandCursorBlink {

  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }

}

.header-status {
  display: flex;

  align-items: center;

  gap: 9px;

  color: var(--muted);

  font-family: var(--mono);

  font-size: 11px;

  letter-spacing: .08em;

  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: var(--green);

  box-shadow:
    0 0 0 4px rgba(62, 207, 142, .08),
    0 0 14px rgba(62, 207, 142, .4);
}

.back-link {
  color: var(--muted);

  font-size: 13px;

  transition:
    color .2s ease,
    transform .2s ease;
}

.back-link:hover {
  color: var(--green2);

  transform: translateX(-3px);
}

/* ---------------------------------------------------------
   5. MAIN WORKSPACE
   --------------------------------------------------------- */

.workspace {
  width: min(1200px, calc(100% - 40px));

  margin: auto;

  padding:
    80px 0
    100px;
}

/* ---------------------------------------------------------
   6. PAGE HEADING
   --------------------------------------------------------- */

.workspace-heading {
  display: flex;

  align-items: flex-end;

  justify-content: space-between;

  gap: 40px;

  margin-bottom: 48px;
}

.eyebrow {
  margin-bottom: 14px;

  color: var(--green);

  font-family: var(--mono);

  font-size: 11px;

  letter-spacing: .14em;
}

.workspace-heading h1 {
  max-width: 700px;

  font-size: clamp(38px, 5vw, 64px);

  line-height: 1.02;

  font-weight: 300;

  letter-spacing: -.045em;
}

.workspace-heading h1 span {
  color: var(--green2);
}

.workspace-heading p {
  max-width: 650px;

  margin-top: 20px;

  color: var(--muted);

  font-size: 15px;

  line-height: 1.8;
}

.model-badge {
  flex-shrink: 0;

  display: flex;

  align-items: center;

  gap: 9px;

  padding: 10px 13px;

  border: 1px solid var(--line);

  background: rgba(23, 27, 24, .7);

  color: var(--muted);

  font-family: var(--mono);

  font-size: 11px;
}

.model-dot {
  width: 6px;
  height: 6px;

  border-radius: 50%;

  background: var(--green);
}

/* ---------------------------------------------------------
   7. EVALUATION LAYOUT
   --------------------------------------------------------- */

.evaluation-layout {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 18px;

  align-items: start;
}

/* ---------------------------------------------------------
   8. PANELS
   --------------------------------------------------------- */

.input-panel,
.results-panel {
  border: 1px solid var(--line);

  background:
    linear-gradient(
      145deg,
      rgba(29, 34, 31, .88),
      rgba(23, 27, 24, .94)
    );

  box-shadow:
    0 30px 80px rgba(0, 0, 0, .18);
}

.input-panel {
  padding: 28px;
}

.results-panel {
  min-height: 680px;

  padding: 28px;
}

.panel-header {
  display: flex;

  align-items: flex-start;

  justify-content: space-between;

  gap: 20px;

  padding-bottom: 24px;

  margin-bottom: 28px;

  border-bottom: 1px solid var(--line);
}

.panel-label {
  margin-bottom: 7px;

  color: var(--green);

  font-family: var(--mono);

  font-size: 10px;

  letter-spacing: .12em;
}

.panel-header h2 {
  font-size: 18px;

  line-height: 1.2;

  font-weight: 400;

  letter-spacing: -.02em;
}

.panel-state {
  padding: 5px 8px;

  border: 1px solid rgba(62, 207, 142, .25);

  background: rgba(19, 38, 28, .7);

  color: var(--green2);

  font-family: var(--mono);

  font-size: 9px;

  letter-spacing: .08em;
}

.panel-state.waiting {
  color: var(--dim);

  border-color: var(--line);

  background: transparent;
}

/* ---------------------------------------------------------
   9. FORM FIELDS
   --------------------------------------------------------- */

.field {
  margin-bottom: 22px;
}

.field-top {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 10px;

  margin-bottom: 9px;
}

.field-top label {
  color: var(--ink);

  font-size: 13px;

  font-weight: 400;
}

.field-top span {
  color: var(--dim);

  font-family: var(--mono);

  font-size: 9px;

  letter-spacing: .08em;

  text-transform: uppercase;
}

textarea {
  width: 100%;

  min-height: 145px;

  resize: vertical;

  padding: 15px 16px;

  border: 1px solid var(--line);

  outline: none;

  background: rgba(16, 18, 17, .75);

  color: var(--ink);

  font-family: var(--sans);

  font-size: 13px;

  font-weight: 300;

  line-height: 1.7;

  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    background .2s ease;
}

textarea::placeholder {
  color: #626963;
}

textarea:focus {
  border-color: rgba(62, 207, 142, .45);

  background: rgba(16, 18, 17, .95);

  box-shadow:
    0 0 0 3px rgba(62, 207, 142, .05);
}

.response-box {
  min-height: 190px;
}

.reference-box {
  min-height: 115px;
}

/* ---------------------------------------------------------
   10. EVALUATE BUTTON
   --------------------------------------------------------- */

.evaluate-button {
  width: 100%;

  min-height: 52px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  margin-top: 8px;

  padding: 0 17px;

  border: 1px solid rgba(62, 207, 142, .55);

  background: var(--darkgreen);

  color: var(--green2);

  font-size: 13px;

  font-weight: 400;

  transition:
    background .2s ease,
    border-color .2s ease,
    box-shadow .2s ease,
    transform .2s ease;
}

.evaluate-button:hover {
  background: #173522;

  border-color: var(--green);

  box-shadow:
    0 0 28px rgba(62, 207, 142, .09);

  transform: translateY(-1px);
}

.evaluate-button:active {
  transform: translateY(0);
}

.evaluate-button:disabled {
  cursor: wait;

  opacity: .65;

  transform: none;
}

.button-arrow {
  font-size: 18px;

  transition: transform .2s ease;
}

.evaluate-button:hover .button-arrow {
  transform: translateX(4px);
}

.form-message {
  min-height: 22px;

  margin-top: 12px;

  color: var(--dim);

  font-family: var(--mono);

  font-size: 10px;

  line-height: 1.5;
}

/* ---------------------------------------------------------
   11. EMPTY RESULTS STATE
   --------------------------------------------------------- */

.empty-state {
  min-height: 540px;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  text-align: center;

  padding: 30px;
}

.empty-orb {
  position: relative;

  width: 105px;
  height: 105px;

  display: flex;

  align-items: center;

  justify-content: center;

  margin-bottom: 28px;

  border: 1px solid rgba(62, 207, 142, .18);

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(62, 207, 142, .08),
      transparent 65%
    );

  color: var(--green2);

  font-family: var(--mono);

  font-size: 13px;
}

.empty-orb::before {
  content: "";

  position: absolute;

  inset: 18px;

  border: 1px solid rgba(62, 207, 142, .22);

  border-radius: 50%;
}

.orb-ring {
  position: absolute;

  border: 1px solid rgba(62, 207, 142, .1);

  border-radius: 50%;
}

.ring-one {
  inset: -15px;

  animation:
    orbit 8s linear infinite;
}

.ring-two {
  inset: -30px;

  border-style: dashed;

  animation:
    orbitReverse 12s linear infinite;
}

@keyframes orbit {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes orbitReverse {
  from {
    transform: rotate(360deg);
  }

  to {
    transform: rotate(0deg);
  }
}

.empty-state h3 {
  font-size: 18px;

  font-weight: 400;

  margin-bottom: 9px;
}

.empty-state p {
  max-width: 330px;

  color: var(--muted);

  font-size: 13px;

  line-height: 1.7;
}

/* ---------------------------------------------------------
   12. RESULTS
   --------------------------------------------------------- */

.hidden {
  display: none !important;
}

.results {
  animation:
    resultAppear .5s ease both;
}

@keyframes resultAppear {
  from {
    opacity: 0;

    transform: translateY(8px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

/* ---------------------------------------------------------
   13. OVERALL SCORE
   --------------------------------------------------------- */

.overall-card {
  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  padding: 22px;

  margin-bottom: 16px;

  border: 1px solid rgba(62, 207, 142, .18);

  background:
    linear-gradient(
      135deg,
      rgba(19, 38, 28, .75),
      rgba(23, 27, 24, .6)
    );
}

.result-label {
  margin-bottom: 7px;

  color: var(--dim);

  font-family: var(--mono);

  font-size: 9px;

  letter-spacing: .1em;
}

.overall-score {
  color: var(--green2);

  font-family: var(--mono);

  font-size: 44px;

  line-height: 1;

  font-weight: 400;
}

.overall-text {
  max-width: 180px;

  color: var(--muted);

  font-size: 12px;

  text-align: right;

  line-height: 1.6;
}

/* ---------------------------------------------------------
   14. SCORE GRID
   --------------------------------------------------------- */

.score-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 10px;

  margin-bottom: 18px;
}

.score-card {
  padding: 15px;

  border: 1px solid var(--line);

  background: rgba(16, 18, 17, .45);
}

.score-card > span {
  display: block;

  min-height: 34px;

  color: var(--muted);

  font-size: 11px;

  line-height: 1.4;
}

.score-card strong {
  display: block;

  margin-top: 7px;

  color: var(--ink);

  font-family: var(--mono);

  font-size: 18px;

  font-weight: 400;
}

.score-line {
  width: 100%;

  height: 2px;

  margin-top: 10px;

  overflow: hidden;

  background: rgba(241, 241, 239, .08);
}

.score-line div {
  width: 0%;

  height: 100%;

  background: var(--green);

  transition:
    width 1s ease;
}

/* ---------------------------------------------------------
   15. RESULT SECTIONS
   --------------------------------------------------------- */

.result-section {
  padding: 20px 0;

  border-top: 1px solid var(--line);
}

.result-section-title {
  margin-bottom: 9px;

  color: var(--green);

  font-family: var(--mono);

  font-size: 10px;

  letter-spacing: .1em;

  text-transform: uppercase;
}

.result-section p {
  color: var(--muted);

  font-size: 12px;

  line-height: 1.75;
}

/* ---------------------------------------------------------
   16. ISSUES
   --------------------------------------------------------- */

.issue,
.issue-item {
  display: grid;

  grid-template-columns: auto 1fr;

  gap: 10px;

  padding: 11px 0;

  border-bottom: 1px solid rgba(241, 241, 239, .06);
}

.issue:last-child,
.issue-item:last-child {
  border-bottom: 0;
}

.issue-marker {
  width: 6px;
  height: 6px;

  margin-top: 7px;

  border-radius: 50%;

  background: var(--green);
}

.issue-content strong,
.issue-type {
  display: block;

  margin-bottom: 3px;

  color: var(--ink);

  font-size: 11px;

  font-weight: 400;
}

.issue-content p,
.issue-description {
  color: var(--muted);

  font-size: 11px;

  line-height: 1.6;
}

/* ---------------------------------------------------------
   17. RECOMMENDATION
   --------------------------------------------------------- */

.recommendation {
  padding: 18px;

  border: 1px solid rgba(62, 207, 142, .13);

  background: rgba(19, 38, 28, .38);
}

.recommendation p {
  color: var(--muted);

  font-size: 12px;

  line-height: 1.7;
}

/* ---------------------------------------------------------
   18. RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 900px) {

  .workspace {
    padding-top: 60px;
  }

  .workspace-heading {
    align-items: flex-start;

    flex-direction: column;

    gap: 20px;
  }

  .evaluation-layout {
    grid-template-columns: 1fr;
  }

  .results-panel {
    min-height: auto;
  }

  .empty-state {
    min-height: 420px;
  }

}

@media (max-width: 600px) {

  .header-inner {
    width: min(
      100% - 28px,
      1200px
    );

    min-height: 64px;
  }

  .header-status {
    display: none;
  }

  .workspace {
    width: min(
      100% - 28px,
      1200px
    );

    padding-top: 45px;
  }

  .workspace-heading h1 {
    font-size: 40px;
  }

  .input-panel,
  .results-panel {
    padding: 20px;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }

  .overall-card {
    align-items: flex-start;

    flex-direction: column;
  }

  .overall-text {
    max-width: none;

    text-align: left;
  }

  .back-link {
    font-size: 11px;
  }

}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;

    animation-duration: .01ms !important;

    animation-iteration-count: 1 !important;

    transition-duration: .01ms !important;
  }

}

/* =========================================================
   EVALLOOP AI — PRODUCT IMPROVEMENTS
   Additive styles; original visual system is preserved.
   ========================================================= */

.preset-section {
  margin: 0 0 24px;
}
.preset-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.preset-heading strong {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink);
}
.preset-heading span,
.character-counter {
  color: var(--dim);
  font: 10px var(--mono);
}
.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preset-button,
.feedback-button {
  border: 1px solid var(--line);
  background: rgba(16, 18, 17, .55);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 11px;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.preset-button:hover,
.preset-button:focus-visible,
.feedback-button:hover,
.feedback-button:focus-visible {
  border-color: rgba(62, 207, 142, .55);
  color: var(--green2);
  outline: none;
}
.preset-button[aria-pressed="true"] {
  color: var(--green2);
  border-color: rgba(62, 207, 142, .5);
  background: rgba(19, 38, 28, .7);
}
.character-counter {
  display: block;
  text-align: right;
  margin-top: 6px;
}
.character-counter.limit-near {
  color: #e9bd70;
}
.character-counter.limit-reached {
  color: #ff8e8e;
}
.score-scale {
  margin: -3px 0 16px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}
.score-scale strong {
  color: var(--ink);
  font-weight: 400;
}
.issue-severity {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 3px 0 7px;
  padding: 3px 6px;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 9px var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.issue-severity.high {
  color: #ff9b9b;
  border-color: rgba(255, 115, 115, .35);
  background: rgba(90, 25, 25, .18);
}
.issue-severity.medium {
  color: #e9bd70;
  border-color: rgba(233, 189, 112, .3);
}
.issue-severity.low {
  color: var(--green2);
  border-color: rgba(62, 207, 142, .25);
}
.issue-quote,
.issue-fix,
.issue-why {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.issue-quote {
  padding: 8px 10px;
  border-left: 2px solid rgba(62, 207, 142, .45);
  background: rgba(16, 18, 17, .55);
  color: var(--ink);
}
.issue-quote em {
  color: var(--dim);
  font-style: normal;
}
.issue-fix strong,
.issue-why strong,
.issue-quote strong {
  display: inline;
  margin: 0;
  color: var(--green2);
  font-size: inherit;
  font-weight: 400;
}
.feedback-panel {
  padding: 18px 0 0;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}
.feedback-panel p {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}
.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.feedback-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.feedback-button[aria-pressed="true"] {
  color: var(--green2);
  border-color: rgba(62, 207, 142, .55);
  background: rgba(19, 38, 28, .7);
}
.feedback-thanks {
  min-height: 18px;
  margin-top: 8px;
  color: var(--green2);
  font: 10px var(--mono);
}
.form-message.error-message {
  color: #ff9b9b;
}
@media (max-width: 600px) {
  .preset-buttons { gap: 6px; }
  .preset-button { padding: 8px 9px; }
  .score-scale { font-size: 10px; }
}
