/* ===========================================================
   LAB.CSS - AWS Developer Course Schedule
   
   Estilos específicos para o sistema de laboratórios
   @author Tomas Alric - Cloud Basics
   @version 2.2
   =========================================================== */

/* ===========================================================
   LAB ICON (CRONOGRAMA)
   =========================================================== */

.lab-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}

.lab-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  object-fit: contain;
  opacity: 0.85;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.lab-icon-btn:hover .lab-icon {
  transform: scale(1.05);
  opacity: 1;
}

/* ===========================================================
   LAB PAGE (WORKSHOP)
   =========================================================== */

.lab-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #020617, #020617);
  color: var(--text-main);
  display: grid;
  grid-template-columns: 280px 1fr;
}

/* ===========================================================
   LAB SIDEBAR
   =========================================================== */

.lab-sidebar {
  border-right: 1px solid var(--border);
  padding: 24px;
  background: #020617;
}

.lab-sidebar h2 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.lab-sidebar h2:hover {
  background: rgba(13, 148, 136, 0.08);
  color: var(--primary);
}

.lab-sidebar h2.active {
  background: rgba(13, 148, 136, 0.12);
  color: var(--primary);
  font-weight: 500;
}

/* ✅ REMOVER COMPLETAMENTE BULLETS */
.lab-steps,
#lab-steps {
  list-style: none;
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.lab-steps > li,
#lab-steps > li {
  list-style: none;
  list-style-type: none;
  position: relative;
  margin-bottom: 4px;
}

/* ===========================================================
   TÓPICOS PRINCIPAIS (MACRO)
   =========================================================== */

.lab-step-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.lab-step-arrow {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
  cursor: pointer;
  background-image: url("../assets/images/common/arrow-lab.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.85;
  user-select: none;
}

.lab-step-arrow:hover {
  opacity: 1;
  transform: scale(1.15);
}

.lab-step-arrow.expanded {
  transform: rotate(90deg);
}

.lab-step-arrow.expanded:hover {
  transform: rotate(90deg) scale(1.15);
}

.lab-step-text {
  flex: 1;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.2s ease;
  user-select: none;
}

.lab-step-text:hover {
  color: var(--primary);
}

.lab-step-container.active {
  background: rgba(13, 148, 136, 0.12);
}

.lab-step-container.active .lab-step-text {
  color: var(--primary);
  font-weight: 500;
}

.lab-step-container.active .lab-step-arrow {
  opacity: 1;
}

/* ===========================================================
   SUBTÓPICOS (MICRO) - NÍVEL 1
   =========================================================== */

.lab-substeps {
  list-style: none;
  list-style-type: none;
  padding: 0;
  margin: 4px 0 0 28px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 0;
}

.lab-substeps.expanded {
  max-height: 1000px;
  opacity: 1;
}

/* Subtópico simples (SEM arrow) */
.lab-substep {
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  list-style: none;
  list-style-type: none;
}

.lab-substep:hover {
  background: rgba(13, 148, 136, 0.08);
  color: var(--primary);
}

/* Subtópico com tópicos internos (COM arrow) */
.lab-substep-parent {
  list-style: none;
  list-style-type: none;
  margin-bottom: 2px;
}

.lab-substep-container {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.lab-substep-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
  cursor: pointer;
  background-image: url("../assets/images/common/arrow-lab.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.75;
  user-select: none;
}

.lab-substep-arrow:hover {
  opacity: 1;
  transform: scale(1.1);
}

.lab-substep-arrow.expanded {
  transform: rotate(90deg);
}

.lab-substep-arrow.expanded:hover {
  transform: rotate(90deg) scale(1.1);
}

.lab-substep-text {
  flex: 1;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s ease;
  user-select: none;
}

.lab-substep-text:hover {
  color: var(--primary);
}

.lab-substep-container:hover {
  background: rgba(13, 148, 136, 0.08);
}

/* ===========================================================
   TÓPICOS INTERNOS (dentro de subtópicos) - NÍVEL 2
   =========================================================== */

.lab-inner-topics {
  list-style: none;
  list-style-type: none;
  padding: 0;
  margin: 2px 0 0 22px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 0;
}

.lab-inner-topics.expanded {
  max-height: 500px;
  opacity: 1;
}

.lab-inner-topic {
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  list-style: none;
  list-style-type: none;
}

.lab-inner-topic:hover {
  background: rgba(13, 148, 136, 0.06);
  color: var(--primary);
}

/* ===========================================================
   BACK BUTTON
   =========================================================== */

.lab-back-container {
  display: flex;
  justify-content: center;
  padding: 12px 16px;
  margin-top: 18px;
  border-top: 1px dashed rgba(255, 255, 255, 0.03);
}

.lab-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--secondary);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.lab-back-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.lab-back-btn:hover {
  background: rgba(255, 255, 255, 0.02);
  transform: translateY(-2px);
}

/* ===========================================================
   LAB CONTENT
   =========================================================== */

.lab-content {
  padding: 40px;
  max-width: 900px;
}

.lab-title {
  font-size: 28px;
  margin-bottom: 8px;
}

.lab-meta {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.lab-step {
  margin-bottom: 40px;
}

.lab-step h3 {
  font-size: 20px;
  margin-bottom: 12px;
}

.lab-step p {
  line-height: 1.6;
}

.lab-code {
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  overflow-x: auto;
  color: #e5e7eb;
}

.lab-image {
  margin: 16px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  max-width: 100%;
}

#lab-intro-img {
  display: block;
  width: 100%;
  max-width: 1100px;
  margin: 32px auto 40px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.lab-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid #f59e0b;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  color: var(--text-main);
  font-size: 14px;
}

/* ===========================================================
   LAB NAVIGATION
   =========================================================== */

.lab-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
}

.lab-action-btn {
  padding: 12px 20px;
  border-radius: 8px;
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.lab-action-btn.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.lab-action-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.lab-action-btn:active {
  transform: translateY(0);
}

/* ===========================================================
   LAB COMPLETE
   =========================================================== */

.lab-complete {
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid #16a34a;
  border-radius: 12px;
  padding: 24px;
  margin-top: 48px;
}

.lab-complete h3 {
  color: #16a34a;
  margin-bottom: 8px;
}

/* ===========================================================
   RESPONSIVE (MOBILE)
   =========================================================== */

@media (max-width: 768px) {
  .lab-page {
    grid-template-columns: 1fr;
  }

  .lab-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }

  .lab-content {
    padding: 24px 16px;
  }
}

/* ===========================================================
   LAB ERROR STATE
   =========================================================== */

#lab-error {
  max-width: 600px;
  width: 100%;
  padding: 48px 32px;
  text-align: center;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  display: none;
}

/* ✅ CENTRALIZAR QUANDO ERRO ESTÁ ATIVO */
.lab-content.error-state {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px;
  max-width: none !important;
}

#lab-error .error-icon {
  font-size: 64px;
  margin-bottom: 24px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

#lab-error .error-title {
  font-size: 24px;
  font-weight: 600;
  color: #ef4444;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

#lab-error .error-message {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 32px;
}

#lab-error .error-suggestions {
  background: rgba(13, 148, 136, 0.05);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 12px;
  padding: 24px;
  text-align: left;
}

#lab-error .error-suggestions h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#lab-error .error-suggestions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#lab-error .error-suggestions li {
  padding: 8px 0 8px 28px;
  color: var(--text-muted);
  font-size: 14px;
  position: relative;
  line-height: 1.5;
}

#lab-error .error-suggestions li::before {
  content: "→";
  position: absolute;
  left: 8px;
  color: var(--primary);
  font-weight: bold;
}

.error-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.error-back-btn:hover {
  background: #0f766e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.error-back-btn:active {
  transform: translateY(0);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .lab-content.error-state {
    padding: 24px 16px;
  }

  #lab-error {
    padding: 32px 24px;
  }
}
