@import url("https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;700;900&display=swap");

/* Global Scrollbar Styling */
* {
  scrollbar-width: 8px;
  scrollbar-color: rgba(255, 255, 255, 0.15) rgba(0, 0, 0, 0.15);
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

:root {
  --color-text-secondary: rgba(255, 255, 255, 0.6);
  --color-accent: #0239e9;
  --color-card-bg: rgba(255, 255, 255, 0.05);
  --color-card-border: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Figtree", sans-serif;
  background: var(--color-background);
  color: var(--color-text-primary);
  height: 100vh;
  overflow: hidden;
}

/* ===== CONTAINER ===== */

.session-eval-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.session-eval-lang-toggle {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: 16px;
  z-index: 5;
  display: flex;
}

/* ===== LOADING CARD ===== */

.session-eval-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 340px;
  width: 100%;
  gap: 20px;
}

.session-eval-lottie-wrap {
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#ses-eval-lottie {
  width: 100%;
  height: 100%;
}

.session-eval-loading-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}

.session-eval-loading-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ===== RESULTS CARD ===== */

.session-eval-results-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-width: 650px;
  max-height: 100vh;
  overflow: hidden;
}

.session-eval-results-header {
  padding: 20px 20px 0;
  text-align: center;
  flex-shrink: 0;
}

.session-eval-results-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--color-text-primary);
  margin: 0 0 8px;
}

.session-eval-results-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin: 0;
}

.session-eval-results-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.session-eval-results-list::-webkit-scrollbar {
  display: none;
}

/* ===== INSIGHT ROW (mirrors detail session history style) ===== */

.ses-insight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.ses-insight:last-child {
  border-bottom: none;
}

.ses-si-meta {
  display: flex;
  flex-direction: column;
  flex: 0 0 50%;
  max-width: 50%;
  min-width: 0;
}

.ses-si-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.ses-si-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.ses-si-type {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 20px;
  border: 1px solid transparent;
  flex-shrink: 0;
  /* per-type colors come from shared.css .ses-si-type--* */
}

.ses-si-desc {
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.4;
  margin-top: 3px;
}

.ses-si-value {
  flex: 0 0 50%;
  width: 50%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.ses-si-bool {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.ses-si-bool.bool-true {
  background: rgba(130, 244, 139, 0.12);
  color: var(--chart-positive);
}

.ses-si-bool.bool-false {
  background: rgba(254, 47, 47, 0.12);
  color: var(--chart-negative);
}

.ses-si-number {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary);
}

/* ── number with range (container + progress bar) ── */

.ses-si-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;

  & .ses-si-numbers {
    display: flex;
    align-items: center;
    gap: 4px;

    & .ses-si-number-min,
    & .ses-si-number-max {
      font-size: 11px;
      font-weight: 600;
      color: var(--color-text-secondary);
      opacity: 0.6;
    }

    & .ses-si-number-sep {
      font-size: 12px;
      color: var(--color-text-secondary);
      opacity: 0.6;
    }
  }

  & .ses-si-number-bar {
    width: 150px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;

    & .ses-si-number-fill {
      height: 100%;
      border-radius: 3px;
      background: var(--gradient-brand);
      background-size: 225% 225%;
      background-position: 45% 0%;
    }
  }
}

.ses-si-text {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-style: italic;
  text-align: right;
}

.ses-si-markdown {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  text-align: left;
  max-width: 320px;

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin: 0 0 6px;
    color: var(--color-text-primary);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
  }

  p {
    margin: 0;
  }

  p + p {
    margin-top: 6px;
  }

  ul,
  ol {
    margin: 0;
    padding-left: 18px;
  }

  p + ul,
  p + ol,
  ul + p,
  ol + p,
  ul + ul,
  ol + ol,
  ul + ol,
  ol + ul {
    margin-top: 6px;
  }

  li {
    margin: 2px 0;
  }

  strong {
    color: var(--color-text-primary);
    font-weight: 700;
  }

  em {
    color: var(--color-text-primary);
    font-style: italic;
  }

  a {
    color: var(--color-primary);
    text-decoration: underline;
  }

  code {
    display: inline;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9em;
    padding: 1px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
  }
}

.ses-si-tag {
  background: var(--color-primary-dim);
  color: rgba(255, 140, 110, 0.9);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid rgba(255, 110, 80, 0.15);
}

/* ===== BUTTONS ===== */

.session-eval-actions {
  padding: 16px 20px 24px;
  flex-shrink: 0;
  display: flex;
  flex-direction: row-reverse;
  gap: 10px;
}

.session-eval-primary-button,
.session-eval-repeat-button,
.session-eval-show-later-button {
  --button-width: 100%;
  flex: 1 1 0;
}

@media (max-width: 480px) {
  .session-eval-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== EMPTY STATE ===== */

.session-eval-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 20px 16px 20px;
}

.session-eval-empty-text {
  font-size: 14px;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

/* ===== HIDDEN ===== */

.hidden {
  display: none !important;
}
