/* ===== VARIÁVEIS CSS ===== */
:root {
  --primary-wine: #722f37;
  --secondary-wine: #8b3a42;
  --light-wine: #a64d57;
  --dark-wine: #5a252b;
  --accent-gold: #d4af37;
  --light-gold: #f4e4a6;
  --neutral-light: #f8f9fa;
  --neutral-medium: #e9ecef;
  --neutral-dark: #495057;
  --text-primary: #2c3e50;
  --text-secondary: #6c757d;
  --success-green: #28a745;
  --danger-red: #dc3545;
  --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-heavy: 0 8px 15px rgba(0, 0, 0, 0.2);
  --border-radius: 8px;
  --border-radius-large: 12px;
  --transition: all 0.3s ease;
}

/* ===== RESET E BASE ===== */
* {
  box-sizing: border-box;
}

.course-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
  min-height: 100vh;
}

/* ===== CABEÇALHO DO CURSO ===== */
.course-header {
  background: linear-gradient(135deg, var(--primary-wine) 0%, var(--secondary-wine) 100%);
  color: white;
  padding: 3rem 2.5rem;
  border-radius: var(--border-radius-large);
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-heavy);
  position: relative;
  overflow: hidden;
}

.course-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: translate(50%, -50%);
}

.course-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
}

.course-description {
  font-size: 1.2rem;
  margin: 0;
  opacity: 0.95;
  max-width: 80%;
  position: relative;
  z-index: 1;
}

/* ===== AÇÕES DE PARTICIPAÇÃO ===== */
.course-actions {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-medium);
  margin-bottom: 2.5rem;
  border: 1px solid var(--neutral-medium);
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.action-form {
  margin: 0;
}

.button-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== BOTÕES ===== */
.button-join,
.button-exit,
.button-materials,
.button-forum,
.button-disabled {
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-light);
  min-width: 140px;
  justify-content: center;
}

.button-join {
  background: linear-gradient(135deg, var(--success-green) 0%, #20963a 100%);
  color: white;
}

.button-join:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  background: linear-gradient(135deg, #20963a 0%, #1e7e34 100%);
}

.button-exit {
  background: linear-gradient(135deg, var(--danger-red) 0%, #c82333 100%);
  color: white;
}

.button-exit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

.button-materials {
  background: linear-gradient(135deg, var(--primary-wine) 0%, var(--secondary-wine) 100%);
  color: white;
}

.button-materials:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  background: linear-gradient(135deg, var(--secondary-wine) 0%, var(--light-wine) 100%);
}

.button-forum {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #b8941f 100%);
  color: var(--dark-wine);
}

.button-forum:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  background: linear-gradient(135deg, #b8941f 0%, #9c7c1a 100%);
}

.button-disabled {
  background: var(--neutral-medium);
  color: var(--text-secondary);
  cursor: not-allowed;
  opacity: 0.6;
}

/* ===== SEÇÕES ===== */
.course-rating-section,
.course-comments-section {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-medium);
  margin-bottom: 2.5rem;
  border: 1px solid var(--neutral-medium);
}

.course-rating-section h2,
.course-comments-section h2 {
  color: var(--primary-wine);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--accent-gold);
  display: inline-block;
}

/* ===== AVALIAÇÃO COM ESTRELAS ===== */
.course-rating-stars {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.star {
  font-size: 1.75rem;
  color: var(--neutral-medium);
  transition: var(--transition);
}

.star.filled {
  color: var(--accent-gold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.star.half {
  background: linear-gradient(90deg, var(--accent-gold) 50%, var(--neutral-medium) 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rating-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-wine);
}

.rating-count {
  font-size: 1rem;
  color: var(--text-secondary);
  font-style: italic;
}

.no-rating {
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem;
  background: var(--neutral-light);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--accent-gold);
}

/* ===== COMENTÁRIOS ===== */
.course-comments-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.course-comment {
  background: var(--neutral-light);
  border: 1px solid var(--neutral-medium);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.course-comment:last-child {
  margin-bottom: 0;
}

.course-comment:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  border-color: var(--light-wine);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.comment-user {
  font-weight: 700;
  color: var(--primary-wine);
  font-size: 1.1rem;
}

.comment-rating .star {
  font-size: 1.25rem;
}

.comment-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-left: auto;
}

.comment-body {
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 1rem;
}

.no-comments {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 2rem;
  background: var(--neutral-light);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--accent-gold);
}

/* ===== LINK DE VOLTA ===== */
.back-link {
  margin-top: 3rem;
  text-align: center;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-wine);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--primary-wine);
  border-radius: var(--border-radius);
  transition: var(--transition);
  background: white;
}

.back-link a:hover {
  background: var(--primary-wine);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .course-page {
    padding: 1rem;
  }
  
  .course-header {
    padding: 2rem 1.5rem;
  }
  
  .course-title {
    font-size: 2rem;
  }
  
  .course-description {
    max-width: 100%;
    font-size: 1.1rem;
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .button-join,
  .button-exit,
  .button-materials,
  .button-forum,
  .button-disabled {
    width: 100%;
    min-width: auto;
  }
  
  .comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .comment-date {
    margin-left: 0;
  }
  
  .course-rating-stars {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .course-page {
    padding: 0.5rem;
  }
  
  .course-header,
  .course-actions,
  .course-rating-section,
  .course-comments-section {
    padding: 1.5rem;
  }
  
  .course-title {
    font-size: 1.75rem;
  }
  
  .star {
    font-size: 1.5rem;
  }
  
  .comment-rating .star {
    font-size: 1rem;
  }
}