/* Skillesia Classroom — charte #203A7C / #493781 / #80348A */

/* ——— Layout app : sidebar communauté uniquement sur l’onglet Community ——— */
.main .sidebar {
  display: none;
}

.main {
  grid-template-columns: 1fr;
  max-width: 1440px;
}

.main.layout-with-sidebar {
  grid-template-columns: 1fr 340px;
  max-width: 1280px;
}

.main.layout-with-sidebar .sidebar {
  display: block;
}

.main.layout-classroom {
  max-width: 1600px;
}

.main.layout-classroom .classroom-root {
  max-width: none;
  margin: 0;
  padding: 0;
}

.classroom-root {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px;
}

.main.layout-classroom .classroom-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 28px;
}

@media (min-width: 720px) {
  .main.layout-classroom .classroom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .main.layout-classroom .classroom-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.main.layout-classroom .classroom-detail {
  gap: 28px;
}

@media (min-width: 1024px) {
  .main.layout-classroom .classroom-detail {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  }
}

.classroom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.classroom-card {
  display: block;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(32, 58, 124, 0.06);
  transition: transform 0.25s, box-shadow 0.25s;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.classroom-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(32, 58, 124, 0.15);
}

.classroom-card-cover {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #203A7C 0%, #493781 50%, #80348A 100%);
  position: relative;
  overflow: hidden;
}

.classroom-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.classroom-card-cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title, Poppins, sans-serif);
  font-weight: 700;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.4);
}

.classroom-card-body {
  padding: 20px;
}

.classroom-card-title {
  font-family: var(--font-title, Poppins, sans-serif);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #22202B;
  font-size: 1.05rem;
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.classroom-card-desc {
  font-size: 13px;
  color: #6B7280;
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.classroom-progress-wrap {
  height: 28px;
  background: #F8F9FC;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.classroom-progress-bar {
  height: 100%;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 10%;
}

.classroom-progress-bar span {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.classroom-progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #6B7280;
}

.classroom-new-card {
  aspect-ratio: 4/5;
  border: 2px dashed #E5E7EB;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #6B7280;
  cursor: pointer;
  background: #fff;
  transition: all 0.25s;
  font-size: 14px;
  font-weight: 600;
}

.classroom-new-card:hover {
  border-color: #203A7C;
  color: #203A7C;
  background: #F8F9FC;
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(32, 58, 124, 0.08);
}

.classroom-new-card svg {
  width: 32px;
  height: 32px;
  color: #203A7C;
}

.classroom-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .classroom-detail {
    grid-template-columns: 340px 1fr;
  }
}

.classroom-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #203A7C;
  font-size: 14px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  margin-bottom: 16px;
  padding: 0;
  transition: color 0.2s;
}

.classroom-back:hover {
  color: #80348A;
}

.classroom-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}

.classroom-sidebar-header {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(32, 58, 124, 0.06);
}

.classroom-sidebar-title {
  font-family: var(--font-title, Poppins, sans-serif);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #22202B;
  font-size: 15px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.classroom-sidebar-progress {
  height: 8px;
  background: #F8F9FC;
  border-radius: 999px;
  overflow: hidden;
}

.classroom-sidebar-progress-fill {
  height: 100%;
  transition: width 0.5s;
}

.classroom-sidebar-progress-pct {
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  color: #6B7280;
  margin-top: 4px;
}

.classroom-lesson-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.classroom-lesson-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, border 0.2s;
  background: #fff;
  border: 1px solid transparent;
}

.classroom-lesson-item:hover {
  background: #F8F9FC;
}

.classroom-lesson-item.active {
  background: #FFF9E6;
  border-color: rgba(245, 158, 11, 0.3);
}

.classroom-lesson-item.draft {
  opacity: 0.65;
}

.classroom-lesson-item .drag-handle {
  color: #9CA3AF;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
}

.classroom-lesson-item:hover .drag-handle {
  opacity: 1;
}

.classroom-lesson-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #4B5563;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.classroom-lesson-item.active .classroom-lesson-title {
  color: #22202B;
}

.classroom-lesson-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #16A34A;
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.classroom-lesson-draft {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9CA3AF;
  flex-shrink: 0;
}

.classroom-add-page {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px dashed #E5E7EB;
  background: transparent;
  color: #6B7280;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 4px;
  transition: all 0.2s;
}

.classroom-add-page:hover {
  border-color: #203A7C;
  color: #203A7C;
  background: #F8F9FC;
}

.classroom-panel {
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 16px rgba(32, 58, 124, 0.06);
  min-width: 0;
}

.classroom-panel-title {
  width: 100%;
  font-family: var(--font-title, Poppins, sans-serif);
  font-size: 1.875rem;
  font-weight: 700;
  color: #22202B;
  border: none;
  outline: none;
  margin-bottom: 24px;
  background: transparent;
}

.classroom-panel-title-readonly {
  font-family: var(--font-title, Poppins, sans-serif);
  font-size: 1.875rem;
  font-weight: 700;
  color: #22202B;
  flex: 1;
  min-width: 0;
}

.classroom-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.classroom-complete-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid #E5E7EB;
  background: #fff;
  color: #9CA3AF;
}

.classroom-complete-btn:hover:not(:disabled) {
  border-color: #16A34A;
  color: #16A34A;
  background: rgba(22, 163, 74, 0.05);
}

.classroom-complete-btn.done {
  background: #16A34A;
  border-color: #16A34A;
  color: #fff;
}

.classroom-editor .ql-toolbar {
  border: 1px solid #E5E7EB !important;
  border-radius: 16px 16px 0 0 !important;
  background: #fff;
}

.classroom-editor .ql-container {
  border: 1px solid #E5E7EB !important;
  border-top: none !important;
  border-radius: 0 0 16px 16px !important;
  min-height: 300px;
}

.classroom-editor .ql-editor {
  min-height: 300px;
  color: #4B5563;
  line-height: 1.7;
}

.classroom-viewer-content {
  color: #4B5563;
  line-height: 1.7;
  font-size: 16px;
}

.classroom-viewer-content h1,
.classroom-viewer-content h2,
.classroom-viewer-content h3 {
  font-family: var(--font-title, Poppins, sans-serif);
  color: #22202B;
  font-weight: 700;
}

.classroom-viewer-content a {
  color: #203A7C;
}

.classroom-viewer-content img {
  max-width: 100%;
  border-radius: 12px;
}

.classroom-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #E5E7EB;
}

.classroom-section-title {
  font-family: var(--font-title, Poppins, sans-serif);
  font-weight: 600;
  font-size: 1.125rem;
  color: #22202B;
  margin-bottom: 16px;
}

.classroom-resource {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  margin-bottom: 8px;
}

.classroom-resource:hover {
  border-color: #203A7C;
  background: #F8F9FC;
}

.classroom-resource-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(32, 58, 124, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #203A7C;
  flex-shrink: 0;
}

.classroom-resource-link {
  flex: 1;
  color: #22202B;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
}

.classroom-resource-delete {
  opacity: 0;
  background: none;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
}

.classroom-resource:hover .classroom-resource-delete {
  opacity: 1;
}

.classroom-pinned {
  background: #F8F9FC;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 16px;
}

.classroom-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #E5E7EB;
}

.classroom-add-menu-wrap {
  position: relative;
}

.classroom-add-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.classroom-add-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  width: 260px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(32, 58, 124, 0.12);
  z-index: 20;
}

.classroom-add-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
}

.classroom-add-dropdown button:hover {
  background: #F8F9FC;
}

.classroom-editor-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.classroom-toggle {
  width: 40px;
  height: 24px;
  border-radius: 999px;
  border: none;
  position: relative;
  cursor: pointer;
  padding: 0;
}

.classroom-toggle.on { background: #16A34A; }
.classroom-toggle.off { background: #E5E7EB; }

.classroom-toggle-knob {
  position: absolute;
  top: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
}

.classroom-toggle.on .classroom-toggle-knob { left: 18px; }
.classroom-toggle.off .classroom-toggle-knob { left: 2px; }

.classroom-btn-cancel {
  padding: 10px 20px;
  font-weight: 600;
  text-transform: uppercase;
  color: #6B7280;
  background: none;
  border: none;
  cursor: pointer;
}

.classroom-btn-save {
  padding: 12px 24px;
  background: #203A7C;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.classroom-btn-save:hover:not(:disabled) {
  background: #493781;
}

.classroom-transcript {
  width: 100%;
  min-height: 200px;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  padding: 16px;
  outline: none;
  resize: vertical;
}

.classroom-transcript:focus {
  border-color: #203A7C;
  box-shadow: 0 0 0 4px rgba(32, 58, 124, 0.1);
}

.classroom-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(34, 32, 43, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.classroom-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  padding: 32px;
}

.classroom-field {
  position: relative;
  margin-bottom: 20px;
}

.classroom-field label {
  position: absolute;
  top: -8px;
  left: 12px;
  background: #fff;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: #203A7C;
}

.classroom-field input {
  width: 100%;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  padding: 16px;
  outline: none;
}

.classroom-field input:focus {
  border-color: #203A7C;
  box-shadow: 0 0 0 4px rgba(32, 58, 124, 0.1);
}

.classroom-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.classroom-modal-submit {
  padding: 12px 24px;
  background: #203A7C;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.classroom-lesson-item.dragging { opacity: 0.4; }
.classroom-lesson-item.drag-over { border-color: #203A7C; }

#page-classroom .classroom-empty { display: none; }

/* Inline media in lesson content */
.classroom-viewer-content .classroom-inline-video,
.classroom-viewer-content video {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  margin: 16px 0;
  background: #000;
}

.classroom-viewer-content .classroom-embed-video,
.classroom-viewer-content iframe.ql-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 12px;
  margin: 16px 0;
  min-height: 320px;
}

.classroom-viewer-content .classroom-inline-image,
.classroom-viewer-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 12px 0;
}

.classroom-transcript {
  white-space: pre-wrap;
  font-size: 14px;
  color: #4b5563;
}

/* Resource cards with inline preview */
.classroom-resources-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.classroom-resource-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.classroom-resource-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.classroom-resource-meta strong {
  display: block;
  font-size: 14px;
  color: #22202b;
}

.classroom-resource-type {
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.classroom-resource-delete {
  margin-left: auto;
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
}

.classroom-media-preview {
  background: #0f172a;
}

.classroom-media-preview video {
  width: 100%;
  display: block;
  max-height: 480px;
}

.classroom-media-preview img {
  width: 100%;
  display: block;
  max-height: 480px;
  object-fit: contain;
  background: #f8f9fc;
}

.classroom-pdf-preview {
  background: #f8f9fc;
  position: relative;
}

.classroom-pdf-preview iframe {
  width: 100%;
  height: 520px;
  border: none;
  display: block;
}

.classroom-pdf-open {
  display: block;
  text-align: center;
  padding: 10px;
  font-size: 13px;
  color: #203a7c;
  background: #fff;
  border-top: 1px solid #e5e7eb;
}

.classroom-resource-download {
  display: inline-block;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #203a7c;
}

.classroom-upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  background: #f8f9fc;
  transition: border 0.2s, background 0.2s;
}

.classroom-upload-zone:hover,
.classroom-upload-zone.has-file {
  border-color: #203a7c;
  background: rgba(32, 58, 124, 0.04);
}

.classroom-upload-zone small {
  display: block;
  margin-top: 6px;
  color: #9ca3af;
  font-size: 12px;
}
