/* Image Comparison Slider Styles */
.image-compare-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  background: #1E1E1E;
}

/* When header is inside container */
.image-compare-container .comparison-header {
  margin: 0;
  border-radius: 16px 16px 0 0;
}

.image-compare-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 66.67%;
  /* 3:2 aspect ratio, adjust as needed */
  overflow: hidden;
}

.image-compare-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.image-compare-before {
  z-index: 1;
}

.image-compare-after {
  z-index: 2;
  clip-path: inset(0 0 0 50%);
}

.image-compare-slider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #F89900, #ABFFEA);
  cursor: ew-resize;
  z-index: 3;
  transform: translateX(-50%);
  transition: background 0.2s ease;
}

.image-compare-slider:hover {
  background: linear-gradient(180deg, #ff8800, #7ee8d0);
}

.image-compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 48px;
  height: 48px;
  background: white;
  border: 3px solid #F89900;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.image-compare-slider:hover .image-compare-handle {
  transform: translate(-50%, -50%) scale(1.1);
  border-color: #ff8800;
  box-shadow: 0 6px 30px rgba(248, 153, 0, 0.4);
}

.image-compare-handle::before,
.image-compare-handle::after {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
}

.image-compare-handle::before {
  left: 8px;
  border-width: 8px 12px 8px 0;
  border-color: transparent #F89900 transparent transparent;
}

.image-compare-handle::after {
  right: 8px;
  border-width: 8px 0 8px 12px;
  border-color: transparent transparent transparent #F89900;
}

.image-compare-labels {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  z-index: 4;
  pointer-events: none;
}

.image-compare-label {
  background: rgba(0, 34, 67, 0.9);
  backdrop-filter: blur(10px);
  color: #ABFFEA;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-compare-label.before {
  background: rgba(0, 34, 67, 0.9);
}

.image-compare-label.after {
  background: rgba(248, 153, 0, 0.9);
  color: white;
}

/* Model comparison grid */
.model-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.comparison-item {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.comparison-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.comparison-header {
  background: linear-gradient(135deg, #002243, #003d6b);
  color: #ABFFEA;
  padding: 1rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.125rem;
}

.comparison-content {
  padding: 0;
}

/* Model outputs grid - horizontal layout */
.model-outputs-card {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  margin: 3rem 0;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.model-outputs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.model-output-item {
  display: flex;
  flex-direction: column;
}

.model-output-header {
  background: linear-gradient(135deg, #002243, #003d6b);
  color: #ABFFEA;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 12px 12px 0 0;
  margin-bottom: 0;
}

/* Compact image compare containers */
.image-compare-container.compact {
  margin: 0;
  max-width: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 0 0 12px 12px;
}

.image-compare-container.compact .image-compare-wrapper {
  padding-bottom: 100%;
  /* Square aspect ratio for compact view */
}

.image-compare-container.compact .image-compare-handle {
  width: 36px;
  height: 36px;
}

.image-compare-container.compact .image-compare-label {
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
}

/* Responsive grid */
@media (max-width: 1400px) {
  .model-outputs-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .model-outputs-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .model-outputs-grid {
    grid-template-columns: 1fr;
  }

  .model-outputs-card {
    padding: 1rem;
  }
}

/* Diagram styles */
.diagram-container {
  background: white;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.diagram-container img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.diagram-caption {
  text-align: center;
  color: #1E1E1E;
  font-size: 0.9375rem;
  margin-top: 1rem;
  font-style: italic;
}

/* Task summary cards */
.task-summary-card {
  background: radial-gradient(circle at 20% 20%, rgba(248, 153, 0, 0.15), rgba(0, 34, 67, 0.08)),
              linear-gradient(135deg, #002243, #003d6b);
  color: #f7fafc;
  border: 1px solid rgba(248, 153, 0, 0.4);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 0.75rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.task-summary-card p {
  margin: 0;
  line-height: 1.5;
  font-size: 0.98rem;
}

.task-summary-card strong,
.task-summary-card em {
  color: #F89900;
}

.results-summary {
  margin: 2rem 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.results-card {
  background: linear-gradient(135deg, #002243, #003d6b);
  color: #f7fafc;
  border: 1px solid rgba(248, 153, 0, 0.4);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.results-card .label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ABFFEA;
  opacity: 0.85;
}

.results-card .value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.results-card .value strong {
  color: #F89900;
}

.results-card .meta {
  font-size: 0.9rem;
  color: #d9e4ff;
}

.results-leaderboard {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 2rem;
  background: white;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.results-leaderboard thead {
  background: linear-gradient(135deg, #002243, #003d6b);
  color: #ABFFEA;
}

.results-leaderboard th,
.results-leaderboard td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  font-size: 0.93rem;
}

.results-leaderboard th {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: normal;
  line-height: 1.25;
}

.results-leaderboard tbody tr:nth-child(odd) {
  background: #f3f7fb;
}

.results-leaderboard tbody tr:nth-child(even) {
  background: #ffffff;
}

.results-leaderboard .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}

.badge.gold {
  background: linear-gradient(135deg, #F89900, #ffbb33);
  color: #1f1f1f;
}

.badge.silver {
  background: linear-gradient(135deg, #d1d5db, #9ca3af);
  color: #1f2937;
}

.badge.bronze {
  background: linear-gradient(135deg, #c08457, #a8622f);
  color: #fff7ed;
}

.badge.score {
  background: rgba(0, 34, 67, 0.08);
  color: #002243;
  border: 1px solid rgba(0, 34, 67, 0.1);
}

.badge.task-pass {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.badge.task-mid {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
}

.badge.task-low {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.floating-task-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
  background: rgba(0, 34, 67, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(248, 153, 0, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.floating-task-nav .nav-title {
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ABFFEA;
  margin-right: 0.5rem;
}

.floating-task-nav .nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #002243;
  background: #f7fafc;
  border: 1px solid rgba(0, 34, 67, 0.1);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.floating-task-nav .nav-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
  background: #ffffff;
}

.floating-task-nav .nav-chip span {
  background: rgba(248, 153, 0, 0.15);
  color: #F89900;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.task-anchor {
  margin-top: 3rem;
  padding-top: 0.5rem;
}

.showdown-title {
  color: #ABFFEA;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.results-leaderboard th,
.results-leaderboard td {
  color: #002243;
}

.results-leaderboard th {
  color: #ABFFEA;
}

.results-leaderboard td .badge {
  color: inherit;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .image-compare-labels {
    padding: 0.5rem;
  }

  .image-compare-label {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }

  .image-compare-handle {
    width: 40px;
    height: 40px;
  }

  .model-comparison-grid {
    grid-template-columns: 1fr;
  }
}

/* Loading state */
.image-compare-container.loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* Task Inputs Section - Compact Layout */
.task-inputs-section {
  margin: 0.5rem 0;
}

.task-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

/* Input image takes full left column, spans both rows */
.task-input-item:first-child {
  grid-row: 1 / 3;
}

/* Query image in top right */
.task-input-item:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}

/* Prompt in bottom right */
.task-input-item:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.task-input-item {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.task-input-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.task-input-label {
  background: linear-gradient(135deg, #002243, #003d6b);
  color: #ABFFEA;
  padding: 0.5rem 0.75rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.task-input-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 300px;
  cursor: zoom-in;
}

/* Keep query image a bit smaller so the outfit image sets the scale */
.task-input-item:nth-child(2) img {
  max-height: 240px;
}

/* Input image (first child) gets even more height */
.task-input-item:first-child img {
  max-height: 360px;
}

.task-input-item.task-prompt {
  display: flex;
  flex-direction: column;
}

.task-input-item.task-prompt .prompt-text {
  padding: 0.75rem;
  color: #1E1E1E;
  line-height: 1.3;
  font-size: 0.75rem;
  flex: 1;
  display: flex;
  align-items: center;
}

.task-input-item.task-prompt .prompt-text strong {
  color: #0b2b4a;
  font-weight: 700;
  background: transparent;
  padding: 0;
  display: inline;
}

/* Simple Model Outputs Grid */
.model-outputs-simple {
  margin: 0.5rem 0;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.model-outputs-grid-simple {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 0.75rem;
  min-width: 1100px;
}

.model-output-simple {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.model-output-simple:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.model-output-label {
  background: linear-gradient(135deg, #002243, #003d6b);
  color: #ABFFEA;
  padding: 0.5rem 0.75rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.model-output-simple img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Responsive adjustments for new layouts */
@media (max-width: 1200px) {
  .task-inputs-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  /* Reset grid positioning on smaller screens */
  .task-input-item:first-child,
  .task-input-item:nth-child(2),
  .task-input-item:nth-child(3) {
    grid-column: auto;
    grid-row: auto;
  }

  .task-input-item:first-child img {
    max-height: 400px;
  }

  .model-outputs-simple {
    overflow-x: auto;
  }

  .model-outputs-grid-simple {
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    min-width: 900px;
  }
}

@media (max-width: 768px) {

  .task-inputs-grid {
    grid-template-columns: 1fr;
  }

  .model-outputs-simple {
    overflow-x: auto;
  }

  .model-outputs-grid-simple {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    min-width: 800px;
  }

  .task-input-item img {
    max-height: 320px;
  }
}

/* Card Flip System for Model Outputs */
.model-output-simple.has-evaluation {
  position: relative;
  perspective: 1000px;
}

/* Card Inner Container for Flip */
.model-output-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.model-output-simple.flipped .model-output-card-inner {
  transform: rotateY(180deg);
}

/* Card Front (Image) */
.model-output-card-front {
  position: relative;
  backface-visibility: hidden;
}

/* Card Back (Details) */
.model-output-card-back {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  backface-visibility: hidden;
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #002243, #003d6b);
  color: #F5F3F1;
  padding: 2rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Close Button for Card Back */
.card-back-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #F5F3F1;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 20;
}

.card-back-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #F89900;
  transform: rotate(90deg);
}

/* Grade Badge - Top Right */
.model-output-simple .grade-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.375rem 0.625rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Score-based badges (0/3 to 3/3) */
.grade-badge.score-0 {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.grade-badge.score-1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.grade-badge.score-2 {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.grade-badge.score-3 {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

/* Legacy support for pass/conditional/fail */
.grade-badge.pass {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.grade-badge.conditional {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.grade-badge.fail {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

/* Card Back Content */
.card-back-grade {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Score-based card back grades */
.card-back-grade.score-0 {
  color: #f87171;
}

.card-back-grade.score-1 {
  color: #fbbf24;
}

.card-back-grade.score-2 {
  color: #60a5fa;
}

.card-back-grade.score-3 {
  color: #34d399;
}

/* Legacy support */
.card-back-grade.pass {
  color: #34d399;
}

.card-back-grade.conditional {
  color: #fbbf24;
}

.card-back-grade.fail {
  color: #f87171;
}

.card-back-section {
  margin-bottom: 1.25rem;
}

.card-back-section h4 {
  font-size: 1.125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  color: #ffffff;
}

.card-back-section.pros h4 {
  color: #34d399;
}

.card-back-section.cons h4 {
  color: #f87171;
}

.card-back-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.card-back-section ul li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #ffffff;
}

.card-back-section.pros ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #34d399;
  font-weight: 700;
}

.card-back-section.cons ul li::before {
  content: '✗';
  position: absolute;
  left: 0;
  color: #f87171;
  font-weight: 700;
}

/* Action Buttons Container - Bottom Right */
.model-output-actions {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 6;
}

/* Button Base Styles */
.model-output-btn {
  background: rgba(0, 34, 67, 0.9);
  color: #ABFFEA;
  padding: 0.375rem 0.75rem;
  border: none;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.model-output-btn:hover {
  background: rgba(0, 34, 67, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Modal Overlay */
.carousel-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.carousel-modal.active {
  display: flex;
}

/* Modal Content */
.carousel-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Close Button */
.carousel-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.carousel-close:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* Carousel Container */
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* Carousel Image */
.carousel-image {
  width: 100%;
  height: auto;
  display: block;
  max-height: 80vh;
  object-fit: contain;
}

/* Grade Badge in Modal */
.carousel-grade-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Score-based carousel badges */
.carousel-grade-badge.score-0 {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: white;
}

.carousel-grade-badge.score-1 {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
}

.carousel-grade-badge.score-2 {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  color: white;
}

.carousel-grade-badge.score-3 {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: white;
}

/* Legacy support */
.carousel-grade-badge.pass {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: white;
}

.carousel-grade-badge.conditional {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
}

.carousel-grade-badge.fail {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: white;
}

/* Per-run badge (pass/fail for each image) */
.carousel-run-badge {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
}

.carousel-run-badge.pass {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.carousel-run-badge.fail {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

/* Best Badge */
.best-badge {
  position: absolute;
  top: 4rem;
  left: 1rem;
  background: linear-gradient(135deg, #F89900, #ff8800);
  color: white;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Navigation Arrows */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.carousel-nav:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
  left: 1rem;
}

.carousel-nav.next {
  right: 1rem;
}

/* Image Counter */
.carousel-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .evaluation-popup {
    padding: 1.5rem;
  }

  .evaluation-popup .eval-grade {
    font-size: 1.25rem;
  }

  .carousel-content {
    max-width: 95vw;
    max-height: 95vh;
  }

  .carousel-nav {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .carousel-nav.prev {
    left: 0.5rem;
  }

  .carousel-nav.next {
    right: 0.5rem;
  }

  .carousel-close {
    width: 35px;
    height: 35px;
    font-size: 1.25rem;
  }

  .carousel-grade-badge,
  .best-badge {
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Input lightbox (enlarge on click) */
.input-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.input-lightbox.active {
  display: flex;
}

.input-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  object-fit: contain;
}

.input-lightbox-hint {
  position: absolute;
  bottom: 1rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}
