:root {
  --lms-radius: 16px;
  --lms-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --lms-border: 1px solid rgba(0, 0, 0, 0.08);
  --lms-bg: #ffffff;
  --lms-text: #1f2937;
  --lms-muted: #6b7280;
  --lms-brand: #2563eb;
  --lms-pill-bg: #f1f5f9;
  --lms-pill-text: #475569;
}

/* =============================================
   LMS Video Card - Design Vertical (Maquette UX)
   ============================================= */
.lms-video-card {
  display: flex;
  flex-direction: column;
  background: var(--lms-bg);
  border: var(--lms-border);
  border-radius: var(--lms-radius);
  box-shadow: var(--lms-shadow);
  overflow: hidden;
  margin: 24px 0;
  max-width: 100%;
}

/* Thumbnail en haut - ratio 16:9 */
.lms-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #e5e7eb;
  display: block;
  text-decoration: none;
  cursor: pointer;
  border: none;
  padding: 0;
  font: inherit;
  overflow: hidden;
}

.lms-thumb:hover .lms-thumb-img {
  transform: scale(1.02);
}

.lms-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

/* Bouton play centré sur le thumbnail */
.lms-thumb::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  transition: transform 0.2s ease;
}

.lms-thumb:hover::before {
  transform: translate(-50%, -50%) scale(1.08);
}

.lms-thumb .lms-play-triangle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-35%, -50%);
  width: 0;
  height: 0;
  border-left: 18px solid #111827;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  pointer-events: none;
}

/* Contenu sous le thumbnail */
.lms-content {
  padding: 20px 24px 24px;
}

/* Barre de tags horizontale */
.lms-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.lms-pill {
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--lms-pill-bg);
  color: var(--lms-pill-text);
  line-height: 1.2;
}

.lms-pill--muted {
  background: #f8fafc;
  color: var(--lms-muted);
}

.lms-pill--provider {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 600;
}

.lms-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--lms-text);
}

.lms-desc {
  margin: 0 0 18px;
  color: var(--lms-muted);
  font-size: 15px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lms-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.lms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #374151;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lms-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.lms-btn--primary {
  background: var(--lms-brand);
  color: #fff;
  border-color: var(--lms-brand);
}

a.lms-btn.lms-btn--primary {
  text-decoration: none;
  color: white !important;
}

.lms-btn--primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.lms-media {
  margin-top: 16px;
}

.lms-video {
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  background: #000;
}

.lms-iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
  background: #000;
}

/* Responsive - Mobile */
@media (max-width: 600px) {
  .lms-content {
    padding: 16px 18px 20px;
  }
  .lms-title {
    font-size: 18px;
  }
  .lms-desc {
    font-size: 14px;
    -webkit-line-clamp: 2;
  }
  .lms-actions {
    flex-direction: column;
  }
  .lms-btn {
    width: 100%;
  }
}

/* =============================================
   Fullscreen UX Overlay (modal côté LMS)
   ============================================= */
.lms-video-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.lms-video-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.lms-video-overlay__content {
  position: relative;
  max-width: 720px;
  width: 92%;
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
  transform: translateY(24px) scale(0.96);
  transition: transform 0.3s ease;
}

.lms-video-overlay.is-open .lms-video-overlay__content {
  transform: translateY(0) scale(1);
}

.lms-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #f3f4f6;
  color: #374151;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lms-overlay-close:hover {
  background: #e5e7eb;
}

.lms-overlay-thumb {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 20px;
}

.lms-overlay-provider {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--lms-pill-bg, #eef2ff);
  color: var(--lms-pill-text, #3730a3);
  margin-bottom: 12px;
}

.lms-overlay-title {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--lms-text, #1f2937);
}

.lms-overlay-desc {
  margin: 0 0 24px;
  color: var(--lms-muted, #6b7280);
  line-height: 1.6;
  font-size: 15px;
}

.lms-overlay-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.lms-overlay-actions .lms-btn {
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
}

@media (max-width: 600px) {
  .lms-video-overlay__content {
    padding: 20px;
    border-radius: 16px;
  }
  .lms-overlay-title {
    font-size: 18px;
  }
  .lms-overlay-thumb {
    max-height: 200px;
  }
}

/* Notice pédagogique */
.lms-overlay-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 16px;
  background: #f0f4ff;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
}

.lms-overlay-notice-icon {
  flex-shrink: 0;
  color: #6366f1;
  margin-top: 1px;
}

.lms-overlay-notice-link {
  color: #4f46e5;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lms-overlay-notice-link:hover {
  color: #4338ca;
}
