/* Premium Light Design System for NCAA Cinderella Classifier */
:root {
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-color: #e2e8f0;
  --ncaa-orange: #ff5722;
  --ncaa-orange-glow: rgba(255, 87, 34, 0.15);
  --ncaa-blue: #003366;
  --ncaa-blue-glow: rgba(0, 51, 102, 0.1);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --color-cindy: #2e7d32;
  --color-cindy-glow: #e8f5e9;
  --color-exit: #c62828;
  --color-exit-glow: #ffebee;
  --font-body: 'Outfit', sans-serif;
  --font-display: 'Bebas Neue', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  background-image: radial-gradient(circle at 10% 20%, rgba(255, 87, 34, 0.03) 0%, transparent 45%),
                    radial-gradient(circle at 90% 80%, rgba(0, 51, 102, 0.03) 0%, transparent 45%);
  background-attachment: fixed;
  padding-bottom: 3rem;
}

/* Header Styling */
.app-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 1.75rem 5%;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-header h1 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1.1;
  letter-spacing: 0.5px;
  color: var(--ncaa-blue);
}

.authors-line {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.25rem;
}

/* Layout container */
.main-content {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Card glass styling */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.3s;
}

.card:hover {
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.06);
}

.intro-section p {
  margin-bottom: 1rem;
  font-size: 1.05rem;
  color: #334155;
}

.intro-section strong {
  color: var(--ncaa-orange);
}

/* Tabs switcher */
.workspace-tabs-wrapper {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s;
  position: relative;
  top: 1px;
}

.tab-btn:hover {
  color: var(--ncaa-blue);
  background: rgba(0, 51, 102, 0.03);
}

.tab-btn.active {
  color: var(--ncaa-orange);
  border-bottom: 3px solid var(--ncaa-orange);
  background: transparent;
}

/* Sandbox Mode Grid */
.sandbox-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .sandbox-grid {
    grid-template-columns: 1fr;
  }
}

.panel-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.panel-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ncaa-blue);
}

.panel-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Sliders Section */
.sliders-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.slider-section-box {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  padding: 1.25rem;
  border-radius: 8px;
}

.slider-section-box h4 {
  color: var(--ncaa-blue);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.slider-control-card {
  margin-bottom: 1.25rem;
}

.slider-control-card:last-child {
  margin-bottom: 0;
}

.slider-header-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.slider-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tooltip-icon {
  background: #e2e8f0;
  color: #64748b;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  font-weight: bold;
  transition: all 0.2s;
}

.tooltip-icon:hover {
  background: var(--ncaa-orange);
  color: white;
}

.slider-display-val {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ncaa-orange);
  letter-spacing: 0.5px;
}

/* Custom Slider styling */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
  transition: background 0.3s;
}

input[type="range"]:hover {
  background: #cbd5e1;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ncaa-orange);
  cursor: pointer;
  box-shadow: 0 0 6px var(--ncaa-orange-glow);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Model probability stacks */
.predictions-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.model-row-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 8px;
  transition: border-color 0.2s, background 0.2s;
}

.model-row-card.model-cindy-active {
  border-color: rgba(76, 175, 80, 0.4);
  background: #f1f9f1;
}

.model-row-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.model-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ncaa-blue);
}

.model-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-cindy {
  background: var(--color-cindy-glow);
  color: var(--color-cindy);
  border: 1px solid rgba(76, 175, 80, 0.2);
}

.badge-exit {
  background: var(--color-exit-glow);
  color: var(--color-exit);
  border: 1px solid rgba(244, 67, 54, 0.2);
}

.progress-bar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.progress-bar-bg {
  background: #e2e8f0;
  height: 10px;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s ease-out;
}

.fill-cindy {
  background: linear-gradient(90deg, #4caf50, #81c784);
}

.fill-exit {
  background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.threshold-line {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #d97706;
  z-index: 2;
}

.progress-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* PCA Panel */
.pca-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pca-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 0.8rem 1rem;
  border-radius: 6px;
}

.pca-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}

.pca-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pca-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ncaa-blue);
}

.pca-desc {
  font-size: 0.8rem;
  color: #334155;
}

.pca-footer-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1rem;
  text-align: center;
}

/* Challenge Mode */
.challenge-split {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .challenge-split {
    grid-template-columns: 1fr;
  }
}

.mystery-box-badge {
  background: rgba(0, 51, 102, 0.04);
  border: 1px solid var(--ncaa-blue-glow);
  color: var(--ncaa-blue);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.challenge-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.challenge-stat-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 0.8rem;
  border-radius: 6px;
  text-align: center;
}

.challenge-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.challenge-stat-val {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ncaa-blue);
  margin-top: 0.2rem;
}

.challenge-actions-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.user-guess-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.prompt-text {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ncaa-blue);
}

.btn-group {
  display: flex;
  gap: 0.5rem;
}

button.btn-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

button.btn-toggle:hover {
  color: var(--ncaa-blue);
  border-color: var(--text-muted);
}

button.btn-toggle.active {
  background: var(--ncaa-orange);
  color: white;
  border-color: var(--ncaa-orange);
}

.game-play-btns {
  display: flex;
  gap: 0.75rem;
}

button.btn-action {
  background: var(--ncaa-orange);
  color: white;
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

button.btn-action:hover:not(:disabled) {
  background: #e64a19;
}

button.btn-action:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

button.btn-secondary:hover {
  background: #e2e8f0;
}

/* Challenge Outcome Display */
.challenge-outcome-box {
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.challenge-outcome-box h4 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
  color: var(--ncaa-blue);
}

.box-cindy {
  background: var(--color-cindy-glow);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: var(--color-cindy);
}

.box-exit {
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #0369a1;
}

.comparison-summary {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.verdict-block {
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
}

.verdict-correct {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c8e6c9;
}

.verdict-wrong {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}

/* Scoreboard */
.challenge-score-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.2rem;
  color: var(--ncaa-blue);
}

.scoreboard-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 0.8rem 1rem;
  border-radius: 6px;
}

.score-row span {
  font-size: 0.95rem;
  font-weight: 500;
}

.score-row strong {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.5px;
  color: var(--ncaa-orange);
}

/* Tables styling */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

th, td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: #f1f5f9;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

tbody tr:last-child td {
  border-bottom: none;
}

.highlight-row {
  background: rgba(255, 87, 34, 0.04);
}

.highlight-row td {
  border-top: 1px solid rgba(255, 87, 34, 0.15);
  border-bottom: 1px solid rgba(255, 87, 34, 0.15);
}

.highlight-note {
  background: rgba(255, 87, 34, 0.05);
  border-left: 4px solid var(--ncaa-orange);
  padding: 1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  margin-bottom: 2rem;
  color: #334155;
}

/* Diagnostic report-like layout */
.plots-report-layout {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  margin: 2rem 0;
}

.report-plot-card {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.report-plot-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.report-plot-card h5 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--ncaa-blue);
  align-self: flex-start;
  border-left: 4px solid var(--ncaa-orange);
  padding-left: 0.5rem;
}

.plot-wrapper {
  width: 100%;
  max-width: 700px;
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
}

.diagnostic-img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0.5rem;
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.plot-explanation {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.6;
  text-align: justify;
  max-width: 800px;
  width: 100%;
  margin-top: 1.25rem;
}

.plot-explanation strong {
  color: var(--ncaa-orange);
}

/* PCA loadings and variables colors */
.pos-val {
  color: #2e7d32;
  font-weight: 500;
}

.neg-val {
  color: #c62828;
  font-weight: 500;
}

.text-correct {
  color: #2e7d32;
}

.text-wrong {
  color: #c62828;
}

/* Case studies grid */
.case-studies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.case-study-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.8rem 1.2rem;
  border-radius: 6px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.case-study-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--ncaa-blue);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.4rem;
}

/* Footer style */
.app-footer {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4rem;
}

.model-comparison-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 6px;
}

.model-comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
