/* =========================
   VARIABLES
========================= */
:root {
  --primary: #2487CE;
  --primary-dark: #1f74b2;
  --bg-light: #f8f9fc;
  --border: #dee2e6;
}

/* =========================
   GLOBAL
========================= */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-light);
}

/* =========================
   LAYOUT
========================= */
.center-wrap,
.flow-section {
  width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.flow-section {
  margin-top: 20px;
  margin-bottom: 8px;
}

/* Desktop card centering */
@media (min-width: 992px) {
  .card {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* =========================
   CARD
========================= */
/* =========================
   CARD (FIXED - ORIGINAL BEHAVIOUR)
========================= */
.card {
  border: none;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 15px rgba(0,0,0,0.05);
  width: 100%; /* mobile default */
}

/* Desktop only */
@media (min-width: 992px) {
  .card {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* =========================
   HEADER
========================= */
.header {
  padding: 6px 0 !important;
  align-items: center;
}

.header .container-xl {
  max-width: 90vw !important;
  width: 90%;
  margin: 0 auto;
  padding: 0;
}

.logo,
.logo h1,
.logo h2 {
  margin: 0;
  padding: 0;
  line-height: 1;
}

.logo h1,
.logo h2 {
  font-size: 18px;
  display: flex;
  align-items: center;
}

.sitename {
  font-size: 20px;
  margin: 0;
  line-height: 1;
}

/* Navigation */
#navmenu ul li a {
  padding: 6px 10px !important;
  font-size: 14px;
}

.nav-sm .nav-link {
  padding: 4px 10px;
  font-size: 14px;
}

/* Mobile header fixes */
@media (max-width: 1199px) {

  .header .btn-getstarted,
  .header .navmenu,
  .header .logo {
    order: unset !important;
  }

  .header .d-flex.align-items-center.gap-2 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
  }

  .mobile-nav-toggle {
    position: static !important;
    margin-left: 4px;
  }

  .header .btn-getstarted.d-xl-none {
    order: 1;
  }

  .header .mobile-nav-toggle {
    order: 2;
  }

  .mobile-nav-active .mobile-nav-toggle {
    position: static !important;
  }
}

/* =========================
   BUTTONS
========================= */
.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);
  color: #fff;
}

.btn-getstarted {
  padding: 4px 12px !important;
  font-size: 13px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
}

/* Button strip */
.btn-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn-strip .btn {
  white-space: nowrap;
}

@media (min-width: 768px) {
  .btn-md-auto {
    width: auto !important;
  }
}

@media (max-width: 768px) {
  .btn-strip .btn {
    flex: 1 1 auto;
  }

  .btn-strip .btn.wide-mobile {
    flex: 1 1 100%;
  }
}

/* =========================
   NAV PILLS
========================= */
.nav-pills .nav-link {
  color: var(--primary);
  border: 0;
}

.nav-pills .nav-link:hover,
.nav-pills .nav-link.active {
  background-color: var(--primary);
  color: #fff;
}

/* =========================
   SENTENCE LIST
========================= */
.sentence-item {
  display: flex;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.sentence-item:hover {
  background: #eef4ff;
  transform: translateY(-1px);
}

.sentence-num {
  width: 24px;
  color: #888;
  font-weight: bold;
}

.active-sentence {
  background: rgba(13,110,253,0.18);
  border-left: 4px solid #0d6efd;
  font-weight: 500;
}

/* =========================
   TEXT ACTIONS
========================= */
.text-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.text-action {
  cursor: pointer;
  font-size: 0.9rem;
  color: #6c757d;
  opacity: 0.7;
  transition: all 0.15s ease;
}

.text-action:hover {
  opacity: 1;
  color: #000;
  text-decoration: underline;
}

.text-action.primary {
  color: #0d6efd;
}

.text-action.danger {
  color: #dc3545;
  opacity: 0.6;
}

/* =========================
   FLOW SECTION
========================= */
.flow-step {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flow-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: orange;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(13,110,253,0.25);
}

.flow-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.flow-section::after {
  content: "";
  display: block;
  height: 1px;
  background: #e6e9ef;
  margin-top: 8px;
}

/* =========================
   STUDENT TABS
========================= */
#studentModeTabs .nav-link.active {
  font-weight: 700;
  background-color: #f1f5ff;
  border-color: #dee2e6 #dee2e6 #f1f5ff;
}

#studentModeTabs + .tab-content {
  padding: 0 !important;
  margin: 0 !important;
  border-top: none;
}

#studentModeTabs + .tab-content .tab-pane {
  padding: 0;
}

#studentModeTabs + .tab-content .tab-pane.active {
  background-color: #f8f9ff;
  border: 1px solid #e6e9ef;
  border-radius: 6px;
  padding: 12px;
  margin-top: -1px;
}

/* =========================
   STUDENT STATUS
========================= */
.student-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fb;
  border: 1px solid #e6e9ef;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 6px;
}

#studentNameDisplay {
  font-weight: 600;
  color: #333;
  transition: all 0.2s ease;
}

#studentProgress {
  color: #6c757d;
}

.student-status.flash {
  background: #e7f1ff;
  transform: scale(1.02);
  transition: all 0.2s ease;
}

/* =========================
   MISC
========================= */
.toast {
  min-width: 260px;
}

#out {
  background-color: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.15s ease;
}

#errors {
  margin-bottom: 10px;
  font-family: monospace;
}

.error-item {
  cursor: pointer;
  margin-bottom: 4px;
}

.error-item:hover {
  text-decoration: underline;
}

#subjectBar {
  margin-left: auto;
  justify-content: flex-end;
}

#termSelector,
#classStudentLists {
  min-height: 38px;
}

/* =========================
   ANIMATIONS
========================= */
@keyframes copyPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(13,110,253,0.6);
    background-color: rgba(13,110,253,0.12);
  }
  50% {
    background-color: rgba(13,110,253,0.08);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(13,110,253,0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13,110,253,0);
    background-color: transparent;
  }
}

.copy-pulse {
  animation: copyPulse 0.8s ease-out;
}

/* =========================
   MOBILE ONLY
========================= */
@media (max-width: 768px) {
  .shortcut-help {
    display: none !important;
  }
}