body.backgrounded {
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
}

/* Smaller icon for displaying lesson themes */
.theme-icon-sm {
  font-size: 0.85em;
}

.overlay {
  background-color: rgba(255, 255, 255, 0.97);
  margin: 40px auto;
  padding: 20px;
  max-width: 1200px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  font-family: 'Roboto', sans-serif;
  overflow-x: auto;
  position: relative;
}

h2 {
  font-family: 'Roboto', sans-serif;
  color: #00008B;
}

label, textarea, input {
  font-family: 'Sarabun', sans-serif;
}

/* Utility to prevent wrapping for date/time columns */
.nowrap {
  white-space: nowrap;
}

/* Transcript container */
.transcript {
  /* Allow more transcript rows for shared session pages */
  max-height: 400px;
  overflow-y: auto;
  white-space: normal;
}

.table td {
  vertical-align: top;
}

/* Wider lesson column with reduced side padding */
.table .lesson-col {
  width: 45%;
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}

.log-container {
  font-family: monospace;
  font-size: 0.75rem;
  max-height: 70vh;
  overflow-y: auto;
}

/* Style for user speech transcription */
.user-transcript {
  color: darkgreen;
  font-style: normal;
}

/* Confetti effect used for reward modals */
#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}
.confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  opacity: 0.8;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(-10vh) rotate(0deg); }
  100% { transform: translateY(100vh) rotate(360deg); }
}

/* Styling for points earned modal */
#pointsEarnedModal .modal-content {
  background: linear-gradient(135deg, #cbe7ff, #e3f2ff);
  color: #1b1464;
  text-align: center;
}
#pointsEarnedModal .modal-header {
  border-bottom: none;
}
#pointsEarnedModal .modal-title {
  font-weight: 900;
  font-size: 2rem;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
}
#pointsEarnedModal .modal-body {
  font-size: 1.5rem;
}

/* Styling for newly earned badge modal */
#badgeEarnedModal .modal-content {
  background: linear-gradient(135deg, #ffe6b3, #fff2cc);
  color: #7b3500;
  text-align: center;
}
#badgeEarnedModal .modal-header {
  border-bottom: none;
}
#badgeEarnedModal .modal-title {
  font-weight: 900;
  font-size: 2rem;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
}
#badgeEarnedModal .modal-body {
  font-size: 1.5rem;
}
#badgeEarnedModal img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

/* Session timer next to controls */
#sessionTimer {
  margin-left: 0.5rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: bold;
}
#maxTimeNotice {
  margin-left: 0.5rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: bold;
  display: none;
}
#sessionTimer::before {
  content: "\23F1" " ";
}

/* Ensure bandwidth modal text visible on all devices */
#bandwidthModal .modal-content {
  background-color: #f2f2f2;
  color: #000;
}
#bandwidthModal .modal-body {
  color: #000;
}

#bandwidthModal .bandwidth-social-links a {
  font-size: 1.75rem;
  color: #000;
  transition: color 0.2s ease-in-out;
}

#bandwidthModal .bandwidth-social-links a:hover,
#bandwidthModal .bandwidth-social-links a:focus {
  color: #0d6efd;
}

/* Ensure invalid lesson modal text visible on all devices */
#invalidLessonModal .modal-content,
#invalidLessonModal .modal-body {
  color: #000 !important;
}

/* Light gray background for lesson preview modal */
#lessonPreviewModal .modal-content,
#lessonPreviewModal .modal-body {
  background-color: #f8f9fa;
  color: #000;
}

/* Styling for mission statement modal */
#missionModal .mission-text {
  background: linear-gradient(135deg, #f5f7fa, #e0f7fa);
  font-size: 1.2rem;
  font-family: 'Sarabun', sans-serif;
}

/* Generic light gray styling for simple info modals */
.info-modal .modal-content {
  background-color: #f8f9fa;
  color: #000;
}
.info-modal .modal-body {
  color: #000;
}

/* Highlight high urgency tracker items */
.urgent-high { background-color: #f8d7da; }

/* Closed tracker items */
.tracker-closed {
  background-color: #6f42c1;
  color: #ffffff;
  font-weight: bold;
}

/* User name in session header on small screens */
@media (max-width: 767px) {
  .user-name {
    color: #ffffff !important;
    text-shadow: 0 0 2px #000;
    font-size: 0.85em;
  }

}

@media (max-width: 699.98px) {
  #statHeader,
  #statHeader .stat-main {
    gap: 0.25em !important;
  }
  #statUserId {
    display: none !important;
  }
  #statHeader .bi-person-fill,
  #statUserName {
    display: none !important;
  }
}

/* Ensure adequate width for I18N columns */
.i18n-table {
  min-width: 600px;
}
.i18n-table input.form-control {
  min-width: 250px;
}

/* Horizontal badge list on admin user details page */
.badge-frame {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 5px;
}
.badge-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
}
.badge-row img {
  height: 64px;
  width: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Badge modal grid */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  justify-content: center;
}
.badge-item {
  position: relative;
  width: 100px;
  height: 100px;
}
.badge-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}
.badge-info {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 4px;
  text-align: center;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}
.badge-item:hover .badge-info {
  display: block;
}

/* Admin toolbar icons on small screens */
.admin-toolbar {
  gap: 0.25rem;
}
@media (max-width: 767.98px) {
  .admin-toolbar {
    justify-content: center !important;
  }
}

@media (max-width: 699.98px) {
  /* allow share icon and copy button on mobile */
  .share-footer {
    margin-top: 1rem;
    text-align: center;
  }
  .share-footer a {
    color: #007bff;
    text-decoration: underline;
  }
}
