/* Stylesheet for Método Extra G */

:root {
  /* Colors from design tokens */
  --theme-color: #06b6d4;         /* Cyan highlight */
  --theme-hover-color: #0891b2;
  --background-color: #ffffff;
  --text-color: #525252;
  --heading-color: #09090b;       /* Black headers */
  --border-color: #e6e6e6;
  --shadow-color: rgba(0, 0, 0, 0.05);
  --success-color: #16a34a;       /* Green for success buttons/badges */
  --success-hover: #15803d;
  --danger-color: #dc2626;
  
  /* Layout variables */
  --element-size: 56px;
  --border-radius: 16px;          /* rounded-2xl style */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: #f7f7f9;
  color: var(--text-color);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* Application Wrapper */
.app-wrapper {
  width: 100%;
  max-width: 480px; /* Centered quiz card size */
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--background-color);
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  position: relative;
  transition: max-width 0.4s ease-in-out;
  overflow-x: hidden; /* Prevent horizontal overflows */
}

/* Expand container width for Sales Page to fit media blocks */
.app-wrapper.sales-page-active {
  max-width: 600px;
}

/* Text block wraps to prevent text layout breaks */
.text-block {
  width: 100%;
  margin-bottom: 1rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

/* Bounce arrow animation */
@keyframes bounceDown {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

/* Header & Progress Bar */
.quiz-header {
  padding: 1.25rem 1.5rem 0.75rem 1.5rem;
  background-color: var(--background-color);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.back-btn {
  background: none;
  border: 1px solid var(--border-color);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--heading-color);
  transition: all 0.2s ease;
}

.back-btn:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
}

.back-btn svg {
  width: 18px;
  height: 18px;
}

.step-indicator {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--theme-color);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: #f3f4f6;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--theme-color);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 10px;
}

/* Content Area */
.quiz-content {
  flex-grow: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

/* Animations for step transitions */
.step-container {
  width: 100%;
  animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typography styles */
h1, h2, h3, h4 {
  color: var(--heading-color);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.17rem; }

.ql-align-center {
  text-align: center;
}

p {
  margin-bottom: 0.75rem;
}

p.ql-align-center {
  text-align: center;
}

strong {
  font-weight: 700;
}

.ql-size-small {
  font-size: 0.75rem;
  color: #71717a;
  display: block;
}

/* Spacers */
.spacer-clear {
  width: 100%;
  display: block;
}

/* Quiz Option list */
.options-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  width: 100%;
  margin: 1.25rem 0;
}

/* Option Card */
.option-item {
  width: 100%;
  min-height: var(--element-size);
  padding: 1rem 1.25rem;
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 2px 4px var(--shadow-color);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  user-select: none;
}

.option-item:hover {
  border-color: var(--theme-color);
  background-color: rgba(6, 182, 212, 0.02);
  transform: translateY(-1px);
}

.option-item.active {
  border-color: var(--theme-color);
  background-color: rgba(6, 182, 212, 0.08);
  box-shadow: 0 4px 10px rgba(6, 182, 212, 0.1);
}

.option-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--heading-color);
  display: flex;
  align-items: center;
}

.option-label p, .option-label strong {
  margin-bottom: 0;
}

/* Option Select Circle Indicator */
.option-select-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #bfbfbf;
  background-color: var(--background-color);
  flex-shrink: 0;
  margin-left: 0.75rem;
  position: relative;
  transition: all 0.2s ease;
}

.option-item.active .option-select-indicator {
  border-color: var(--theme-color);
  background-color: var(--theme-color);
}

.option-item.active .option-select-indicator::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ffffff;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Custom styles for start aligned indicator (Step 1) */
.option-item.indicator-start {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

.option-item.indicator-start .option-select-indicator {
  margin-left: 0;
  margin-right: 0.75rem;
}

/* Standard Buttons */
.btn-action {
  width: 100%;
  min-height: var(--element-size);
  border-radius: var(--border-radius);
  border: none;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Theme Cyan Button */
.btn-action.btn-theme {
  background-color: var(--theme-color);
  color: #ffffff;
}

.btn-action.btn-theme:hover {
  background-color: var(--theme-hover-color);
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(6, 182, 212, 0.2);
}

/* Success Green Button */
.btn-action.btn-success {
  background-color: var(--success-color);
  color: #ffffff;
}

.btn-action.btn-success:hover {
  background-color: var(--success-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(22, 163, 74, 0.25);
}

/* Pulsing micro-animation */
.btn-pulse {
  animation: pulseEffect 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulseEffect {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  }
  50% {
    transform: scale(1.025);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  }
}

/* Loading Spinners */
.loading-spinner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  width: 100%;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-color);
  border-top-color: var(--theme-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Image container */
.quiz-image-container {
  width: 100%;
  margin: 1.25rem 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.quiz-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Checklist Cards (Step 8) */
.checklist-card {
  width: 100%;
  border-radius: var(--border-radius);
  padding: 1.25rem;
  border-width: 1px;
  border-style: solid;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.checklist-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.checklist-text {
  font-size: 0.95rem;
  color: var(--heading-color);
  line-height: 1.4;
}

.checklist-text p {
  margin-bottom: 0;
}

/* Arguments/Grid Section (Step 8) */
.arguments-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.argument-card {
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: #fafafa;
}

.argument-card h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.argument-card p {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-bottom: 0;
}

/* Video embed container */
.video-embed-container {
  width: 100%;
  margin: 1.5rem 0;
  border-radius: var(--border-radius);
  overflow: hidden;
  background-color: #000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  position: relative;
}

.video-ratio-square {
  padding-bottom: 100%; /* 1:1 Aspect Ratio */
  height: 0;
}

.video-embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* FAQ accordion styles */
.faq-container {
  width: 100%;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  background-color: var(--background-color);
}

.faq-trigger {
  width: 100%;
  padding: 1.25rem;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--heading-color);
}

.faq-trigger:hover {
  background-color: #fafafa;
}

.faq-icon-chevron {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.faq-item.active .faq-icon-chevron {
  transform: rotate(180deg);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #fafafa;
  border-top: 0 solid var(--border-color);
}

.faq-item.active .faq-content {
  border-top-width: 1px;
}

.faq-answer {
  padding: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-color);
}

.faq-answer p {
  margin-bottom: 0.75rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* Footer Section */
footer {
  padding-top: 1.5rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

footer p {
  margin-bottom: 0.75rem;
}

footer a {
  color: var(--theme-color);
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}

/* Utility alignments */
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

/* Custom margins and sizing */
.h-\[1rem\] { height: 1rem; }
.h-\[2rem\] { height: 2rem; }

/* Responsive adjustments */
@media (max-width: 480px) {
  body {
    background-color: var(--background-color);
  }
  .app-wrapper {
    box-shadow: none;
  }
  .quiz-content {
    padding: 1.25rem 1rem;
  }
}
