/* ═══════════════════════════════════════════════════
   Trail Preview — Public View
   Aesthetic: Editorial / Course Landing Page
   ═══════════════════════════════════════════════════ */

/* ===== Stagger animation ===== */
@keyframes stmw-tp-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stmw-tp-hero,
.stmw-tp-content-card,
.stmw-tp-criteria-card,
.stmw-tp-sidebar,
.stmw-tp-lesson {
  animation: stmw-tp-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ===== Hero ===== */
.stmw-tp-hero {
  position: relative;
  border-radius: var(--stmw-radius-card, 12px);
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
}

.stmw-tp-hero-bg {
  position: absolute;
  inset: 0;
}

.stmw-tp-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stmw-tp-hero-bg--fallback {
  background: linear-gradient(135deg, #1a1035 0%, #2d1b69 40%, #6337fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stmw-tp-hero-bg--fallback i {
  font-size: 80px;
  color: rgba(255, 255, 255, 0.08);
}

.stmw-tp-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 8, 20, 0.92) 0%,
    rgba(10, 8, 20, 0.65) 40%,
    rgba(10, 8, 20, 0.20) 100%
  );
}

.stmw-tp-hero-content {
  position: relative;
  z-index: 1;
  padding: 2rem 2rem 1.75rem;
  width: 100%;
}

.stmw-tp-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.75rem;
}

.stmw-tp-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1.4;
}

.stmw-tp-badge--discipline {
  background: color-mix(in srgb, var(--badge-color, #6337fe) 18%, transparent);
  color: var(--badge-color, #6337fe);
  border: 1px solid color-mix(in srgb, var(--badge-color, #6337fe) 30%, transparent);
}

.stmw-tp-badge--serie {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.stmw-tp-badge--level {
  background: rgba(207, 254, 90, 0.15);
  color: #cffe5a;
  border: 1px solid rgba(207, 254, 90, 0.25);
}

.stmw-tp-hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.stmw-tp-hero-desc {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0 0 0.75rem;
  max-width: 680px;
}

.stmw-tp-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.stmw-tp-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.stmw-tp-hero-meta i {
  font-size: 16px;
  color: rgba(207, 254, 90, 0.7);
}

/* ===== Section headings ===== */
.stmw-tp-section-heading {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.25rem;
  letter-spacing: -0.2px;
}

.stmw-tp-section-heading--sm {
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.stmw-tp-section-heading-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(99, 55, 254, 0.08);
  color: var(--stmw-primary, #6337fe);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* ===== Content card ===== */
.stmw-tp-content-card {
  border-radius: var(--stmw-radius-card, 12px);
}

/* ===== Lessons list ===== */
.stmw-tp-lessons {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stmw-tp-lesson {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 1rem 0.5rem;
  border-bottom: 1px solid var(--bs-border-color);
  transition: background 0.15s ease;
}

.stmw-tp-lesson:last-child {
  border-bottom: none;
}

.stmw-tp-lesson:hover {
  background: rgba(99, 55, 254, 0.025);
}

.stmw-tp-lesson--preview {
  cursor: default;
}

.stmw-tp-lesson--preview:hover {
  background: transparent;
}

/* Aula com data de publicação futura */
.stmw-tp-lesson--future {
  cursor: not-allowed;
  opacity: 0.68;
}

.stmw-tp-lesson--future:hover {
  background: transparent;
}

.stmw-tp-lesson-soon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #e08b00;
  background: rgba(224, 139, 0, 0.1);
  border-radius: 100px;
  padding: 2px 8px;
  margin-top: 4px;
}

.stmw-tp-lesson--link {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.stmw-tp-lesson--link:hover {
  color: inherit;
}

/* Lesson number */
.stmw-tp-lesson-number {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bs-tertiary-bg, #f5f5f9);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.stmw-tp-lesson-number span {
  font-size: 13px;
  font-weight: 800;
  color: var(--stmw-primary, #6337fe);
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

/* Lesson body */
.stmw-tp-lesson-body {
  flex: 1;
  min-width: 0;
}

.stmw-tp-lesson-title {
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.35;
  margin-bottom: 4px;
}

.stmw-tp-lesson-desc {
  font-size: 13px;
  color: var(--bs-secondary-color);
  line-height: 1.5;
  margin-bottom: 6px;
}

/* Content type tags */
.stmw-tp-lesson-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.stmw-tp-content-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(99, 55, 254, 0.08);
  color: var(--stmw-primary, #6337fe);
}

.stmw-tp-content-tag i {
  font-size: 13px;
}

.stmw-tp-content-tag--empty {
  background: var(--bs-tertiary-bg, #f5f5f9);
  color: var(--bs-secondary-color);
  font-style: italic;
  font-weight: 400;
}

/* Lock icon (not enrolled) */
.stmw-tp-lesson-lock {
  flex-shrink: 0;
  color: var(--bs-secondary-color);
  opacity: 0.4;
  font-size: 18px;
  margin-top: 10px;
}

/* ===== Empty state ===== */
.stmw-tp-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.stmw-tp-empty i {
  font-size: 48px;
  color: var(--bs-secondary-color);
  opacity: 0.4;
}

.stmw-tp-empty p {
  color: var(--bs-secondary-color);
  font-size: 0.9375rem;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* ===== Criteria card ===== */
.stmw-tp-criteria-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stmw-tp-criteria-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--bs-body-color);
}

.stmw-tp-criteria-item i {
  font-size: 20px;
  color: var(--stmw-primary, #6337fe);
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.stmw-tp-criteria-item--score {
  padding-top: 10px;
  border-top: 1px solid var(--bs-border-color);
  margin-top: 4px;
}

.stmw-tp-criteria-item--score i {
  color: #f59e0b;
}

/* ===== Sidebar ===== */
.stmw-tp-sidebar {
  position: sticky;
  top: 5rem;
}

/* ===== Enroll card ===== */
.stmw-tp-enroll-card {
  border-radius: var(--stmw-radius-card, 12px);
  border: 2px solid var(--stmw-primary, #6337fe);
  overflow: hidden;
}

.stmw-tp-enroll-card .card-body {
  padding: 1.5rem;
}

.stmw-tp-enroll-header {
  margin-bottom: 1.25rem;
}

.stmw-tp-enroll-label {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  display: block;
}

.stmw-tp-enroll-label--info {
  color: var(--bs-info);
}

/* Enroll stats row */
.stmw-tp-enroll-stats {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  overflow: hidden;
}

.stmw-tp-enroll-stat {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 0.5rem;
  justify-content: center;
  text-align: center;
}

.stmw-tp-enroll-stat + .stmw-tp-enroll-stat {
  border-left: 1px solid var(--bs-border-color);
}

.stmw-tp-enroll-stat i {
  font-size: 20px;
  color: var(--stmw-primary, #6337fe);
  flex-shrink: 0;
}

.stmw-tp-enroll-stat div {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.stmw-tp-enroll-stat strong {
  font-size: 14px;
  font-weight: 700;
}

.stmw-tp-enroll-stat span {
  font-size: 11px;
  color: var(--bs-secondary-color);
}

/* Enroll button */
.stmw-tp-btn-enroll {
  background: var(--stmw-primary, #6337fe);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 12px 20px;
  border-radius: var(--stmw-radius-btn, 8px);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stmw-tp-btn-enroll:hover:not(:disabled) {
  background: #5228e0;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 55, 254, 0.35);
}

.stmw-tp-btn-enroll:active:not(:disabled) {
  transform: translateY(0);
}

.stmw-tp-btn-enroll:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* Error message */
.stmw-tp-enroll-error {
  margin-top: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #dc2626;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.stmw-tp-enroll-error i {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ===== Enrolled state ===== */
.stmw-tp-enrolled-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #16a34a;
  margin-bottom: 1rem;
}

.stmw-tp-enrolled-badge i {
  font-size: 20px;
}

/* Progress bar */
.stmw-tp-progress-section {
  margin-bottom: 1.25rem;
}

.stmw-tp-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.stmw-tp-progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.stmw-tp-progress-value {
  font-size: 14px;
  font-weight: 800;
  color: var(--stmw-primary, #6337fe);
}

.stmw-tp-progress-bar {
  height: 8px;
  border-radius: 4px;
  background: var(--bs-tertiary-bg, #f5f5f9);
  overflow: hidden;
}

.stmw-tp-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--stmw-primary, #6337fe), #8b5cf6);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 4px;
}

/* Continue button */
.stmw-tp-btn-continue {
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--stmw-radius-btn, 8px);
}

/* ===== Details card ===== */
.stmw-tp-details-card {
  border-radius: var(--stmw-radius-card, 12px);
}

.stmw-tp-details-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stmw-tp-details-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
}

.stmw-tp-details-list li i {
  font-size: 18px;
  color: var(--bs-secondary-color);
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
  .stmw-tp-sidebar {
    position: static;
  }

  .stmw-tp-hero {
    min-height: 220px;
  }

  .stmw-tp-hero-title {
    font-size: 1.375rem;
  }

  .stmw-tp-hero-content {
    padding: 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .stmw-tp-hero {
    min-height: 200px;
    border-radius: 10px;
  }

  .stmw-tp-hero-title {
    font-size: 1.25rem;
  }

  .stmw-tp-hero-content {
    padding: 1.25rem;
  }

  .stmw-tp-hero-meta {
    gap: 10px;
    font-size: 12px;
  }

  .stmw-tp-lesson {
    gap: 10px;
    padding: 0.875rem 0.25rem;
  }

  .stmw-tp-lesson-number {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .stmw-tp-lesson-number span {
    font-size: 11px;
  }

  .stmw-tp-enroll-stat {
    flex-direction: column;
    gap: 4px;
    padding: 0.625rem 0.25rem;
  }
}

/* ===== Dark mode ===== */
html[data-bs-theme="dark"] .stmw-tp-hero-overlay {
  background: linear-gradient(
    to top,
    rgba(10, 8, 20, 0.95) 0%,
    rgba(10, 8, 20, 0.7) 40%,
    rgba(10, 8, 20, 0.3) 100%
  );
}

html[data-bs-theme="dark"] .stmw-tp-lesson:hover {
  background: rgba(255, 255, 255, 0.025);
}

html[data-bs-theme="dark"] .stmw-tp-lesson--preview:hover {
  background: transparent;
}

html[data-bs-theme="dark"] .stmw-tp-lesson--future:hover {
  background: transparent;
}

html[data-bs-theme="dark"] .stmw-tp-lesson-soon {
  color: #f0a500;
  background: rgba(240, 165, 0, 0.12);
}

html[data-bs-theme="dark"] .stmw-tp-content-tag {
  background: rgba(99, 55, 254, 0.15);
}

html[data-bs-theme="dark"] .stmw-tp-lesson-number {
  background: rgba(255, 255, 255, 0.06);
}

html[data-bs-theme="dark"] .stmw-tp-content-tag {
  background: rgba(255, 255, 255, 0.06);
}

html[data-bs-theme="dark"] .stmw-tp-enroll-card {
  border-color: rgba(208, 255, 89, 0.5);
}

html[data-bs-theme="dark"] .stmw-tp-btn-enroll {
  background: var(--bs-primary);
  color: var(--sw-on-primary, #1B2306);
}

html[data-bs-theme="dark"] .stmw-tp-btn-enroll:hover:not(:disabled) {
  background: #b8e84e;
  color: var(--sw-on-primary, #1B2306);
  box-shadow: 0 6px 20px rgba(208, 255, 89, 0.25);
}

html[data-bs-theme="dark"] .stmw-tp-enrolled-badge {
  color: #4ade80;
}

html[data-bs-theme="dark"] .stmw-tp-progress-fill {
  background: linear-gradient(90deg, var(--bs-primary), #b8e84e);
}

html[data-bs-theme="dark"] .stmw-tp-progress-bar {
  background: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .stmw-tp-section-heading-icon {
  background: rgba(208, 255, 89, 0.1);
  color: var(--bs-primary);
}

html[data-bs-theme="dark"] .stmw-tp-badge--discipline {
  background: color-mix(in srgb, var(--badge-color, #d0ff59) 15%, transparent);
  color: var(--badge-color, #d0ff59);
  border-color: color-mix(in srgb, var(--badge-color, #d0ff59) 25%, transparent);
}

html[data-bs-theme="dark"] .stmw-tp-enroll-error {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.25);
  color: #f87171;
}
