/* index-styles.css - Styles specific to the main index page */

/* ========================================= */
/* BASE LAYOUT STYLES */
/* ========================================= */

/* HTML/body styles are handled by shared-styles.css */

/* Brand badge styling */
.brand-badge {
  background: var(--yellow);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid #e9c23c;
}

/* ========================================= */
/* HERO SECTION STYLES */
/* ========================================= */

/* Main brand statement section */
.hero-section {
  padding: 0;
  margin-top: -24px;
  margin-left: -24px;
  margin-right: -24px;
}

/* Container for side-by-side layout */
.brand-statement-container {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 60px;
  align-items: center;
}

/* Image container on the left */
.brand-image {
  width: auto;
  height: auto;
  margin: 0;
  margin-left: -24px;
  padding: 0;
}

.brand-image img {
  width: auto;
  height: auto;
  max-height: 600px;
  object-fit: contain;
  display: block;
}

/* Text content on the right */
.brand-statement {
  text-align: left;
  max-width: 100%;
  padding: 60px 20px 60px 0;
}

.brand-statement h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.1;
  margin: 0 0 20px;
  color: var(--ink);
}

.brand-statement p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 32px;
}

/* Legacy hero styles for quiz promo */
.hero {
  display: grid;
  gap: 16px;
  align-items: center;
  padding: 40px 0;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  margin: 0;
}

.hero p {
  color: var(--muted);
  margin: 6px 0 0;
}

/* ========================================= */
/* SECTION HEADINGS */
/* ========================================= */

.section-heading {
  font-size: 32px;
  margin: 0 0 12px;
  color: var(--ink);
  text-align: center;
}

.section-subtitle {
  font-size: 16px;
  color: var(--muted);
  text-align: center;
  margin: 0 0 40px;
}

/* ========================================= */
/* BEST SELLERS SECTION */
/* ========================================= */

.best-sellers-section {
  padding: 60px 0;
}

.best-sellers-grid {
  /* Uses same grid styling as .grid but can be customized */
}

/* ========================================= */
/* PRODUCT GRID STYLES */
/* ========================================= */

/* Layout for displaying hat recommendations */
.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Individual product card styling */
.card .hat-image-container {
  width: 100%;
  height: 300px;
  background: #fafafa;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1/1;
  min-height: 260px;
  max-height: 360px;
}

/* Hover animation matching collection cards */
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,27,46,0.12);
}

.card .pad {
  padding: 14px 14px 0;
}

.card h3 {
  margin: 0;
  font-size: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price {
  color: #2f2f2f;
  font-weight: 700;
}

/* Action buttons container - Customize and Add to Cart buttons on product cards */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px;
}

/* Specific styling for buttons within product card actions only */
.actions .btn {
  font-size: 14px;
  white-space: nowrap;
  min-width: 0;
  padding: 10px 8px;
}

/* ========================================= */
/* COLLECTIONS SECTION */
/* ========================================= */

.collections-section {
  padding: 60px 0;
  background: #fafafa;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.collections-showcase {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 1200px;
  margin: 0 auto;
}

.collection-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.collection-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,27,46,0.12);
}

.collection-header {
  margin-bottom: 20px;
}

.collection-header h3 {
  font-size: 24px;
  margin: 0 0 8px;
  color: var(--ink);
}

.collection-header p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.collection-samples {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.collection-sample-image {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
}

.collection-sample-image .hat-image-container.small {
  width: 100%;
  height: 100%;
}

/* ========================================= */
/* QUIZ PROMO SECTION (repositioned) */
/* ========================================= */

.quiz-promo-section {
  padding: 60px 0 80px;
}

.quiz-promo-card {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  background: white;
  color: var(--ink);
  padding: 48px 32px;
  border-radius: 16px;
  border: 3px solid var(--yellow);
  box-shadow: 0 20px 40px rgba(255, 213, 69, 0.3);
}

.quiz-promo-card h2 {
  font-size: 32px;
  margin: 0 0 16px;
  color: var(--ink);
}

.quiz-promo-card p {
  font-size: 16px;
  line-height: 1.6;
  margin: 0 0 28px;
  color: var(--ink);
}

.quiz-promo-card .btn {
  background: linear-gradient(135deg, var(--yellow) 0%, #FFC107 100%);
  color: var(--ink);
  border: none;
}

.quiz-promo-card .btn:hover {
  background: linear-gradient(135deg, #FFC107 0%, var(--yellow) 100%);
  transform: translateY(-2px);
}

/* ========================================= */
/* QUIZ RESULTS SECTION */
/* ========================================= */

.quiz-results-section {
  padding: 40px 0;
}

/* ========================================= */
/* FOOTER STYLES */
/* ========================================= */

footer {
  color: var(--muted);
  padding: 40px 0;
}

.pill {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

/* ========================================= */
/* HAT RENDERING STYLES */
/* ========================================= */

/* Styles for dynamically rendering text on hat images */
.hat-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  height: 100%;
}

/* Base hat image styling */
.hat-base-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Text overlay positioned on top of hat image */
.hat-text-overlay {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: Arial Black, Arial, sans-serif;
  font-weight: bold;
  color: #1a1a1a;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
  line-height: 1.2;
  max-width: 70%;
  pointer-events: none;
  z-index: 10;
  font-size: 14px;
  word-wrap: break-word;
}

/* ========================================= */
/* FULL-PAGE QUIZ OVERLAY STYLES */
/* ========================================= */

.quiz-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.quiz-container {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

/* Mobile: ensure quiz content is fully visible below sticky header */
@media (max-width: 560px){
  /* Reserve space equal to header height and allow internal scrolling */
  .quiz-screen{
    padding-top: 20px; /* header is no longer sticky on mobile */
    align-items: flex-start;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .quiz-container{
    padding-bottom: 40px; /* breathing room for bottom content */
  }
}

/* ========================================= */
/* QUIZ HEADER STYLES */
/* ========================================= */

.quiz-header {
  margin-bottom: 40px;
}

.quiz-header h1 {
  font-size: clamp(32px, 5vw, 48px);
  margin: 0 0 16px;
  line-height: 1.1;
}

.quiz-header p {
  font-size: 18px;
  color: var(--muted);
  margin: 0;
}

/* ========================================= */
/* QUIZ CONTENT WRAPPER */
/* ========================================= */

.quiz-content {
  margin-bottom: 32px;
}

/* ========================================= */
/* QUIZ QUESTION STYLING */
/* ========================================= */

.quiz-question {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--ink);
}

/* ========================================= */
/* MAIN QUIZ BUTTON STYLING */
/* ========================================= */

.choice {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border: 2px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.3s ease;
  background: #fff;
  font-size: 18px;
  text-align: left;
  position: relative;
}

/* ========================================= */
/* QUIZ BUTTON HOVER EFFECTS */
/* ========================================= */

/* Standardized choice hover highlight (including "Let's go!" button): use site-wide ink */
.choice:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.choice:last-child {
  margin-bottom: 0;
}

/* ========================================= */
/* CHOICE SELECTION ANIMATIONS */
/* ========================================= */

/* Selected choice: enlarge and highlight */
.choice.selected {
  transform: scale(1.05) translateY(-2px);
  border-color: var(--ink);
  box-shadow: 0 0 20px rgba(0, 27, 46, 0.2);
  z-index: 10;
  background: #f8f9fb;
}

/* Non-selected choices: fade out */
.choice.fading {
  opacity: 0.3;
  transform: scale(0.98);
  filter: grayscale(30%);
}

/* Checkmark for selected choice */
.choice.selected::after {
  content: '✓';
  position: absolute;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  background: var(--ink);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  animation: checkmarkPop 0.4s ease-out;
  box-shadow: 0 2px 8px rgba(0, 27, 46, 0.25);
}

/* Use the same checkmark animation as hat options */
@keyframes checkmarkPop {
  0% {
    transform: translateY(-50%) scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: translateY(-50%) scale(1.3) rotate(180deg);
  }
  100% {
    transform: translateY(-50%) scale(1) rotate(360deg);
    opacity: 1;
  }
}

/* ========================================= */
/* PAGE 2 SPECIFIC BUTTON STYLING */
/* ========================================= */

.quiz-step-2 .choice {
  text-align: center;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 0;
  padding: 24px 30px;
  font-size: 20px;
  font-weight: 600;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================= */
/* QUIZ BUTTON CONTENT STYLING */
/* ========================================= */

.choice-emoji {
  font-size: 32px;
  flex-shrink: 0;
}

.choice-text {
  font-weight: 600;
}

/* ========================================= */
/* LOADING STEP STYLES */
/* ========================================= */

.loading-step {
  text-align: center;
  padding: 40px 20px;
}

.loading-animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 30px 0;
}

.hat-spinner { animation: hat-spin 2s linear infinite; }
.spinner-logo { width: 112px; height: 112px; display:block; }

.loading-dots {
  display: flex;
  gap: 4px;
}

.loading-dots span {
  font-size: 24px;
  animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0s;
}

/* ========================================= */
/* ANIMATIONS */
/* ========================================= */

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

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ========================================= */
/* PAGE 2 SPECIFIC STYLES - Game Description Box */
/* ========================================= */

.game-description {
  /* Center the info box visually within the quiz container */
  display: inline-block;
  text-align: center;
  margin: 30px auto 40px auto;
  padding: 30px 25px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  max-width: 450px;
  width: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.game-description p {
  font-size: 22px;
  margin: 0;
  text-align: center;
  line-height: 1.4;
  color: var(--ink);
}

.game-instructions {
  list-style: none;
  padding: 0;
  margin: 0;
}

.game-instructions li {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  font-size: 16px;
}

.game-instructions li::before {
  content: "•";
  color: var(--accent);
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* ========================================= */
/* HAT SELECTION STEP STYLES */
/* ========================================= */

.hat-selection-step {
  text-align: center;
}

.quiz-description {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 30px;
  font-style: italic;
}

/* Hat options container - displays 3 hats side by side */
.hat-options-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 30px 0;
}

/* Pre-intent options container - displays choices vertically stacked */
.pre-intent-options-container {
  margin: 30px 0;
}

/* Center text for pre-intent choices */
.pre-intent-options-container .choice {
  text-align: center;
  justify-content: center;
}

/* .hat-option styles are handled by quiz-transitions.css */

.hat-option-image {
  width: 100%;
  height: 120px;
  margin-bottom: 12px;
  border-radius: 8px;
  overflow: hidden;
  background: #f8f8f8;
}

.hat-option-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hat-option-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 4px;
}

.hat-option-tagline {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

/* ========================================= */
/* QUIZ PROGRESS UI                         */
/* ========================================= */

.quiz-progress {
  margin-top: 18px;
}

.quiz-status-text {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 8px 0;
  text-align: center;
  min-height: 18px; /* reserve space to avoid layout shift */
}

.progress-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #f1f3f5;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--border);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--ink);
  border-radius: 999px;
  transition: width 400ms ease;
}

/* Animated striped progress bar for pre-intent transition */
.progress-fill.animated-stripes {
  background: linear-gradient(
    45deg,
    var(--ink) 25%,
    rgba(0, 27, 46, 0.7) 25%,
    rgba(0, 27, 46, 0.7) 50%,
    var(--ink) 50%,
    var(--ink) 75%,
    rgba(0, 27, 46, 0.7) 75%,
    rgba(0, 27, 46, 0.7)
  );
  background-size: 40px 40px;
  animation: moveStripes 1s linear infinite;
}

@keyframes moveStripes {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 40px 0;
  }
}

/* ========================================= */
/* RESULTS PAGE SPECIFIC STYLING */
/* ========================================= */

/* Extra padding below hat results on results page only */
section[x-show*="suggestions.length"] {
  padding-bottom: 60px;
}

/* ========================================= */
/* RESPONSIVE STYLES */
/* ========================================= */

/* Hat options mobile layout */
@media (max-width: 768px) {
  .hat-options-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  /* Mobile responsiveness for hat options is handled by quiz-transitions.css */
  
  .card .hat-image-container {
    height: 260px;
    min-height: 220px;
    max-height: 280px;
  }
  
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  
  /* Stack hero section vertically on mobile */
  .hero-section {
    margin-top: -24px;
    margin-left: -24px;
    margin-right: -24px;
  }
  
  .brand-statement-container {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .brand-image {
    margin-left: 0;
  }
  
  .brand-image img {
    max-height: 400px;
    width: 100%;
    object-fit: cover;
  }
  
  .brand-statement {
    text-align: center;
    padding: 40px 20px;
  }
}

/* Large screens - maintain larger square images */
@media (min-width: 1024px) {
  .card .hat-image-container {
    height: 300px;
    max-height: 350px;
  }
}

/* Small screens - smaller but still square */
@media (max-width: 480px) {
  .card .hat-image-container {
    height: 240px;
    min-height: 200px;
    max-height: 260px;
  }
  
  .grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
}
