/* ============================================================
   Know Your Team – Tremendous Branded
   Colors sampled from tremendous.com (2026-02)
   Primary Blue: #2F6DEF  |  Text: #26262A  |  Grid: #E6E8EC
   ============================================================ */

:root {
  --blue: #2F6DEF;
  --blue-dark: #2459c8;
  --blue-light: #eef3fd;
  --green: #22c55e;
  --red-muted: #ef4444;
  --text: #26262A;
  --text-secondary: #555;
  --gray-50: #f7f8fa;
  --gray-100: #f0f2f5;
  --gray-200: #e6e8ec;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #26262A;
  --white: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-50);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* === Header === */
.header {
  background: var(--white);
  color: var(--text);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-home {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.15s;
}

.header-home:hover {
  opacity: 0.7;
}

.header h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

.header h1 span {
  color: var(--blue);
  margin-left: 6px;
}

/* Score display */
.header-score {
  font-size: 14px;
  display: none;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.score-knew {
  color: var(--green);
  font-weight: 600;
}

.score-didnt {
  color: var(--gray-400);
  font-weight: 500;
}

.score-sep {
  color: var(--gray-300);
}

/* === Container === */
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 20px;
}

/* === Loading state === */
.loading {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray-500);
}

.loading .spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === Home Screen === */
.home-screen {
  animation: fadeIn 0.3s ease;
}

.home-screen h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  text-align: center;
}

.home-screen .subtitle {
  color: var(--gray-500);
  margin-bottom: 8px;
  font-size: 15px;
  text-align: center;
}

/* Globe hero */
.globe-hero {
  text-align: center;
  margin-bottom: 28px;
}

.globe-container {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  min-height: 280px;
  align-items: center;
}

.globe-container svg {
  cursor: grab;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.06));
}

.globe-container svg:active {
  cursor: grabbing;
}

.globe-loading {
  color: var(--gray-400);
  font-size: 13px;
}

.globe-loading .spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 8px;
}

.globe-stats {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 4px;
}

.globe-stats strong {
  color: var(--blue);
  font-weight: 600;
}

/* Home card */
.home-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 28px 24px;
  margin-bottom: 16px;
}

/* Filter toggle (below start button) */
.filter-row-bottom {
  margin-top: 16px;
  text-align: center;
}

.toggle-label-sm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--gray-400);
}

.toggle-label-sm input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
  cursor: pointer;
}

.toggle-text-sm {
  line-height: 1.4;
}

/* Card count selector */
.count-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.count-selector label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-600);
}

.count-btn {
  padding: 8px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all 0.15s ease;
}

.count-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.count-btn.selected {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--white);
  font-weight: 600;
}

.start-btn {
  width: 100%;
  padding: 14px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.start-btn:hover {
  background: var(--blue-dark);
}

.data-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--gray-400);
  text-align: center;
}

/* === Flashcard Screen === */
.flashcard-screen {
  animation: fadeIn 0.3s ease;
}

.progress-bar {
  background: var(--gray-200);
  border-radius: 20px;
  height: 4px;
  margin-bottom: 24px;
  overflow: hidden;
}

.progress-fill {
  background: var(--blue);
  height: 100%;
  border-radius: 20px;
  transition: width 0.3s ease;
}

.question-counter {
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 20px;
  font-weight: 500;
}

/* Flashcard */
.flashcard {
  margin-bottom: 20px;
}

.flashcard-front,
.flashcard-back {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 32px 24px;
  animation: slideUp 0.3s ease;
}

.flashcard-front {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* Card photo */
.card-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 24px;
  display: block;
  border: 3px solid var(--gray-100);
  box-shadow: var(--shadow);
}

.card-hint {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 24px;
}

/* Reveal button */
.reveal-btn {
  padding: 14px 48px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.reveal-btn:hover {
  background: var(--blue-dark);
}

/* === Detail Panel (card back) === */
.detail-panel {
  animation: fadeIn 0.25s ease;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-100);
}

.detail-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gray-100);
  flex-shrink: 0;
}

.detail-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.detail-title {
  font-size: 14px;
  color: var(--gray-500);
  margin-top: 2px;
}

.detail-headline {
  font-size: 13px;
  color: var(--gray-400);
  margin-top: 2px;
  font-style: italic;
}

.detail-linkedin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #0077b5;
  color: white;
  font-size: 11px;
  font-weight: 700;
  font-family: Georgia, serif;
  border-radius: 3px;
  text-decoration: none;
  margin-left: 6px;
  vertical-align: middle;
  transition: background 0.15s;
}

.detail-linkedin:hover {
  background: #005f8f;
}

/* Info grid */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-item {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.detail-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--blue);
  margin-bottom: 4px;
}

.detail-value {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* Detail sections */
.detail-section {
  margin-bottom: 16px;
}

.detail-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--blue);
  margin-bottom: 8px;
}

.detail-list {
  list-style: none;
  padding: 0;
}

.detail-list li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.5;
  border-bottom: 1px solid var(--gray-100);
}

.detail-list li:last-child {
  border-bottom: none;
}

.detail-list li::before {
  content: "\2022";
  color: var(--blue);
  font-weight: bold;
  margin-right: 8px;
}

/* Hobby tags */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
}

.detail-text {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
}

/* Video thumbnail in details */
.detail-video-thumb {
  width: 100%;
  max-width: 320px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* Self-report buttons */
.self-report {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-100);
}

.report-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.knew-btn {
  background: var(--blue);
  color: var(--white);
}

.knew-btn:hover {
  background: var(--blue-dark);
}

.didnt-btn {
  background: var(--white);
  color: var(--gray-600);
  border: 1px solid var(--gray-200) !important;
}

.didnt-btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-300) !important;
  color: var(--text);
}

/* === Results Screen === */
.results-screen {
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.results-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 40px 32px;
  margin-bottom: 20px;
}

.results-card h2 {
  font-size: 24px;
  color: var(--text);
  margin-bottom: 8px;
}

.results-card .score-big {
  font-size: 56px;
  font-weight: 800;
  color: var(--blue);
  margin: 16px 0;
}

.results-card .score-label {
  font-size: 16px;
  color: var(--gray-500);
  margin-bottom: 24px;
}

.results-card .score-message {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.5;
}

.results-actions {
  display: flex;
  gap: 12px;
}

.results-actions button {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.btn-retry {
  background: var(--blue);
  color: var(--white);
}

.btn-retry:hover {
  background: var(--blue-dark);
}

.btn-home {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--gray-200) !important;
}

.btn-home:hover {
  border-color: var(--gray-300) !important;
  background: var(--gray-50);
}

/* === Animations === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* === Responsive === */
@media (max-width: 520px) {
  .container { padding: 20px 16px; }
  .home-card { padding: 20px 16px; }
  .flashcard-front,
  .flashcard-back { padding: 24px 16px; }
  .card-photo { width: 160px; height: 160px; }
  .detail-grid { grid-template-columns: 1fr; }
  .results-card .score-big { font-size: 44px; }
  .results-card { padding: 28px 20px; }
  .self-report { flex-direction: column; }
  .globe-container { min-height: 220px; }
  .globe-container svg { max-width: 260px; }
}

/* === v2 additions: login gate, MCQ buttons, leaderboard === */

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(38, 38, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-card {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 380px;
  max-width: 90vw;
}

.login-card h2 {
  margin-bottom: 6px;
  font-size: 20px;
}

.login-card p.subtitle {
  color: var(--gray-500);
  margin-bottom: 20px;
  font-size: 14px;
}

.login-card label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin: 14px 0 6px;
}

.login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
}

.login-card input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 109, 239, 0.12);
}

.login-card button {
  width: 100%;
  margin-top: 18px;
  padding: 11px 16px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.login-card button:hover { background: var(--blue-dark); }
.login-card button:disabled { background: var(--gray-300); cursor: default; }

.login-error {
  color: var(--red-muted);
  font-size: 13px;
  margin-top: 12px;
  display: none;
}
.login-error.visible { display: block; }

/* MCQ choices */

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  margin-top: 24px;
}

.choice-btn {
  padding: 14px 16px;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.12s;
  font-family: inherit;
}

.choice-btn:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}

.choice-btn:disabled { cursor: default; }

.choice-btn.correct {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.08);
}

.choice-btn.wrong {
  border-color: var(--red-muted);
  background: rgba(239, 68, 68, 0.08);
}

.choice-btn.faded { opacity: 0.5; }

.feedback-banner {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-align: center;
}

.feedback-banner.correct {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.feedback-banner.wrong {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.next-btn {
  margin-top: 18px;
  padding: 11px 18px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

.next-btn:hover { background: var(--blue-dark); }

/* Leaderboard */

.leaderboard-section {
  margin-top: 32px;
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.leaderboard-section h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.tab-row {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  color: var(--gray-500);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}

.tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.lb-table th, .lb-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-100);
}

.lb-table th {
  color: var(--gray-500);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lb-rank {
  width: 32px;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
}

.lb-username { font-weight: 600; }
.lb-self { background: var(--blue-light); }

.lb-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 8px;
}

.lb-empty {
  text-align: center;
  padding: 24px;
  color: var(--gray-400);
  font-size: 14px;
}

/* User chip in header */

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-600);
}

.user-chip .name {
  font-weight: 600;
  color: var(--text);
}

.user-chip .logout {
  color: var(--gray-400);
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
}
