/* File: classroom/css/styles.css */

/* ==========================================
   DESIGN TOKENS
   ========================================== */

:root {
  font-size: 14px;

  /* Surfaces */
  --bg-page-from: #eef2f7;
  --bg-page-to:   #dbe4ee;
  --bg-card:      #ffffff;
  --bg-soft:      #f8fafc;
  --bg-overlay:   rgba(15, 23, 42, 0.75);

  /* Borders */
  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  /* Text */
  --text:         #334155;
  --text-strong:  #0f172a;
  --text-heading: #1e293b;
  --text-muted:   #64748b;
  --text-on-dark: #ffffff;

  /* Brand */
  --primary:        #4f46e5;
  --primary-dark:   #4338ca;
  --primary-soft:   #eef2ff;
  --accent:         #0ea5e9;
  --success:        #16a34a;
  --success-soft:   #dcfce7;
  --warning:        #f59e0b;
  --warning-soft:   #fef3c7;
  --danger:         #dc2626;
  --danger-soft:    #fee2e2;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.05);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* ==========================================
   GLOBAL
   ========================================== */

body {
  background: linear-gradient(180deg, var(--bg-page-from) 0%, var(--bg-page-to) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.55;
}

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

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

hr {
  border: 0;
  border-top: 1px solid var(--border);
  opacity: 1;
}

/* ==========================================
   CONTAINERS
   ========================================== */

.main-container {
  max-width: 750px;
  margin: 0 auto;
  padding: 30px 15px;
}

.game-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 15px;
}

.header-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 15px;
}

/* ==========================================
   CARDS
   ========================================== */

.welcome-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 45px 30px;
  text-align: center;
}

.class-header,
.header-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px;
  text-align: center;
  margin-bottom: 30px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px;
  min-height: 80vh;
  position: relative;
}

.class-card,
.activity-card,
.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin: 15px 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.class-card:hover,
.activity-card:hover,
.chapter-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  color: inherit;
  text-decoration: none;
}

.chapter-card {
  text-align: center;
  cursor: pointer;
}

/* ==========================================
   TYPOGRAPHY
   ========================================== */

h1 {
  color: var(--text-strong);
  font-weight: 700;
  font-size: 2rem !important;
}

h2 {
  color: var(--text-heading);
  font-weight: 600;
  font-size: 1.75rem !important;
  margin-top: 30px;
}

h3 {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.5rem !important;
  margin-top: 20px;
}

h4, h5, h6 {
  color: var(--text-heading);
  font-weight: 600;
}

/* Banner / gradient headers in inline page styles use colored backgrounds
   and need light text. These selectors keep all heading levels white when
   nested inside one of the known banner containers. */
.about-header h1,        .about-header h2,        .about-header h3,
.about-header h4,        .about-header h5,        .about-header h6,
.assignment-header h1,   .assignment-header h2,   .assignment-header h3,
.assignment-header h4,   .assignment-header h5,   .assignment-header h6,
.flex-header h1,         .flex-header h2,         .flex-header h3,
.flex-header h4,         .flex-header h5,         .flex-header h6,
.lesson-header h1,       .lesson-header h2,       .lesson-header h3,
.lesson-header h4,       .lesson-header h5,       .lesson-header h6,
.mc-header h1,           .mc-header h2,           .mc-header h3,
.mc-header h4,           .mc-header h5,           .mc-header h6,
.mission-header h1,      .mission-header h2,      .mission-header h3,
.mission-header h4,      .mission-header h5,      .mission-header h6,
.project-header h1,      .project-header h2,      .project-header h3,
.project-header h4,      .project-header h5,      .project-header h6,
.review-header h1,       .review-header h2,       .review-header h3,
.review-header h4,       .review-header h5,       .review-header h6,
.session-header h1,      .session-header h2,      .session-header h3,
.session-header h4,      .session-header h5,      .session-header h6,
.study-guide-header h1,  .study-guide-header h2,  .study-guide-header h3,
.study-guide-header h4,  .study-guide-header h5,  .study-guide-header h6,
.teacher-header h1,      .teacher-header h2,      .teacher-header h3,
.teacher-header h4,      .teacher-header h5,      .teacher-header h6,
.unit-header h1,         .unit-header h2,         .unit-header h3,
.unit-header h4,         .unit-header h5,         .unit-header h6 {
  color: var(--text-on-dark);
}

.display-4 {
  font-size: 3rem !important;
  font-weight: 700;
}

.display-5 {
  font-size: 2.5rem !important;
  font-weight: 700;
}

.lead {
  font-size: 1.1rem !important;
  color: var(--text);
}

.text-muted {
  color: var(--text-muted) !important;
}

/* ==========================================
   ICONS & IMAGES
   ========================================== */

.class-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--primary);
}

.activity-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--primary);
}

.chapter-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
}

.profile-image {
  border-radius: 50%;
  border: 4px solid var(--primary);
  margin: 20px 0;
  max-width: 160px;
  height: auto;
}

/* ==========================================
   BREADCRUMB
   ========================================== */

/* The breadcrumb sits on the page background; many pages use inline
   text-white / text-white-50 Bootstrap utilities on the links, so the
   container is kept dark to preserve readability. */
.breadcrumb-nav {
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  color: var(--text-on-dark);
  box-shadow: var(--shadow-sm);
}

.breadcrumb-nav a {
  color: var(--text-on-dark);
  text-decoration: none;
  opacity: 0.95;
}

.breadcrumb-nav a:hover {
  text-decoration: underline;
  opacity: 1;
  color: var(--text-on-dark);
}

/* ==========================================
   NAVIGATION (overrides for the bar in _includes/navigation.html)
   ========================================== */

.nav-container {
  max-width: 1000px;
}

.nav-header {
  padding: 12px 0;
}

.nav-brand {
  font-size: 1.1rem;
}

.nav-brand img {
  width: 35px;
  height: 35px;
}

.nav-link {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.nav-link i {
  font-size: 1rem;
}

/* ==========================================
   LAYOUT GRIDS
   ========================================== */

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

/* ==========================================
   BUTTONS (Bootstrap re-skin)
   ========================================== */

.btn {
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-lg {
  padding: 10px 25px;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--text-on-dark);
}

/* ==========================================
   GAME SECTIONS
   ========================================== */

.game-section {
  display: none;
}

.game-section.active {
  display: block;
  animation: fadeIn 0.5s;
}

.team-setup input {
  margin: 10px 0;
}

.team-scores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 15px 0;
}

.team-score-card {
  background: var(--bg-soft);
  border: 2px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-md);
  text-align: center;
  transition: transform 0.3s, background-color 0.3s, border-color 0.3s;
}

.team-score-card.active {
  border-color: var(--success);
  background: var(--success-soft);
  transform: scale(1.05);
}

/* ==========================================
   JEOPARDY BOARD
   ========================================== */

.jeopardy-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 30px 0;
}

.jeopardy-cell {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--text-on-dark);
  border: 2px solid #ffffff;
  border-radius: var(--radius-md);
  padding: 15px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.jeopardy-cell:hover:not(.used) {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.jeopardy-cell.used {
  background: #94a3b8;
  opacity: 0.5;
  cursor: not-allowed;
}

.jeopardy-header {
  background: var(--text-strong);
  color: var(--text-on-dark);
  font-size: 0.9rem;
  padding: 12px;
}

.game-board-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -15px;
  padding: 0 15px;
}

/* ==========================================
   MODAL
   ========================================== */

.question-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  z-index: 1000;
  animation: fadeIn 0.3s;
}

.question-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-content {
  background: var(--bg-card);
  padding: 30px;
  border-radius: var(--radius-lg);
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s;
}

.answer-option {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  background: var(--bg-soft);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
  text-align: left;
  color: var(--text);
}

.answer-option:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  transform: translateX(4px);
}

.answer-option.correct {
  background: var(--success-soft);
  border-color: var(--success);
  color: #14532d;
}

.answer-option.incorrect {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: #7f1d1d;
}

/* ==========================================
   TIMER
   ========================================== */

.countdown-timer {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin: 20px 0;
  color: var(--success);
}

.countdown-timer.warning {
  color: var(--warning);
}

.countdown-timer.danger {
  color: var(--danger);
  animation: pulse 1s infinite;
}

/* ==========================================
   UTILITY
   ========================================== */

/* Legacy class — kept readable on the light page background. */
.footer-text {
  color: var(--text-muted);
  text-align: center;
  margin-top: 40px;
}

.alert {
  padding: 12px 15px;
  margin: 15px 0;
  border-radius: var(--radius-sm);
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateY(-50px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* ==========================================
   RESPONSIVE - TABLET
   ========================================== */

@media (min-width: 768px) {
  .activity-col {
    min-width: 280px;
  }

  .class-card-col {
    min-width: 280px;
  }
}

/* ==========================================
   RESPONSIVE - MOBILE
   ========================================== */

@media (max-width: 768px) {
  .main-container,
  .game-container,
  .header-container {
    padding: 20px 15px;
  }

  .welcome-card,
  .class-header,
  .header-card {
    padding: 30px 20px;
  }

  .game-card {
    padding: 15px 10px;
  }

  .chapter-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  .jeopardy-board {
    min-width: 600px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
  }

  .jeopardy-cell {
    min-width: 120px;
    padding: 10px 5px;
    font-size: 1rem;
    min-height: 50px;
  }

  .jeopardy-header {
    font-size: 0.75rem;
    padding: 8px 5px;
    word-break: break-word;
    hyphens: auto;
  }

  .team-scores {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
  }

  .team-score-card {
    min-width: 100px;
    flex-shrink: 0;
    padding: 8px;
  }

  .team-score-card h5 {
    font-size: 0.9rem;
  }

  .team-score-card .h3 {
    font-size: 1.2rem;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  .btn-lg {
    padding: 10px 20px;
    font-size: 1rem;
  }

  .question-content {
    padding: 20px;
    margin: 10px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }

  .answer-option {
    padding: 10px;
    font-size: 0.95rem;
    margin: 6px 0;
  }

  #questionText {
    font-size: 1rem !important;
  }

  .class-icon,
  .activity-icon {
    font-size: 2rem;
  }

  .chapter-number {
    font-size: 2rem;
  }

  /* The fade overlays at the edges of the scrollable game board sit on top
     of the white game card — keep them light so they blend into the card. */
  .game-board-wrapper {
    position: relative;
  }

  .game-board-wrapper::before,
  .game-board-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    z-index: 10;
  }

  .game-board-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.95), transparent);
  }

  .game-board-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.95), transparent);
  }
}

/* ==========================================
   RESPONSIVE - SMALL MOBILE
   ========================================== */

@media (max-width: 480px) {
  .btn-warning.btn-sm {
    display: none;
  }

  .nav-brand span {
    display: none;
  }
}

@media (min-width: 400px) {
  .nav-brand span {
    display: inline;
  }
}
