:root {
  --background: 214 30% 96%;
  --foreground: 222 25% 10%;
  --card: 0 0% 100%;
  --card-foreground: 222 25% 15%;
  --primary: 250 84% 60%;
  --primary-foreground: 0 0% 100%;
  --primary-glow: 260 100% 75%;
  --primary-dark: 250 84% 52%;
  --secondary: 216 35% 95%;
  --secondary-foreground: 220 15% 30%;
  --muted: 216 35% 92%;
  --muted-foreground: 220 10% 45%;
  --accent: 280 90% 68%;
  --accent-foreground: 0 0% 100%;
  --success: 145 80% 45%;
  --success-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 214 20% 85%;
  --input: 214 25% 93%;
  --ring: 250 84% 60%;

  --shadow-sm: 0 1px 2px hsl(220 20% 50% / 0.07);
  --shadow-md: 0 3px 6px hsl(220 20% 50% / 0.08);
  --shadow-lg: 0 10px 15px hsl(220 20% 50% / 0.1);
  --shadow-xl: 0 20px 25px hsl(220 20% 50% / 0.1);
  --shadow-glow: 0 0 40px hsl(var(--primary) / 0.3);

  --font-heading: "Poppins", sans-serif;
  --font-body: "Inter", sans-serif;
  --gradient-primary: linear-gradient(
    135deg,
    hsl(var(--primary)) 0%,
    hsl(var(--accent)) 100%
  );
  --gradient-card: linear-gradient(
    145deg,
    hsl(var(--card)) 0%,
    hsl(var(--muted)) 100%
  );
  --gradient-hero: linear-gradient(
    135deg,
    hsl(var(--primary)) 0%,
    hsl(var(--accent)) 50%,
    hsl(310 85% 70%) 100%
  );
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 0.75rem;
}

html.dark {
  --background: 222 47% 11%;
  --foreground: 210 40% 96%;
  --card: 222 47% 14%;
  --card-foreground: 210 40% 98%;
  --primary: 250 80% 65%;
  --primary-foreground: 0 0% 100%;
  --primary-glow: 260 100% 80%;
  --primary-dark: 250 80% 58%;
  --secondary: 222 47% 18%;
  --secondary-foreground: 210 40% 85%;
  --muted: 222 47% 22%;
  --muted-foreground: 215 20% 65%;
  --accent: 280 85% 72%;
  --accent-foreground: 0 0% 100%;
  --success: 145 70% 50%;
  --success-foreground: 0 0% 100%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 100%;
  --border: 217 33% 25%;
  --input: 217 33% 20%;
  --ring: 250 80% 65%;

  --shadow-sm: 0 1px 2px hsl(0 0% 0% / 0.1);
  --shadow-md: 0 3px 6px hsl(0 0% 0% / 0.12);
  --shadow-lg: 0 10px 15px hsl(0 0% 0% / 0.15);
  --shadow-xl: 0 20px 25px hsl(0 0% 0% / 0.15);
  --shadow-glow: 0 0 60px hsl(var(--primary) / 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  /* background-color: hsl(var(--card) / 0.8); */
  backdrop-filter: blur(5px);
  border: 1px solid hsl(var(--border));
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  /* color: hsl(var(--foreground)); */
  transition: var(--transition-smooth);
}
.theme-toggle:hover {
  background-color: hsl(var(--muted));
  transform: scale(1.1);
}
.theme-toggle svg {
  width: 24px;
  height: 24px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.hero-section {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--gradient-hero);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url("assets/images/IA.png");
  background-size: cover;
  background-position: center;
  background-blend-mode: overlay;
  opacity: 0.2;
}
.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  animation: fadeIn 0.8s ease-out;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}
.hero-accent {
  color: #372894d9;
  text-shadow: 0 0 30px #4a2baf;
}
.hero-description {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  color: #ffffffe6;
  margin-bottom: 3rem;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}
.features-icons {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.feature-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  background-color: #ffffff1a;
  backdrop-filter: blur(8px);
  border: 1px solid #ffffff33;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  transition: var(--transition-smooth);
}
.feature-icon svg {
  color: #fff;
}
.feature-item span {
  color: #ffffffcc;
  font-size: 0.875rem;
  font-weight: 500;
}
.feature-item:hover .feature-icon {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 1rem;
}
.generator-card {
  max-width: 64rem;
  margin: 0 auto 4rem;
  background: var(--gradient-card);
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: 1rem;
  box-shadow: var(--shadow-xl);
  animation: fadeIn 0.4s ease-out;
}
.card-header {
  text-align: center;
  padding: 2rem 2rem 1.5rem;
}
.card-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
}
.card-description {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
}
.mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  background-color: hsl(var(--muted));
  border-radius: 0.75rem;
  margin-top: 1.5rem;
}
.mode-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: var(--transition-smooth);
}
.mode-label.active {
  color: hsl(var(--primary));
}
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: hsl(var(--muted-foreground));
  transition: 0.4s;
  border-radius: 28px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: #fff;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px #00000033;
}
input:checked + .slider {
  background-color: hsl(var(--primary));
}
input:checked + .slider:before {
  transform: translateX(22px);
}
.card-content {
  padding: 0 2rem 2rem;
}
.trilha-form {
  display: flex;
}
.tema-input {
  flex: 1;
  height: 3.5rem;
  padding: 0 1rem;
  font-size: 1.125rem;
  background-color: hsl(var(--input));
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: 0.5rem;
  color: hsl(var(--foreground));
  font-family: var(--font-body);
  transition: var(--transition-smooth);
}
.tema-input:focus {
  outline: 0;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}
.generate-btn {
  height: 3.5rem;
  padding: 0 2rem;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  font-family: var(--font-body);
}
.generate-btn:hover {
  opacity: 0.9;
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}
.btn-icon {
  width: 20px;
  height: 20px;
}
.loading-indicator {
  text-align: center;
  padding: 2.5rem;
  animation: fadeIn 0.4s ease-out;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid hsl(var(--primary));
  border-bottom-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}
.loading-indicator p {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
}
.trilhas-section {
  animation: fadeIn 0.5s ease-out;
}
.trilhas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.trilhas-header h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}
.clear-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: transparent;
  color: hsl(var(--destructive));
  border: 1px solid hsl(var(--destructive));
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: var(--font-body);
}
.clear-btn:hover {
  background-color: hsl(var(--destructive));
  color: #fff;
}
.trilhas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}
.trilha-card {
  background: var(--gradient-card);
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.4s ease-out;
  display: flex;
  flex-direction: column;
}
.trilha-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xl);
}
.trilha-header {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-grow: 1;
}
#trilhas-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 32px;
}
.trilha-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.trilha-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: hsl(var(--primary-glow));
  margin-bottom: 0.5rem;
  transition: var(--transition-smooth);
}
.trilha-description {
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
  flex-grow: 1;
}
.trilha-card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid hsl(var(--border));
}

.delete-trilha-btn {
  background: 0 0;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: var(--transition-smooth);
  opacity: 0;
}
.trilha-card:hover .delete-trilha-btn {
  opacity: 1;
}
.delete-trilha-btn:hover {
  color: hsl(var(--destructive));
  background-color: hsl(var(--destructive) / 0.1);
}
.trilha-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.progress-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}
.progress-header span:first-child {
  font-weight: 500;
  color: hsl(var(--foreground));
}
.progress-percent {
  font-weight: 600;
  color: hsl(var(--primary));
}
.progress-bar {
  height: 0.5rem;
  background-color: hsl(var(--muted));
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-fill {
  height: 100%;
  background-color: hsl(var(--primary));
  border-radius: 9999px;
  transition: width 0.5s ease;
}
.trilha-footer {
  padding: 0;
}
.continue-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  font-family: var(--font-body);
  background: var(--gradient-primary);
}
.trilha-card:hover .continue-btn {
  transform: scale(1.01);
  box-shadow: var(--shadow-glow);
}

#prompt-modal,
#certificate-modal,
#confirmation-modal,
#support-modal,
#certificate-preview-modal,
#tutorial-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}
.modal-content {
  background-color: hsl(var(--card));
  padding: 32px;
  border-radius: 12px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease-out;
  position: relative;
}
#certificate-modal .modal-content {
  max-width: 550px;
}
#confirmation-modal .modal-content {
  max-width: 500px;
  gap: 0;
}
#confirmation-modal p {
  color: hsl(var(--muted-foreground));
  margin: 1rem 0 1.5rem;
  line-height: 1.5;
}
#certificate-modal .form-group {
  margin-bottom: 1rem;
}
#certificate-modal label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}
#certificate-modal input[type="text"] {
  width: 100%;
  padding: 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  outline-color: hsl(var(--primary));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}
#certificate-modal p {
  margin-bottom: 1.5rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}
.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 24px;
  background: 0 0;
  border: none;
  font-size: 2.2rem;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s ease;
}
.modal-close-btn:hover {
  color: hsl(var(--muted-foreground));
}
.modal-content h2 {
  font-size: 1.5rem;
  color: hsl(var(--foreground));
  padding-right: 30px;
}
.modal-prompt,
#response-input {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid hsl(var(--border));
  padding: 16px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 0.9rem;
  border-radius: 8px;
  width: 100%;
  font-family: "SF Mono", "Consolas", monospace;
}
.modal-prompt {
  height: 200px;
  overflow-y: scroll;
}
#response-input {
  min-height: 25vh;
  resize: vertical;
}
.modal-actions {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}
.modal-btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}
#copy-prompt-btn {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
#copy-prompt-btn:hover {
  background-color: hsl(var(--border));
}
#submit-response-btn,
#save-certificate-btn,
#show-certificate-btn {
  background-color: hsl(var(--primary));
  color: #fff;
}
#submit-response-btn:hover,
#save-certificate-btn:hover {
  background-color: hsl(var(--primary-dark));
}
.confirmation-btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}
.btn-confirm {
  background-color: hsl(var(--destructive));
  color: #fff;
}
.btn-confirm:hover {
  background-color: hsl(var(--destructive));
}
.btn-cancel {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
.btn-cancel:hover {
  background-color: hsl(var(--border));
}
#modal-error-message {
  color: hsl(var(--destructive));
  text-align: center;
  font-size: 0.9rem;
}

.mobile-header {
  display: none;
  background: hsl(var(--card));
  border-bottom: 1px solid hsl(var(--border));
  padding: 1rem;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}
.mobile-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.mobile-toggle-btn:hover {
  background: hsl(var(--primary-dark));
}
.progress-indicator {
  font-size: 0.9rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}
.learning-layout {
  display: flex;
  min-height: 100vh;
}
.learning-sidebar {
  width: 320px;
  background: hsl(var(--secondary));
  border-right: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: transform var(--transition-smooth);
  z-index: 100;
}
.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}
.sidebar-title-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.close-sidebar-btn {
  display: none;
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius);
  transition: var(--transition-smooth);
}
.close-sidebar-btn:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}
#sidebar-title {
  font-size: 1.25rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: hsl(var(--foreground));
  line-height: 1.4;
}
.back-to-dashboard-btn {
  width: 100%;
  margin-bottom: 1.5rem;
  justify-content: center;
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  padding: 0.75rem;
  border-radius: var(--radius);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}
.back-to-dashboard-btn:hover {
  background: hsl(var(--muted));
  border-color: hsl(var(--primary));
}
.overall-progress {
  margin-top: 1rem;
}
.progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.progress-text span:first-child {
  color: hsl(var(--muted-foreground));
}
.progress-text span:last-child {
  font-weight: 600;
  color: hsl(var(--foreground));
}
.modules-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}
.module-section {
  margin-bottom: 2rem;
}
.module-header {
  margin-bottom: 1rem;
}
.module-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.subtopics-list {
  list-style: none;
}
.subtopic-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  border-left: 3px solid transparent;
}
.subtopic-item:hover:not(.locked) {
  background: hsl(var(--muted));
  border-left-color: hsl(var(--primary));
}
.subtopic-item.active {
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  border-left-color: hsl(var(--primary));
  font-weight: 600;
}
.subtopic-item.completed {
  color: hsl(var(--success));
}
.subtopic-item.completed .subtopic-title {
  color: hsl(var(--success));
  text-decoration: line-through;
  opacity: 0.8;
}
.subtopic-item.locked {
  color: hsl(var(--muted-foreground));
  cursor: not-allowed;
  opacity: 0.6;
}
.subtopic-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}
.subtopic-content {
  flex: 1;
  min-width: 0;
}
.subtopic-title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  color: hsl(var(--card-foreground));
}
.active .subtopic-title {
  color: hsl(var(--primary));
}
.learning-main {
  flex: 1;
  min-width: 0;
  background: hsl(var(--background));
}
.content-container {
  max-width: 90%;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.content-header {
  margin-bottom: 2rem;
  animation: fadeIn 0.5s ease-out;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1rem;
  font-weight: 500;
}
.content-title-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}
.title-info h1 {
  font-size: 2.2rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.content-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  animation: fadeIn 0.6s ease-out;
}
.learning-content {
  padding: 2rem;
  line-height: 1.7;
}
.learning-content strong {
  font-weight: 600;
  color: hsl(var(--card-foreground));
}
.learning-content code {
  background-color: hsl(var(--muted));
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: monospace;
}
.learning-content pre {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  padding: 1em;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
}
.learning-content pre code {
  background: none;
  padding: 0;
}
.content-navigation {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 1.5rem;
  gap: 1rem;
  animation: fadeIn 0.7s ease-out;
}

.narrative-content {
  font-size: 1.3rem;
}
.options-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}
.option-btn {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--card-foreground));
  padding: 1rem;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  border-radius: var(--radius);
}
.option-btn:hover:not(:disabled) {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
  transform: translateY(-2px);
  background-color: hsl(var(--muted));
}
.btn-primary-action {
  background: var(--gradient-primary);
  color: hsl(var(--primary-foreground));
  border: none;
}
.btn-primary-action:hover {
  color: hsl(var(--primary-foreground));
  opacity: 0.9;
  box-shadow: var(--shadow-glow);
}
.quiz-question {
  margin-bottom: 2rem;
}
.quiz-options {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}
.quiz-option {
  margin: 0.5rem 0;
}
.quiz-option label {
  display: block;
  padding: 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.quiz-option input[type="radio"] {
  display: none;
}
.quiz-option input[type="radio"]:checked + label {
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
.quiz-option label:hover {
  border-color: hsl(var(--primary));
  background-color: hsl(var(--muted));
}
.quiz-option.correct label {
  background-color: hsl(var(--success) / 0.1);
  border-color: hsl(var(--success));
}
.quiz-option.incorrect label {
  background-color: hsl(var(--destructive) / 0.1);
  border-color: hsl(var(--destructive));
}
#quiz-result {
  padding: 1.5rem;
  margin-top: 2rem;
  border-radius: var(--radius);
  text-align: center;
}
#quiz-result.passed {
  background-color: hsl(var(--success) / 0.1);
  border: 1px solid hsl(var(--success));
  color: hsl(var(--success));
}
#quiz-result.failed {
  background-color: hsl(var(--destructive) / 0.1);
  border: 1px solid hsl(var(--destructive));
  color: hsl(var(--destructive));
}
#review-mistakes-btn {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
}
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  transition: opacity var(--transition-smooth);
}

@media (max-width: 768px) {
  .trilha-form {
    flex-direction: column;
    gap: 0.75rem;
  }

  .tema-input {
    padding: 20px 1rem;
  }

  .mobile-header {
    display: flex;
  }
  .learning-layout {
    flex-direction: column;
  }
  .learning-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }
  .learning-sidebar.open {
    transform: translateX(0);
  }
  .close-sidebar-btn {
    display: block;
  }
  .content-container {
    padding: 2rem 1rem;
  }
  .title-info h1 {
    font-size: 1.7rem;
  }
}

#history-toggle-btn {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  text-align: center;
  width: 100%;
  margin-bottom: 1.5rem;
  transition: background-color 0.2s;
}
#history-toggle-btn:hover {
  background-color: hsl(var(--border));
}
#history-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out;
  border-bottom: 2px solid transparent;
}
#history-content.visible {
  max-height: 99999999px;
  border-bottom-color: hsl(var(--border));
  margin-bottom: 2rem;
}
.chat-history-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 0.5rem 0.5rem 2rem 0.5rem;
}
.chat-message {
  padding: 1rem;
  border-radius: 12px;
  max-width: 85%;
  line-height: 1.6;
  border: 1px solid hsl(var(--border));
}
.model-message {
  background-color: hsl(var(--muted));
  align-self: flex-start;
  border-bottom-left-radius: 0;
}
.user-message {
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--foreground));
  border-color: hsl(var(--primary) / 0.3);
  align-self: flex-end;
  text-align: right;
  border-bottom-right-radius: 0;
}
.user-message p {
  font-style: italic;
}
.user-message p strong {
  font-weight: 600;
}

#support-link-btn {
  background-color: hsl(var(--success));
  color: white;
  text-decoration: none;
  text-align: center;
}
#support-link-btn:hover {
  background-color: hsl(145, 85%, 40%);
}
.btn-donate {
  background: linear-gradient(135deg, hsl(340 82% 52%), hsl(340 92% 62%));
  color: white;
  box-shadow: 0 4px 20px hsl(340 92% 62% / 0.2);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
#support-modal {
  text-align: center;
}

.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1001;
  background-color: hsl(var(--card) / 0.8);
  backdrop-filter: blur(5px);
  border: 1px solid hsl(var(--border));
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: hsl(var(--foreground));
  transition: var(--transition-smooth);
}

.theme-toggle:hover {
  background-color: hsl(var(--muted));
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 24px;
  height: 24px;
}

.hidden {
  display: none !important;
}

#submit-quiz-btn,
#start-quiz-btn,
#submit-user-text,
#generate-certificate-prompt-btn {
  color: #fff;
}

#user-text-input {
  width: 100%;
  min-height: 100px;
  resize: none;
  box-sizing: border-box;
  background-color: hsl(var(--input));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#user-text-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 1px hsl(var(--primary));
}

#user-text-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.tutor-feedback {
  padding: 15px;
  border-radius: 10px;
  border-left: 4px solid hsl(var(--primary));
}

.sugestion {
  margin: 10px 0;
  font-size: 15px;
  font-style: italic;
}

#certificate-preview-modal .modal-content {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border: 1px solid #323238;
  background-color: #121214;
  background-image: radial-gradient(circle at 10% 20%, #4a2f6c55, #13111c 80%);
}
#certificate-preview-modal .modal-close-btn {
  color: white;
  text-shadow: 0 1px 2px black;
}

.certificate-preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

#certificado-container-render {
  width: 900px;
  height: 636px;
  color: #e1e1e6;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  padding: 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  border: 1px solid #261a49;
  background-color: #080814;
  font-family: "Manrope", sans-serif;
  background-image: radial-gradient(circle at 10% 20%, #080814, #1d113f 80%);
}

#certificado-container-render::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20;
  width: 100%;
  height: 100%;
  background-image: url("assets/images/placa-de.png"),
    radial-gradient(
      circle at 10% 20%,
      rgba(8, 8, 20, 0.15),
      rgba(29, 17, 63, 0.15) 80%
    );
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.04;
  z-index: 0;
}
.certificado-title-render {
  position: absolute;
  top: 35px;
  left: 40px;
  margin: 0;
  font-weight: 800;
  color: #0ad8e1;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.hero-accent-render {
  color: #fff;
  text-shadow: 0 0 7px rgba(153, 109, 255, 0.8),
    0 0 10px rgba(153, 109, 255, 0.6), 0 0 20px rgba(255, 255, 255, 0.7);
}

.certificado-main-render {
  text-align: center;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  max-height: calc(100% - 190px);
  gap: 10px;
}

.certificado-main-render h2 {
  text-transform: uppercase;
  font-size: 32px;
  color: #e1e1e6;
  font-weight: 700;
  padding-top: 10px;
}

.texto-confirmacao-render,
.texto-conclusao-render {
  font-size: 15px;
  color: #5eedf2;
  text-transform: uppercase;
  margin: 0;
}

.titulo-certificado {
  text-transform: uppercase;
  font-size: 28px;
  color: #e1e1e6;
}

#nome-aluno-render {
  font-size: 40px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.34px;
  line-height: 1.2;
  text-transform: uppercase;
  padding: 5px 0;
}

#nome-curso-render {
  font-size: 22px;
  font-weight: 400;
  color: #e1e1e6;
  margin: 5px 0 0 0;
}

.certificado-footer-render {
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  padding: 18px 40px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid #323238;
  color: #a8a8b3;
}

.assinatura-block-render {
  text-align: center;
}

.assinatura-svg-render {
  width: 160px;
  height: 80px;
  margin-bottom: -25px;
}

.assinatura-block-render p {
  margin-top: 10px;
  font-size: 12px;
  color: #e1e1e6;
}

.linha-assinatura-render {
  border: 0;
  border-top: 1px solid #34343a;
  width: 100%;
  margin: 0 auto;
}

#download-certificate-btn {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
#download-certificate-btn:hover {
  background: hsl(var(--primary-dark));
}

@media (max-width: 900px) {
  #certificado-container-render {
    transform: scale(0.8);
  }
}
@media (max-width: 768px) {
  #certificado-container-render {
    transform: scale(0.6);
  }
}
@media (max-width: 500px) {
  #certificado-container-render {
    transform: scale(0.4);
  }
}

@media print {
  body > *:not(#certificate-preview-modal) {
    display: none;
  }

  #certificate-preview-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    box-shadow: none;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #certificate-preview-modal .modal-close-btn,
  #download-certificate-btn {
    display: none;
  }

  #certificado-container-render {
    width: 28cm;
    height: 19.8cm;
    transform: scale(1) !important;
    box-shadow: none;
    border: 1px solid #323238;
  }

  #certificado-container-render * {
    visibility: visible;
  }
}

.chatbot-toggle-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  background: #fff;
  color: hsl(var(--primary-foreground));
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-xl);
  transition: var(--transition-smooth);
  z-index: 9999;
}

.chatbot-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

.chatbot-container {
  position: fixed;
  bottom: 7rem;
  right: 2rem;
  width: 400px;
  height: 60vh;
  max-height: 550px;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 9999;
  transform: translateY(20px);
  opacity: 0;
}

.chatbot-container:not(.hidden) {
  transform: translateY(0);
  opacity: 1;
}

.chatbot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--secondary));
}

.chatbot-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--card-foreground));
  margin: 0;
}

.chatbot-close-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-close-btn:hover {
  background-color: hsl(var(--muted));
}

.chatbot-body {
  flex-grow: 1;
  overflow: hidden;
}

.chatbot-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

@media (max-width: 768px) {
  .modal-prompt {
    height: 79px;
  }

  #response-input {
    min-height: 20vh;
  }

  .modal-content {
    max-width: 95%;
    padding: 24px;
    max-height: 90vh;
    overflow: auto;
  }

  .chatbot-toggle-btn {
    width: 50px;
    height: 50px;
    bottom: 1.5rem;
    right: 1.5rem;
  }

  .chatbot-container {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    bottom: auto;
    right: auto;
  }
}

#settings-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}

#settings-modal.hidden {
  display: none;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
}

#settings-modal .modal-content {
  max-width: 500px;
  width: 90%;
  z-index: 2001;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid hsl(var(--border));
}

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

.setting-item label {
  font-weight: 500;
  color: hsl(var(--card-foreground));
}

#change-name-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

#change-name-btn:hover {
  background-color: hsl(var(--border));
}

#tutorial-step-content {
  margin: 1.5rem 0;
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
}

#tutorial-step-content strong {
  color: hsl(var(--card-foreground));
}

#tutorial-progress {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: hsl(var(--border));
  transition: all 0.3s ease;
}

.progress-dot.active {
  background-color: hsl(var(--primary));
  transform: scale(1.1);
}

#tutorial-skip-btn {
  background-color: transparent;
  color: hsl(var(--muted-foreground));
}
#tutorial-skip-btn:hover {
  background-color: hsl(var(--muted));
}

#tutorial-prev-btn {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
#tutorial-prev-btn:hover {
  background-color: hsl(var(--border));
}

#tutorial-next-btn,
#tutorial-finish-btn {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.zoom-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: var(--transition-smooth);
}

.zoom-btn:hover {
  background-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

#zoom-level-display {
  font-weight: 500;
  color: hsl(var(--card-foreground));
  min-width: 50px;
  text-align: center;
}
