/* CSS Design System - Quiz Lipedema Funnel */

:root {
  --theme-color: #16a34a;
  --theme-color-hover: #15803d;
  --theme-color-light: #f0fdf4;
  --theme-color-border: #dcfce7;
  --theme-text-color: #052e16;
  --theme-text-light: #166534;
  --theme-bg-page: #f9fafb;
  --theme-bg-card: #ffffff;
  --theme-border-color: #e5e7eb;
  --theme-border-hover: #16a34a;
  --theme-danger-color: #dc2626;
  --theme-danger-bg: #fef2f2;
  --theme-font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --theme-rounded: 1rem;
  --theme-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --theme-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

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

body {
  font-family: var(--theme-font);
  background-color: var(--theme-bg-page);
  color: var(--theme-text-color);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Main Layout */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 0.75rem; /* Small side padding for mobile */
  align-items: center;
  background-color: #ffffff;
}

.app-header {
  width: 100%;
  max-width: 440px; /* Reduced width for tight desktop layout */
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.app-logo {
  max-height: 52px;
  width: auto;
  object-fit: contain;
}

.main-content {
  width: 100%;
  max-width: 440px; /* Reduced width for tight desktop layout */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Quiz Card Styling - Completely borderless and flat */
.quiz-card {
  background-color: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 480px;
  width: 100%;
  border: none;
  box-shadow: none;
}

/* Progress Bar Styling */
.progress-bar-container {
  padding: 1rem 1.25rem 0.5rem;
  border-bottom: 1px solid var(--theme-border-color);
}

.progress-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.back-button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--theme-text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border-radius: 50%;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.back-button:hover {
  background-color: var(--theme-color-light);
  transform: translateX(-2px);
}

.back-button.hidden {
  visibility: hidden;
  pointer-events: none;
}

.progress-text {
  display: none !important;
}

.progress-bar-track {
  height: 6px;
  background-color: var(--theme-border-color);
  border-radius: 99px;
  overflow: hidden;
}

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

/* Step Render Area with Animations */
.step-render-area {
  padding: 0.75rem 0.5rem; /* Reduced padding for wider elements layout */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

@media (min-width: 480px) {
  .step-render-area {
    padding: 1.25rem 1rem;
  }
}

.step-content {
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  display: flex;
  flex-direction: column;
  gap: 1rem; /* Tightened gap between layers */
  width: 100%;
}

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

/* Standard HTML Layer styles (Quill outputs) */
.step-content h1, .step-content h2, .step-content h3 {
  color: var(--theme-text-color);
  line-height: 1.25;
  margin-bottom: 0.5rem;
  text-align: center;
}

.step-content h1 { 
  font-size: 1.45rem; /* Slightly reduced to fit lines */
  font-weight: 800; 
  text-wrap: balance !important; /* Prevents widow words */
}
.step-content h2 { 
  font-size: 1.25rem; /* Slightly reduced to fit lines */
  font-weight: 800; 
  text-wrap: balance !important;
}
.step-content h3 { 
  font-size: 1.1rem; 
  font-weight: 700; 
  text-wrap: balance !important;
}

.step-content p {
  font-size: 0.925rem;
  line-height: 1.35;
  text-align: center;
  margin-bottom: 0.5rem;
  text-wrap: pretty !important; /* Prevents single word lines */
}

/* Also ensure options introduction headers match */
.options-intro h1 {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--theme-text-color);
  text-align: center;
  margin-bottom: 0.5rem;
  text-wrap: balance !important;
}

.options-intro p {
  font-size: 0.925rem;
  color: var(--theme-text-light);
  line-height: 1.35;
  text-align: center;
  margin-bottom: 0.5rem;
  text-wrap: pretty !important;
}

/* Option List & Grid Layouts */
.options-container {
  display: grid !important;
  gap: 0.75rem !important;
  width: 100% !important;
}

.grid-cols-1 { grid-template-cols: 1fr !important; }
.grid-cols-2 { grid-template-cols: repeat(2, 1fr) !important; gap: 0.75rem !important; }

/* Option Cards styling */
.option-card {
  background-color: #eef7f2; /* Light green/mint background */
  border: 1px solid #c3e6cb; /* Thin green border */
  border-radius: 0.75rem;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 60px;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  word-break: break-word;
  overflow-wrap: break-word;
}

.option-card:hover {
  border-color: var(--theme-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(22, 163, 74, 0.08);
}

.option-card:active {
  transform: translateY(0);
}

.option-card.active {
  border-color: var(--theme-color);
  background-color: var(--theme-color-light);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}

/* No Icon alignment */
.option-card.no-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.option-card.no-icon .option-label {
  width: 100%;
  text-align: center;
  font-size: 1rem;
}

/* Vertical Orientation (Stacked) - Used when grid-cols-2 has images */
.option-card.vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  text-align: left;
  justify-content: space-between;
}

.option-card.vertical .option-image {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  border-radius: 0.5rem;
}

.option-card.vertical .option-emoji {
  font-size: 2.25rem;
  margin-bottom: 0.25rem;
}

/* Bottom wrapper for vertical cards */
.option-bottom {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: auto;
  gap: 0.5rem;
}

.option-card.vertical .option-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--theme-text-color);
  line-height: 1.3;
  flex-grow: 1;
}

/* Horizontal Orientation (Row) - Standard list items and emoji choices */
.option-card.horizontal {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.875rem;
  padding: 0.75rem 1rem; /* Compact height */
  text-align: left;
}

.option-card.horizontal .option-image {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 0.375rem;
  flex-shrink: 0;
}

.option-card.horizontal .option-emoji {
  font-size: 1.75rem;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.option-card.horizontal .option-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--theme-text-color);
  flex-grow: 1;
  line-height: 1.35;
  text-wrap: pretty !important;
  word-break: break-word;
  overflow-wrap: break-word;
}

.option-card.active .option-label {
  color: var(--theme-text-light);
}

/* Choice select indicator icon (circle with green arrow) */
.option-indicator {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--theme-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
}

.option-card.horizontal .option-indicator {
  margin-left: auto;
}

/* Arrow inside indicator */
.option-indicator::after {
  content: '';
  width: 5px;
  height: 5px;
  border-top: 1.5px solid var(--theme-color);
  border-right: 1.5px solid var(--theme-color);
  transform: rotate(45deg);
  margin-right: 2px; /* Center arrow alignment */
  opacity: 1;
  transition: all 0.2s ease;
}

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

.option-card.active .option-indicator::after {
  border-top-color: #ffffff;
  border-right-color: #ffffff;
}

/* Standard Button styling */
.btn-primary {
  background-color: var(--theme-color);
  color: #ffffff;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  width: 100%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.25);
  min-height: 56px;
}

.btn-primary:hover {
  background-color: var(--theme-color-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(22, 163, 74, 0.3);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary.pulse {
  animation: pulseButton 2s infinite;
}

@keyframes pulseButton {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(22, 163, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

/* Alert Block */
.alert-box {
  border-radius: 0.75rem;
  padding: 1rem;
  border-left: 4px solid var(--theme-danger-color);
  background-color: var(--theme-danger-bg);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Video Containers (VSL) */
.video-wrapper {
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: var(--theme-shadow);
  background-color: #000;
  position: relative;
}

/* Loading Layout */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  gap: 1.5rem;
  text-align: center;
}

.loading-spinner-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
}

.loading-circle-track {
  width: 100%;
  height: 100%;
  border: 6px solid var(--theme-border-color);
  border-radius: 50%;
}

.loading-circle-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 6px solid transparent;
  border-top-color: var(--theme-color);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

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

.loading-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--theme-text-color);
}

.loading-description {
  margin-top: 0.5rem;
}

/* Metrics Graphic Block */
.metrics-container {
  display: grid;
  gap: 1rem;
  margin: 0.5rem 0;
}

.metric-bar-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--theme-text-color);
  display: flex;
  justify-content: space-between;
}

.metric-bar-track {
  height: 16px;
  background-color: var(--theme-border-color);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 99px;
  width: 0%; /* Animated on render */
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Spacers */
.clear-space {
  width: 100%;
  height: 1rem;
}

/* Transition Loader for general state loading */
.transition-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}

.transition-loader.opacity-0 {
  opacity: 0;
  pointer-events: none;
}

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

/* Buyer notifications container (fixed at bottom of screen) */
.notification-container {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  width: calc(100% - 2rem);
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

/* Single buy notification alert popup */
.buy-notification {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--theme-color-border);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  animation: slideNotificationIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards,
             slideNotificationOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) 6.7s forwards;
  pointer-events: auto;
}

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

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

.buy-icon {
  background-color: var(--theme-color);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.buy-text-wrapper {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  color: var(--theme-text-color);
}

.buy-title strong {
  color: var(--theme-text-color);
}

.buy-text {
  color: var(--theme-text-light);
  margin-top: 0.1rem;
}

/* Footer / Debug mode helper */
.debug-bypass-banner {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
}

.debug-bypass-link {
  color: var(--theme-color);
  text-decoration: underline;
  cursor: pointer;
}
