/* 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 promotional area with quiz call-to-action */
.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;
}

/* ========================================= */
/* 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;
}

.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;
}

/* ========================================= */
/* 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;
}

/* ========================================= */
/* 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.2s ease;
  background: #fff;
  font-size: 18px;
  text-align: left;
}

/* ========================================= */
/* 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;
}

/* ========================================= */
/* 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 {
  text-align: left;
  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: 100%;
  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;
}

/* .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;
}

/* ========================================= */
/* 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));
  }
}

/* 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;
  }
}
