body {
  background: #fff;
}

.learning-hero {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  color: var(--white);
  border-radius: 0 0 18px 18px;
  padding: 32px 0 24px;
  box-shadow: 0 6px 24px rgba(26, 124, 242, 0.2);
}

.learning-hero .headline {
  font-size: 2.35rem;
  font-weight: 700;
}

.learning-hero .subtitle {
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
}

.learning-hero .hero-badge span {
  font-size: 0.9rem;
}

.learning-hero .hero-back {
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.learning-hero .hero-back:hover {
  opacity: 0.85;
}

.learning-hero .hero-actions {
  gap: 0.5rem;
}

.learning-hero .hero-actions .btn {
  border-radius: 999px;
  padding: 10px 20px;
}

.hero-utility-btn {
  background: #fff !important;
  color: var(--primary-blue) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  font-weight: 600;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hero-utility-btn:hover,
.hero-utility-btn:focus {
  color: var(--primary-blue-dark) !important;
  box-shadow: 0 8px 20px rgba(10, 80, 180, 0.25);
  transform: translateY(-1px);
}

.learning-layout .manager-card {
  border-radius: 18px;
  border: 1px solid rgba(45, 140, 255, 0.18);
  box-shadow: 0 12px 32px rgba(26, 124, 242, 0.1);
}

.learning-layout .card-header {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-blue-dark) 100%);
  border-radius: 18px 18px 0 0;
  color: var(--white);
}

.learning-filters .form-label {
  font-weight: 600;
  color: #1f2a44;
}

.learning-filters .form-control,
.learning-filters .form-select {
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: none;
}

.learning-filters .form-control:focus,
.learning-filters .form-select:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(45, 140, 255, 0.2);
}

.material-card {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.material-card .card-body {
  padding: 14px 14px 12px;
}

.material-card .title {
  font-size: 0.98rem;
  font-weight: 600;
}

.material-card .type {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.material-card .btn.btn-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.preview-compact {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.material-card .url,
.material-card .tags,
.material-card .notes {
  font-size: 0.85rem;
}

.material-card .tags .badge {
  margin-right: 0.25rem;
}

.material-card .video-embed {
  margin-top: 0.5rem;
  border-radius: 10px;
  overflow: hidden;
}

.material-card .video-embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

textarea {
  resize: vertical;
}

.board-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  background: #fff;
  margin: 0 auto;
}

.board-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#previewModal .board-frame {
  width: min(80vmin, 800px);
  max-width: 90%;
}

#previewModal .modal-body.two-col {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

#previewModal .preview-left {
  flex: 7 1 0;
  display: flex;
  justify-content: center;
}

#previewModal .preview-right {
  flex: 3 1 0;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

/* Video mode: full-modal video, hide chess controls/sidebar */
#previewModal.video-mode .modal-body.two-col {
  display: block;
  padding: 0;
}

#previewModal.video-mode .preview-right,
#previewModal.video-mode .move-toolbar,
#previewModal.video-mode #modalMoveList {
  display: none !important;
}

#previewModal.video-mode .preview-left {
  flex: none;
  display: block;
}

#previewModal.video-mode .board-frame {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

#previewModal.video-mode .board-iframe {
  position: static;
  width: 100%;
  height: 100%;
}

#previewModal #modalMoveList {
  overflow: auto;
  padding-right: 0.25rem;
}

.card-move-controls {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 0.5rem;
}

.card-move-controls .move-toolbar {
  text-align: center;
}

.card-move-controls .mv-status {
  opacity: 0.8;
}

.card-move-list {
  display: block;
  max-height: 140px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.move-table {
  width: 100%;
}

.move-row {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  align-items: center;
  column-gap: 0.5rem;
  row-gap: 0.35rem;
  padding: 2px 0;
}

.move-num {
  width: 3ch;
  text-align: right;
}

.move-cell {
  justify-self: start;
}

.move-chip {
  min-width: 3.25rem;
  padding: 0.15rem 0.5rem;
}

@media (max-width: 991.98px) {
  .learning-hero .hero-actions {
    align-items: stretch;
  }

  .learning-hero .hero-actions .d-flex {
    justify-content: stretch !important;
  }
}
