/* ----------------------------------------------------------------
   Shorts Break Fan Survey - Core Design System & Stylesheet
   ---------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  /* Dynamic Step variable set by JS (default 1) */
  --step: 1;

  /* HSL Color Palette */
  --bg-dark: hsl(222, 47%, 4%);
  --bg-card: rgba(13, 20, 38, 0.55);
  --border-color: rgba(255, 255, 255, 0.08);

  /* Hue values rotate 30 degrees per step for dynamic aesthetic changes */
  --primary-hue: calc(354 + (var(--step) - 1) * 30);
  --secondary-hue: calc(272 + (var(--step) - 1) * 30);

  --primary: hsl(var(--primary-hue), 100%, 50%);       /* Dynamic YouTube Red / Crimson / Orange */
  --primary-glow: hsla(var(--primary-hue), 100%, 50%, 0.35);
  --secondary: hsl(var(--secondary-hue), 100%, 60%);     /* Dynamic Purple / Violet / Magenta */
  --secondary-glow: hsla(var(--secondary-hue), 100%, 60%, 0.35);

  --border-selected: var(--primary);
  
  --text-main: hsl(0, 0%, 96%);
  --text-muted: hsl(215, 20%, 70%);
  --accent-gradient: linear-gradient(135deg, var(--primary), var(--secondary));
  --card-gradient: linear-gradient(135deg, hsla(var(--primary-hue), 100%, 50%, 0.06), hsla(var(--secondary-hue), 100%, 60%, 0.06));
  
  /* Layout Sizing & Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Transition timings */
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;
}

/* Base Reset & Background */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  padding: 1.5rem;
}

/* Ambient Background Blobs (Wow factor) */
.ambient-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
  width: 45vw;
  height: 45vw;
  max-width: 500px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.22;
  mix-blend-mode: screen;
  transition: background-color 1.2s ease-in-out;
}

.blob-1 {
  background-color: var(--primary);
  top: -10%;
  left: -10%;
  animation: float-1 25s infinite alternate ease-in-out;
}

.blob-2 {
  background-color: var(--secondary);
  bottom: -15%;
  right: -10%;
  animation: float-2 30s infinite alternate-reverse ease-in-out;
}

@keyframes float-1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 80px) scale(1.15); }
}

@keyframes float-2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-80px, -50px) scale(1.2); }
}

/* Container Structure */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header/Branding Area */
.branding {
  text-align: center;
}

.branding h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: -0.5px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.25rem;
}

.branding p {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Glassmorphism Survey Card */
.survey-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  padding: 2.2rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: min-height 0.3s ease;
}

/* Progress Tracker */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.progress-label {
  color: var(--text-muted);
}

.progress-percentage {
  color: var(--primary);
}

.progress-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px var(--primary-glow);
}

/* Slides Content Area */
.survey-slides {
  position: relative;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.slide {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity var(--transition-smooth), transform var(--transition-smooth);
}

.slide.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: slide-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slide-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
}

.slide-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
  font-style: italic;
}

/* Option Group Styling (Flex/Grid) */
.options-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Grid Option Layout for YES/NO or simple MCQs */
.options-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Custom Styled Option Cards */
.option-card {
  position: relative;
  display: flex;
  align-items: center;
  padding: 1.1rem 1.25rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-smooth);
  min-height: 56px;
}

/* Ensure focus highlights on parent custom-outline when tabbed */
.option-card:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.option-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.option-card.selected {
  background: var(--card-gradient);
  border-color: var(--border-selected);
  box-shadow: 0 8px 24px var(--primary-glow);
}

/* Visually Hidden Native Inputs */
.option-card input[type="radio"],
.option-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Custom Check/Radio Box Indicator */
.indicator-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 6px; /* Default for checkboxes */
  margin-right: 1rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  background: rgba(0, 0, 0, 0.2);
}

/* Circular indicators for Radio buttons */
.indicator-radio {
  border-radius: 50%;
}

.indicator-box::after {
  content: "";
  width: 10px;
  height: 10px;
  background-color: var(--text-main);
  transform: scale(0);
  transition: transform var(--transition-fast);
}

/* Dot for Radio check */
.indicator-radio::after {
  border-radius: 50%;
  background: var(--primary);
}

/* Tick symbol for Checkbox check */
.indicator-checkbox::after {
  content: "✓";
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  background-color: transparent;
  transform: scale(0);
}

/* Selection status styling */
.option-card.selected .indicator-box {
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow);
}

.option-card.selected .indicator-radio::after {
  transform: scale(1);
}

.option-card.selected .indicator-checkbox {
  background: var(--primary);
}

.option-card.selected .indicator-checkbox::after {
  transform: scale(1);
}

.option-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  flex-grow: 1;
}

/* Custom Text Inputs (For OTT waitlist details) */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.input-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.required-asterisk {
  color: var(--primary);
  margin-left: 2px;
  font-weight: bold;
}

.text-input {
  width: 100%;
  padding: 1.1rem 1.25rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all var(--transition-smooth);
}

.text-input:focus {
  outline: none;
  border-color: var(--border-selected);
  box-shadow: 0 0 16px var(--primary-glow);
  background: rgba(0, 0, 0, 0.4);
}

/* Navigation Controls block */
.navigation-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.9rem 1.8rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-secondary:disabled {
  opacity: 0;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  margin-left: auto;
  box-shadow: 0 6px 20px var(--secondary-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--primary-glow);
  filter: brightness(1.1);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Success / Thank you Slide */
.success-slide {
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.success-icon {
  width: 72px;
  height: 72px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 10px 30px var(--primary-glow);
  margin-bottom: 0.5rem;
  animation: pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes pop-in {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.success-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 320px;
  margin: 0 auto;
}

/* Footer / Meta Info */
.footer-text {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.2);
  margin-top: 0.5rem;
  letter-spacing: 0.5px;
}

.footer-text a {
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-text a:hover {
  color: var(--primary);
}

/* Custom Scrollbar for options container if screen is very short */
@media (max-height: 700px) {
  body {
    padding: 0.5rem;
  }
  .survey-card {
    min-height: auto;
    padding: 1.5rem;
  }
  .options-group {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
  }
  /* Style scrollbar */
  .options-group::-webkit-scrollbar {
    width: 4px;
  }
  .options-group::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 99px;
  }
  .options-group::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
  }
}
