/* ==========================================================================
   Hair Loss Quiz - Main Stylesheet
   ========================================================================== */

/* === VARIABLES === */
:root {
  --primary-color: #4A3F35;         /* Brun foncé comme le logo */
  --secondary-color: #A1866F;       /* Beige chaud / brun clair */
  --accent-color: #D9C8B4;          /* Crème doux pour les arrière-plans */
  --text-color: #2C1F14;            /* Texte foncé, lisible, très pro */
  --light-text-color: #7C6B5B;      /* Texte secondaire */
  --background-color: #F8F4EF;      /* Fond crème doux */
  --border-color: #DDD0C0;          /* Pour les éléments bordés légèrement */
  --error-color: #D9534F;           /* Rouge atténué */
  --success-color: #88B04B;         /* Vert olive doux */
  --border-radius: 8px;
  --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  
  /* Mobile-specific variables */
  --mobile-padding: 15px;
  --mobile-font-size-large: 1.5rem;
  --mobile-font-size-medium: 1.2rem;
  --mobile-font-size-small: 0.95rem;
}

/* === RESET & GLOBAL STYLES === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Open Sans', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent; /* Removes tap highlight on mobile */
  touch-action: manipulation; /* Improves touch behavior */
  margin-bottom: 30px;
}

.quiz-container, #resultsScreen {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
}

/* Mobile containers */
@media (max-width: 768px) {
  .quiz-container, #resultsScreen {
    padding: var(--mobile-padding);
    width: 100%;
  }
}

/* === QUIZ HEADER === */
#quizHeader {
  text-align: center;
  margin-bottom: 20px;
}

#quizHeader h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}

.subheadline, .urgency {
  margin-bottom: 10px;
}

.urgency {
  font-weight: bold;
  color: var(--secondary-color);
}

/* Mobile header */
@media (max-width: 768px) {
  #quizHeader h1 {
    font-size: var(--mobile-font-size-large);
  }
  
  .subheadline, .urgency {
    font-size: var(--mobile-font-size-small);
  }
}

/* === TIMER & PROGRESS === */
#quizTimerProgress {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.countdown {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--secondary-color);
  margin-right: 15px;
  min-width: 70px;
}

.progress {
  flex-grow: 1;
  height: 10px;
  background-color: var(--border-color);
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-color);
  width: 0%;
  transition: width 0.3s ease;
}

/* Mobile timer */
@media (max-width: 768px) {
  .countdown {
    font-size: var(--mobile-font-size-medium);
    min-width: 60px;
  }
  
  .progress {
    height: 8px;
  }
}

/* === QUESTION STEPS === */
.question-step {
  display: none;
  margin-bottom: 30px;
}

.question-step.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

.question-step h2 {
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.question-instruction {
  margin-bottom: 15px;
  font-style: italic;
  color: var(--light-text-color);
}

/* Mobile questions */
@media (max-width: 768px) {
  .question-step h2 {
    font-size: var(--mobile-font-size-medium);
    text-align: center;
  }
  
  .question-instruction {
    text-align: center;
  }
}

/* Desktop layout for all image questions regardless of screen size */
@media (max-width: 768px) {
  /* Use consistent layout for all question images */
  .question-step .answers {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .question-step .answers label {
    flex-basis: calc(50% - 10px);
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0;
    padding: 20px 15px;
  }
  
  .question-step .answers label img {
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
    margin-right: 0;
    min-height: 100px;
    object-fit: contain;
  }
  
  .question-step .answers label + label {
    margin-top: 0;
  }
  
  /* Use desktop layout for all answers with images */
  .answers {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
  }
  
  .answers label {
    flex-basis: calc(50% - 10px);
    padding: 15px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .answers label img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
    margin-right: 0;
  }
  
  /* Improve touch feedback */
  .question-step .answers label:active {
    transform: scale(0.98);
    background-color: rgba(33, 150, 243, 0.05);
  }
  
  /* Ensure good contrast for the selected option */
  .question-step .answers label.selected {
    background-color: rgba(33, 150, 243, 0.1);
    border-width: 2px;
    transform: scale(1.02);
  }
}

/* === ANSWERS === */
.answers {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

.answers label {
  flex-basis: calc(50% - 10px);
  padding: 15px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.answers label:hover {
  transform: translateY(-3px);
  box-shadow: var(--box-shadow);
}

.answers label.selected {
  border-color: var(--primary-color);
  background-color: rgba(33, 150, 243, 0.05);
}

.answers img {
  max-width: 100%;
  height: auto;
  margin-bottom: 10px;
  border-radius: var(--border-radius);
}

.option-btn {
  width: 100%;
  text-align: center;
  padding: 15px;
}

/* === BUTTONS === */
#prevBtn {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  font-size: 1rem;
  padding: 10px;
}

#prevBtn:hover {
  text-decoration: underline;
}

.next-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 12px 24px;
  font-size: 1rem;
  cursor: pointer;
  display: block;
  margin: 20px auto 0;
  transition: background-color 0.3s ease;
}

.next-btn:hover {
  background-color: #1976D2;
}

/* Mobile buttons */
@media (max-width: 768px) {
  .next-btn {
    width: 100%;
    padding: 15px;
    font-size: var(--mobile-font-size-small);
  }
  
  #prevBtn {
    padding: 15px;
  }
}

/* === OVERLAY === */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.overlayContent {
  background-color: white;
  padding: 30px;
  border-radius: var(--border-radius);
  max-width: 500px;
  width: 90%;
  text-align: center;
}

.overlayContent h3 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.lead-text {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

/* Mobile overlay */
@media (max-width: 768px) {
  .overlayContent {
    padding: 20px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .overlayContent h3 {
    font-size: var(--mobile-font-size-medium);
  }
  
  .lead-text {
    font-size: var(--mobile-font-size-small);
  }
}

/* === EMAIL FORM === */
#emailForm {
  text-align: left;
}

.mb-4 {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.input-field {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
}

.btn-form {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 15px;
  font-size: 1.1rem;
  cursor: pointer;
  width: 100%;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.btn-form:hover {
  background-color: #1976D2;
}

/* Mobile form */
@media (max-width: 768px) {
  .input-field {
    padding: 15px;
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  
  .btn-form {
    padding: 16px;
    font-size: var(--mobile-font-size-small);
  }
}

/* === EMAIL CAPTURE OVERLAY === */
.preview-results {
  display: flex;
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: var(--border-radius);
  padding: 15px;
  margin: 20px 0;
}

.preview-text {
  width: 100%;
}

.preview-text p {
  margin-bottom: 8px;
  text-align: left;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
}

.preview-text p:last-child {
  margin-bottom: 0;
}

.form-intro {
  text-align: left;
  margin-bottom: 15px;
  color: var(--text-color);
}

.privacy-note {
  text-align: left;
  margin-bottom: 15px;
  color: var(--light-text-color);
}

.btn-form {
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-text {
  margin-right: 10px;
}

.btn-icon {
  font-size: 1.2rem;
}

.secure-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  color: var(--light-text-color);
}

.secure-badge svg {
  margin-right: 8px;
}

/* Mobile email capture */
@media (max-width: 768px) {
  .preview-results {
    padding: 10px;
  }
  
  .preview-text p {
    font-size: 0.9rem;
  }
}

/* === LOADING OVERLAY ANIMATION === */
@keyframes loadingPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.loading-indicator {
  display: inline-block;
  width: 50px;
  height: 50px;
  border: 5px solid rgba(33, 150, 243, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

/* === LOADING STEPS === */
.loading-steps {
  text-align: left;
  margin-top: 20px;
  padding: 0 10px;
}

.loading-step {
  margin-bottom: 12px;
  color: var(--light-text-color);
  opacity: 0.5;
  position: relative;
  padding-left: 25px;
  font-size: 0.95rem;
}

.loading-step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
}

.loading-step.active {
  color: var(--text-color);
  opacity: 1;
  font-weight: 600;
}

.loading-step.active::before {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
}

.loading-step.completed {
  color: var(--text-color);
  opacity: 1;
}

.loading-step.completed::before {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.loading-step.completed::after {
  content: "✓";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: white;
  width: 16px;
  height: 16px;
  text-align: center;
  line-height: 16px;
}

/* Loading Progress Bar */
.loading-progress-bar {
  width: 100%;
  height: 4px;
  background-color: rgba(33, 150, 243, 0.2);
  border-radius: 2px;
  margin-top: 20px;
  overflow: hidden;
  position: relative;
}

.loading-progress-inside {
  position: absolute;
  height: 100%;
  width: 0%;
  background-color: var(--primary-color);
  transition: width 3s cubic-bezier(0.1, 0.7, 1.0, 0.1);
}

/* Mobile loading */
@media (max-width: 768px) {
  .loading-indicator {
    width: 40px;
    height: 40px;
    border-width: 4px;
  }
  
  .loading-steps {
    padding: 0 5px;
  }
  
  .loading-step {
    font-size: 0.85rem;
  }
}

/* === RESULTS SCREEN === */
.results-screen {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 30px;
  margin: 20px auto;
  box-shadow: var(--box-shadow);
  max-width: 800px; /* Match the quiz-container max-width */
}

#resultsScreen {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px; /* Match the quiz-container padding */
}

.result-title {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 30px;
  padding-top: 10px;
  font-size: 2rem;
}

.status-section {
  margin-bottom: 20px;
  position: relative;
  padding: 0 10px;
}

.status-section h3 {
  margin-bottom: 20px;
  font-size: 1.3rem;
  color: var(--primary-color);
}

.status-bar {
  height: 25px;
  background-color: #e0e0e0;
  border-radius: 10px;
  position: relative;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.status-indicator {
  position: absolute;
  height: 100%;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 10px;
  width: 75%; /* Changed from 85% to exactly 75% to match the marker */
  background-color: #FF9800; /* Orange color for visibility */
  transition: width 1.5s ease;
  min-width: 20px;
  box-shadow: 0 0 5px rgba(255, 152, 0, 0.5);
  display: block;
  visibility: visible;
  z-index: 1;
}

.status-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 10px;
}

/* Severity marker */
#severityRoundMarker {
  position: absolute;
  left: 75%; /* Explicitly set to 75% to match status indicator */
  top: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background-color: #FF9800;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 0 5px rgba(0,0,0,0.3);
  z-index: 2;
}

#severityRoundMarkerLabel {
  position: absolute;
  left: 75%; /* Explicitly set to 75% to match status indicator */
  top: calc(100% + 5px);
  transform: translateX(-50%);
  font-size: 0.8rem;
  font-weight: bold;
  color: #FF9800;
  text-shadow: 0 0 2px rgba(255,255,255,0.8);
}

.result-section {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
  justify-content: center;
  width: 100%;
}

.result-box {
  flex: 1;
  min-width: 300px;
  padding: 20px;
 
  background-color: #f5f5f5;
  border-radius: var(--border-radius);
}

.result-box h3, .recommendation-box h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
}

.free-guide-box h4 {
  display: flex;
  align-items: center;
  margin-bottom: 1px;
  color: var(--secondary-color);
}

.secondary-cta-button {
  display: inline-block;
  background-color: var(--secondary-color);
  color: white;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  text-decoration: none;
  margin-top: 15px;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.secondary-cta-button:hover {
  background-color: #8A755F;
}

.recommendation-box {
  flex: 2;
  min-width: 300px;
  padding: 20px;
  background-color: #f5f5f5;
  border-radius: var(--border-radius);
  border: 2px solid var(--secondary-color);
  position: relative;
}

.recommendation-box::before {
  content: "RECOMMENDED";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--secondary-color);
  color: white;
  padding: 3px 15px;
  font-size: 0.8rem;
  font-weight: bold;
  border-radius: 20px;
}

.recommendation-item {
  display: flex;
  gap: 25px;
  align-items: flex-start;
}

.recommendation-item img {
  width: 140px;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  border-radius: var(--border-radius);
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.recommendation-content {
  flex: 1;
}

.recommendation-content h4 {
  margin-bottom: 10px;
  color: var(--primary-color);
  font-size: 1.2rem;
}

.recommendation-content ul {
  margin: 15px 0;
  padding-left: 20px;
}

.recommendation-content li {
  margin-bottom: 8px;
  position: relative;
  padding-left: 5px;
}

.recommendation-content li::before {
  content: "•";
  color: var(--secondary-color);
  font-weight: bold;
  position: absolute;
  left: -15px;
}

.pricing {
  margin: 15px 0;
  display: flex;
  align-items: center;
}

.original-price {
  text-decoration: line-through;
  color: var(--light-text-color);
  margin-right: 10px;
}

.discounted-price {
  font-weight: bold;
  color: var(--secondary-color);
  font-size: 1.5rem;
}

.discount-tag {
  background-color: var(--secondary-color);
  color: white;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-left: 10px;
}

.cta-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 12px 25px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-block;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
}

.cta-button:hover {
  background-color: #3A3128;
}

.guarantee-section {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 40px 0;
  width: 100%;
  flex-wrap: wrap;
}

.guarantee-item {
  flex: 1;
  min-width: 250px;
  text-align: center;
  padding: 20px;
  background-color: #f5f5f5;
  border-radius: var(--border-radius);
}

.guarantee-item img {
  width: 50px;
  height: 50px;
  margin-bottom: 15px;
}

.guarantee-item h4 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

/* Comparison table styling */
.compare-section {
  margin: 40px 0;
  width: 100%;
}

.compare-section h3 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.compare-header {
  display: flex;
  background-color: #f0f0f0;
  font-weight: bold;
}

.compare-header .compare-cell {
  padding: 15px;
  text-align: center;
}

.compare-header .compare-cell.highlight {
  background-color: var(--secondary-color);
  color: white;
}

.compare-row {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
}

.compare-row:last-child {
  border-bottom: none;
}

.compare-cell {
  flex: 1;
  padding: 12px 15px;
  text-align: center;
}

.compare-cell:first-child {
  flex: 2;
  text-align: left;
}

.compare-cell.highlight {
  background-color: rgba(161, 134, 111, 0.1);
}

.compare-cell .check {
  color: #4CAF50;
  font-weight: bold;
}

.compare-cell .x {
  color: #F44336;
}

.testimonials-section {
  margin: 40px 0;
  width: 100%;
}

.testimonials-section h3 {
  margin-bottom: 20px;
  color: var(--primary-color);
  text-align: center;
}

.testimonials-container {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.testimonial-item {
  flex: 1;
  min-width: 250px;
  padding: 25px;
  background-color: #f5f5f5;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.testimonial-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.testimonial-header img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin-right: 20px;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stars {
  color: #FFC107;
  margin-top: 5px;
}

.cta-section {
  text-align: center;
  margin: 40px 0 20px;
  width: 100%;
}

.cta-button-large {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 15px 30px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  margin: 0 auto;
  max-width: 100%;
}

.cta-button-large:hover {
  background-color: #3A3128;
}

.limited-offer {
  color: var(--secondary-color);
  font-weight: bold;
  font-size: 1.1rem;
}

/* Mobile results */
@media (max-width: 768px) {
  .results-screen {
    padding: 20px;
    margin: 10px auto;
    width: 100%;
    max-width: 100%;
  }
  
  #resultsScreen {
    padding: 0 var(--mobile-padding); /* Match mobile padding */
  }
  
  .result-title {
    font-size: var(--mobile-font-size-large);
  }
  
  .result-section {
    flex-direction: column;
    padding: 0;
    gap: 15px;
  }
  
  .result-box, .recommendation-box {
    width: 100%;
    min-width: 100%;
    margin-bottom: 20px;
  }
  
  .recommendation-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .recommendation-item img {
    margin-bottom: 15px;
    width: 180px;
    height: auto;
    max-height: 240px;
  }
  
  .testimonial-header img {
    width: 70px;
    height: 70px;
  }
  
  .compare-table {
    font-size: 0.9rem;
  }
  
  .compare-cell {
    padding: 10px;
  }
  
  .status-section h3, .result-box h3, .recommendation-box h3 {
    font-size: var(--mobile-font-size-small);
  }
  
  .cta-button {
    display: block;
    width: 100%;
    padding: 15px;
  }
  
  .cta-button-large {
    padding: 15px;
    font-size: var(--mobile-font-size-small);
    width: 100%;
    max-width: 100%;
  }
  
  .guarantee-section {
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
  }
  
  .testimonials-container {
    flex-direction: column;
    gap: 20px;
  }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes typeWriter {
  from { width: 0; }
  to { width: 100%; }
}

/* === FIX FOR MOBILE SAFARI === */
@supports (-webkit-touch-callout: none) {
  /* Fixes for iOS Safari */
  .input-field, button, .cta-button, .cta-button-large {
    -webkit-appearance: none;
    appearance: none;
  }
  
  .overlay {
    position: absolute;
    height: 100vh;
    height: -webkit-fill-available;
  }
  
  body {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }
}

/* === STICKY FOOTER FOR QUIZ NAV === */
.quiz-nav-footer {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--white);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  padding: 15px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
}

.quiz-nav-footer button {
  padding: 12px 20px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.quiz-nav-footer button#mobilePrevBtn {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.quiz-nav-footer button#mobileNextBtn {
  background-color: var(--primary-color);
  border: none;
  color: white;
}

/* Mobile alert notification */
.mobile-alert {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background-color: rgba(235, 87, 87, 0.95);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  text-align: center;
  transition: transform 0.3s ease;
  max-width: 85%;
}

.mobile-alert.show {
  transform: translateX(-50%) translateY(0);
}

/* Touch optimization styles */
.touch-optimized {
  padding: 14px;
  margin: 3px 0;
}

.touch-active {
  opacity: 0.7;
  transform: scale(0.98);
}

/* Media queries for mobile devices */
@media (max-width: 768px) {
  /* Show mobile footer only on mobile */
  .quiz-nav-footer {
    display: flex;
  }
  
  /* Hide desktop prev button on mobile */
  .prev-btn {
    display: none !important;
  }
  
  /* Add padding to bottom to prevent content from being hidden under footer */
  .quiz-container {
    padding-bottom: 80px;
  }
  
  /* Make answer options easier to tap */
  .answers {
    display: flex;
    flex-direction: column;
  }
  
  .answers label {
    margin: 8px 0;
    padding: 15px;
  }
  
  /* Ensure form elements have adequate touch targets */
  input[type="radio"],
  input[type="checkbox"] {
    min-height: 24px;
    min-width: 24px;
  }
  
  /* Other mobile-specific adjustments */
  .countdown-overlay-content {
    width: 90%;
    padding: 20px;
  }
  
  .result-section {
    padding: 10px 15px;
  }
}

/* Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: 2rem;
  text-align: center;
  color: #e53935;
}

h2 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

.head-images img {
  max-height: 80px;
  width: auto;
}

.tried-images img {
  max-height: 80px;
  width: auto;
}

/* Footer Styles
   ========================================================================== */
footer {
  width: 100%;
  margin: 40px auto 0;
  padding: 2px 0px;
  background-color: #ffffff;
  border-top: 1px solid #e0e0e0;
  text-align: center;
  font-size: 0.7rem;
  color: #555;
}

/* Animation Keyframes
   ========================================================================== */
@keyframes fadeInBullets {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInPulse {
  0% { opacity: 0; transform: scale(0.8); }
  70% { opacity: 1; transform: scale(1.1); }
  85% { transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes pulseAnimation {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Media Queries
   ========================================================================== */
@media (max-width: 768px) {
  h1 {
    font-size: 1.7rem;
  }
  h2 {
    font-size: 1.3rem;
  }
  .answers {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .quiz-container {
    padding: 15px;
  }
  .profile-boxes-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-box {
    padding: 10px 8px;
    font-size: 0.9rem;
  }
}

/* === SITE HEADER AND LOGO === */
.site-header {
  width: 100%;
  background-color: var(--background-color);
  padding: 20px 0;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.logo-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-logo {
  max-width: 280px;
  height: auto;
  display: block;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .site-header {
    padding: 15px 0;
  }
  
  .logo-container {
    padding: 0 var(--mobile-padding);
  }
  
  .site-logo {
    max-width: 220px;
  }
}

/* Media Queries for Extra Small Screens */
@media (max-width: 480px) {
  .recommendation-item img {
    width: 160px;
    max-height: 220px;
  }
  
  .testimonial-header {
    flex-direction: column;
    text-align: center;
    margin-bottom: 15px;
  }
  
  .testimonial-header img {
    margin: 0 auto 10px;
  }
  
  .testimonial-header div {
    text-align: center;
  }
}

.head-images label img, .tried-images label img {
  max-width: 85% !important;
  max-height: 130px !important;
  min-height: 100px !important;
  margin-bottom: 20px !important;
  object-fit: contain !important;
}

.head-images label, .tried-images label {
  padding: 20px 15px !important;
}

/* Make all question images larger like the first question */
.question-step .answers label img {
  max-width: 100%;
  height: auto;
  margin-bottom: 15px;
  min-height: 90px;
  object-fit: contain;
}

/* Ensure images look good on all screen sizes */
@media (max-width: 480px) {
  .question-step .answers label img {
    max-width: 90%;
    min-height: 85px;
    max-height: 110px;
  }
  
  .head-images label img, .tried-images label img {
    max-width: 75% !important;
    min-height: 85px !important;
    max-height: 110px !important;
  }
}

/* === FOOTER STYLES === */
.site-footer {
  background-color: var(--primary-color);
  color: rgba(255, 255, 255, 0.8);
  padding: 30px 0;
  margin-top: 50px;
  width: 100%;
}

.footer-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
}

.footer-links {
  margin-bottom: 20px;
}

.footer-links a {
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.footer-separator {
  color: rgba(255, 255, 255, 0.4);
  margin: 0 10px;
}

.footer-copyright {
  margin-bottom: 15px;
}

.footer-copyright p {
  font-size: 0.85rem;
  margin-bottom: 5px;
}

.footer-disclaimer p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  max-width: 600px;
  margin: 0 auto;
}

/* Mobile footer styles */
@media (max-width: 768px) {
  .site-footer {
    padding: 25px 0;
    margin-top: 30px;
  }
  
  .footer-container {
    padding: 0 var(--mobile-padding);
  }
  
  .footer-links {
    margin-bottom: 15px;
  }
  
  .footer-links a {
    font-size: 0.8rem;
  }
  
  .footer-separator {
    margin: 0 8px;
  }
  
  .footer-copyright p {
    font-size: 0.8rem;
  }
  
  .footer-disclaimer p {
    font-size: 0.7rem;
  }
}

/* === LEGAL MODALS === */
.legal-modal {
  max-width: 700px;
  max-height: 80vh;
  width: 90%;
  padding: 0;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  background-color: var(--primary-color);
  color: white;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
}

.close-modal {
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  margin: 0;
  transition: color 0.2s ease;
}

.close-modal:hover {
  color: var(--accent-color);
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
  max-height: calc(80vh - 70px);
}

.modal-body h4 {
  color: var(--primary-color);
  margin-top: 25px;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.modal-body h4:first-child {
  margin-top: 0;
}

.modal-body p {
  margin-bottom: 15px;
  line-height: 1.6;
}

.modal-body ul {
  margin: 15px 0;
  padding-left: 20px;
}

.modal-body li {
  margin-bottom: 8px;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .legal-modal {
    width: 95%;
    max-height: 85vh;
  }
  
  .modal-header {
    padding: 15px 20px;
  }
  
  .modal-header h3 {
    font-size: 1.3rem;
  }
  
  .modal-body {
    padding: 20px;
    max-height: calc(85vh - 60px);
  }
  
  .modal-body h4 {
    font-size: 1.1rem;
  }
}

/* === FIXED FOOTER SPACING === */
.quiz-container,
.container {
  padding-bottom: 40px;
}

/* === ENSURE MODALS APPEAR ABOVE FOOTER === */
.overlay {
  z-index: 1000; /* Ensure overlays appear above the footer */
}

.testimonial-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

/* Desktop-specific enhancements */
@media (min-width: 768px) {
  .testimonial-header img {
    width: 70px;
    height: 70px;
  }
  
  /* Center testimonials on wider screens */
  .testimonials-container {
    max-width: 700px;
    margin: 0 auto;
  }
}

/* Personalized Section Styles */
.personalized-section {
  margin: 20px 0;
}

.personalized-message {
  background: linear-gradient(135deg, #f9f1e7, #fff9f0);
  border: 1px solid var(--border-color);
  border-left: 4px solid #8B4513;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.07);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.personalized-message:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.personalized-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(to right, #A0522D, #8B4513);
  border-radius: 10px 10px 0 0;
}

.personalized-message h3 {
  font-size: 1.6rem;
  margin-top: 0;
  margin-bottom: 20px;
  color: #8B4513;
  text-align: center;
  position: relative;
  padding-bottom: 12px;
}

.personalized-message h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(to right, #A0522D, #8B4513);
  border-radius: 3px;
}

.personalized-content {
  font-size: 1.2rem;
  line-height: 1.7;
  color: #333;
  font-weight: 400;
}

.personalized-content p {
  margin-bottom: 0;
  text-align: left;
}

.loading-indicator-small {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  border-top-color: #8B4513;
  animation: spin 1s ease-in-out infinite;
  margin-right: 10px;
}

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

@media (max-width: 768px) {
  .personalized-message {
    padding: 20px 15px;
  }
  
  .personalized-message h3 {
    font-size: 1.4rem;
  }
  
  .personalized-content {
    font-size: 1.1rem;
    line-height: 1.5;
  }
}

/* API Key Form Styles */
.api-key-form {
  padding: 15px;
  background: #f8f8f8;
  border-radius: 8px;
  margin: 10px 0;
}

.input-group {
  display: flex;
  margin: 15px 0;
}

.form-input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  font-size: 1rem;
}

.form-button {
  padding: 10px 15px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}

.form-button:hover {
  background: #8b4513; /* Darker shade of accent color */
}

.small-text {
  font-size: 0.8rem;
  color: #666;
  margin-top: 10px;
}

/* Email Redirect Modal */
#emailRedirectModal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

#emailRedirectModal .overlayContent {
  background: white;
  border-radius: 15px;
  padding: 35px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: fadeSlideIn 0.5s ease;
}

#emailRedirectModal h2 {
  margin-top: 0;
  color: #333;
  font-size: 24px;
  margin-bottom: 15px;
}

#emailRedirectModal p {
  margin-bottom: 25px;
  color: #555;
  font-size: 16px;
}

#redirectEmailForm {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

#redirectEmailForm input {
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  width: 100%;
}

#redirectEmailForm button {
  margin-top: 5px;
  padding: 16px;
  border: none;
  background: linear-gradient(135deg, #8B4513, #A0522D);
  color: white;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#redirectEmailForm button:hover {
  background: linear-gradient(135deg, #A0522D, #8B4513);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(139, 69, 19, 0.25);
}

#redirectEmailForm button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Loading indicator inside button */
.loading-indicator-small {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  margin-right: 10px;
}

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

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