/**
 * Estilos frontend - LMS Léo Mardeiras
 * Paleta: Primária #EB642F, Secundária #44332F
 */

/* === CORES PRINCIPAIS === */
:root {
  --lms-primary: #eb642f;
  --lms-secondary: #44332f;
  --lms-primary-light: #f17a4c;
  --lms-primary-dark: #c8501f;
  --lms-secondary-light: #5a453f;
  --lms-light: #f8f9fa;
  --lms-gray: #6c757d;
  --lms-success: #28a745;
  --lms-warning: #ffc107;
}

/* === LAYOUT GERAL === */
.lms-single-course {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.container {
  display: flex;
  justify-content: center;
  margin: auto;
  width: 1140px;
}

.course-header {
  background: linear-gradient(
    135deg,
    var(--lms-secondary-light) 0%,
    var(--lms-secondary) 100%
  );
  color: white;
  padding: 60px 0;
}

.course-hero {
  display: flex;
  gap: 40px;
  align-items: center;
}

.course-thumbnail {
  flex: 0 0 300px;
}

.course-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.course-info {
  flex: 1;
}

.course-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
}

.course-excerpt {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
  line-height: 1.6;
}

/* === LAYOUT DO CONTEÚDO === */
.course-content-wrapper {
  padding: 60px 0;
  background: #fff;
}

.course-layout {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 40px;
}

.course-main {
  min-width: 0;
}

.course-description {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 40px;
}

.course-description h2 {
  color: var(--lms-secondary);
  margin-bottom: 20px;
  font-size: 1.8rem;
}

/* === SIDEBAR === */
.course-sidebar {
  position: relative;
}

.course-meta-box {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  border-top: 4px solid var(--lms-primary);
  position: sticky;
  top: 20px;
}

.course-meta-box h3 {
  color: var(--lms-secondary);
  margin-bottom: 20px;
  font-size: 1.4rem;
}

.course-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 25px;
}

.course-meta li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.course-meta i {
  color: var(--lms-primary);
  font-size: 18px;
}

/* === PROGRESSO DO CURSO === */
.lms-course-progress {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

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

.progress-header h4 {
  margin: 0;
  font-size: 1.1rem;
}

.progress-percentage {
  font-weight: bold;
  font-size: 1.2rem;
}

.progress-bar {
  background: rgba(255, 255, 255, 0.2);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-fill {
  background: white;
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-details {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* === LIÇÕES === */
.lms-course-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.lms-lessons-list {
  /* Remove padding da lista */
}

.lms-lesson-item {
  border-bottom: 1px solid #eee;
  transition: all 0.3s ease;
}

.lms-lesson-item:last-child {
  border-bottom: none;
}

.lms-lesson-item.completed {
  background: rgba(40, 167, 69, 0.05);
}

.lesson-header {
  padding: 25px 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: background 0.3s ease;
}

.lesson-header:hover {
  background: var(--lms-light);
}

.lesson-number {
  background: var(--lms-primary);
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.lms-lesson-item.completed .lesson-number {
  background: var(--lms-success);
}

.lesson-title {
  flex: 1;
  margin: 0;
  font-size: 1.2rem;
  color: var(--lms-secondary);
}

.lesson-meta {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--lms-gray);
}

.lesson-status {
  display: flex;
  align-items: center;
  gap: 5px;
}

.lesson-status i {
  font-size: 16px;
}

.lms-lesson-item.completed .lesson-status {
  color: var(--lms-success);
}

.lesson-content {
  padding: 0 30px 30px;
  border-top: 1px solid #eee;
}

.lesson-video {
  margin-bottom: 25px;
}

.lesson-video iframe {
  width: 100%;
  height: 400px;
  border-radius: 8px;
}

.lesson-text {
  margin-bottom: 25px;
  line-height: 1.7;
}

/* === BOTÕES === */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-primary {
  background: var(--lms-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--lms-primary-dark);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-block {
  display: block;
  width: 100%;
}

.lms-mark-complete-btn {
  background: var(--lms-success);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.lms-mark-complete-btn:hover {
  background: #218838;
  transform: translateY(-2px);
}

.lms-mark-complete-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Botão de desmarcar lição */
.lms-unmark-complete-btn {
  background: var(--lms-warning);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.lms-unmark-complete-btn:hover {
  background: #d39e00;
  transform: translateY(-2px);
}

.lms-unmark-complete-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Container de ações das lições */
.lesson-actions {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

/* === LOGIN NECESSÁRIO === */
.course-login-required {
  text-align: center;
  padding: 60px 30px;
  background: var(--lms-light);
  border-radius: 12px;
}

.course-login-required h3 {
  color: var(--lms-secondary);
  margin-bottom: 15px;
}

.course-login-required p {
  color: var(--lms-gray);
  margin-bottom: 25px;
}

/* === RESPONSIVO === */
@media (max-width: 768px) {
  .course-hero {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }

  .course-thumbnail {
    flex: none;
    max-width: 250px;
    margin: 0 auto;
  }

  .course-title {
    font-size: 2rem;
  }

  .course-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .course-sidebar {
    order: -1;
  }

  .lesson-header {
    padding: 20px;
    gap: 15px;
  }

  .lesson-meta {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .lesson-content {
    padding: 0 20px 20px;
  }

  .lesson-video iframe {
    height: 250px;
  }
}

/* === ANIMAÇÕES === */
@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
    padding-top: 0;
    padding-bottom: 30px;
  }
}

.lesson-content.show {
  animation: slideDown 0.3s ease-out;
}

/* === LOADING STATES === */
.lms-loading {
  opacity: 0.6;
  pointer-events: none;
}

.lms-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--lms-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* === NOTIFICAÇÕES === */
.lms-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  z-index: 10000;
  min-width: 300px;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s ease;
}

.lms-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.lms-notification.success {
  background: var(--lms-success);
}

.lms-notification.error {
  background: var(--lms-error);
}

.lms-notification.info {
  background: var(--lms-primary);
}

/* === MATERIAIS DE APOIO === */
.lesson-support-materials {
  margin: 25px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid var(--lms-primary);
}

.lesson-support-materials h4 {
  margin: 0 0 15px 0;
  color: var(--lms-secondary);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.support-materials-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-material-item {
  background: white;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.support-material-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  text-decoration: none;
  color: var(--lms-secondary);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.support-material-link:hover {
  background: #f1f3f4;
  color: var(--lms-primary);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.material-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.material-name {
  flex: 1;
  font-weight: 500;
}

.material-size {
  font-size: 0.85rem;
  color: #666;
  opacity: 0.8;
}

.download-icon {
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.support-material-link:hover .download-icon {
  opacity: 1;
}

/* Responsividade para materiais */
@media (max-width: 768px) {
  .lesson-support-materials {
    margin: 20px -15px;
    border-radius: 0;
    border-left: none;
    border-top: 4px solid var(--lms-primary);
  }

  .support-material-link {
    flex-wrap: wrap;
    gap: 8px;
  }

  .material-name {
    word-break: break-word;
  }
}
