/* Product Reaction Cards - Plain HTML/CSS/JS Version */

:root {
  /* Soft, warm neutral background */
  --background: 40 20% 98%;
  --foreground: 220 20% 20%;

  /* Cards and surfaces */
  --card: 0 0% 100%;
  --card-foreground: 220 20% 20%;

  /* Primary - Calm teal-blue for trust */
  --primary: 186 45% 45%;
  --primary-foreground: 0 0% 100%;

  /* Secondary - Soft neutral */
  --secondary: 220 15% 94%;
  --secondary-foreground: 220 20% 30%;

  /* Muted states */
  --muted: 220 15% 96%;
  --muted-foreground: 220 10% 55%;

  /* Accent for subtle highlights */
  --accent: 186 40% 95%;
  --accent-foreground: 186 45% 35%;

  /* Borders and inputs */
  --border: 220 15% 90%;
  --ring: 186 45% 45%;

  /* Radius */
  --radius: 0.75rem;

  /* Selection state */
  --selected: 186 45% 45%;
  --selected-foreground: 0 0% 100%;
  --selected-border: 186 45% 40%;

  /* Disabled state */
  --disabled: 220 10% 92%;
  --disabled-foreground: 220 10% 60%;

  /* Success/completion */
  --success: 160 50% 45%;
  --success-foreground: 0 0% 100%;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  min-height: 100vh;
  font-feature-settings: "cv11", "ss01";
}

#app {
  min-height: 100vh;
}

/* Screen management */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen.hidden {
  display: none;
}

/* Loading screen */
#loading-screen {
  align-items: center;
  justify-content: center;
}

.loading-content {
  text-align: center;
}

/* Error screen */
#error-screen {
  align-items: center;
  justify-content: center;
}

.error-content {
  text-align: center;
  max-width: 28rem;
  padding: 1.5rem;
}

.error-content h1 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

/* Study Off screen */
#study-off-screen {
  align-items: center;
  justify-content: center;
}

.study-off-content {
  text-align: center;
  max-width: 28rem;
  padding: 1.5rem;
}

.icon-circle {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background-color: hsl(var(--muted));
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-circle .icon {
  width: 2rem;
  height: 2rem;
  color: hsl(var(--muted-foreground));
}

/* Landing screen */
#landing-screen {
  padding: 2rem 1.5rem;
}

.landing-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 28rem;
  margin: 0 auto;
  text-align: center;
}

.icon-box {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 2rem;
  border-radius: 1rem;
  background-color: hsl(var(--primary) / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-large {
  width: 2.5rem;
  height: 2.5rem;
  color: hsl(var(--primary));
}

.landing-title {
  font-size: 1.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.2;
  color: hsl(var(--foreground));
}

@media (min-width: 640px) {
  .landing-title {
    font-size: 1.875rem;
  }
}

.landing-subtitle {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2.5rem;
  color: hsl(var(--muted-foreground));
}

@media (min-width: 640px) {
  .landing-subtitle {
    font-size: 1.125rem;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0.5rem 1rem;
}

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

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover:not(:disabled) {
  background-color: hsl(var(--primary) / 0.9);
}

.btn-lg {
  min-width: 10rem;
  height: 3rem;
  font-size: 1rem;
  font-weight: 500;
  gap: 0.5rem;
}

.btn-full {
  width: 100%;
}

.icon-small {
  width: 1rem;
  height: 1rem;
}

.icon-medium {
  width: 1.25rem;
  height: 1.25rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: hsl(var(--background) / 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid hsl(var(--border));
}

.header-content {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem 1rem;
}

@media (min-width: 640px) {
  .header-content {
    padding: 1rem 1.5rem;
  }
}

.header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-text {
  flex: 1;
  min-width: 0;
}

.heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .heading {
    font-size: 1.25rem;
  }
}

.hint {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.125rem;
  display: none;
}

@media (min-width: 640px) {
  .hint {
    display: block;
  }
}

.back-button {
  padding: 0.5rem;
  margin-left: -0.5rem;
  border-radius: 0.5rem;
  color: hsl(var(--muted-foreground));
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-button:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--secondary));
}

.selection-counter-container {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid hsl(var(--border));
}

.selection-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.counter-dots {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.counter-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background-color: hsl(var(--border));
  transition: all 0.2s;
}

.counter-dot.active {
  background-color: hsl(var(--primary));
}

.counter-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  margin-left: 0.5rem;
}

.counter-message {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--primary));
  margin-top: 0.25rem;
}

.counter-message.hidden {
  display: none;
}

/* Main content */
.main-content {
  flex: 1;
  max-width: 48rem;
  margin: 0 auto;
  width: 100%;
  padding: 1.5rem 1rem;
}

@media (min-width: 640px) {
  .main-content {
    padding: 1.5rem 1.5rem;
  }
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
}

/* Reaction card */
.reaction-card {
  position: relative;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  text-align: left;
  transition: all 0.2s;
  border: 2px solid;
  font-weight: 500;
  font-size: 1rem;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-between;
  gap: 0.5rem;
  cursor: pointer;
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-color: hsl(var(--border));
}

.reaction-card:hover:not(.disabled):not(.selected) {
  border-color: hsl(var(--primary) / 0.4);
  background-color: hsl(var(--accent) / 0.5);
}

.reaction-card:focus {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring)), 0 0 0 4px hsl(var(--ring) / 0.2);
}

.reaction-card.selected {
  background-color: hsl(var(--selected));
  color: hsl(var(--selected-foreground));
  border-color: hsl(var(--selected-border));
}

.reaction-card.disabled:not(.selected) {
  background-color: hsl(var(--disabled));
  color: hsl(var(--disabled-foreground));
  border-color: hsl(var(--disabled));
  cursor: not-allowed;
  opacity: 0.6;
}

.reaction-card-label {
  line-height: 1.4;
}

.reaction-card-check {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  display: none;
}

.reaction-card.selected .reaction-card-check {
  display: block;
}

/* Footer */
.footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background-color: hsl(var(--background) / 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid hsl(var(--border));
}

.footer-content {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 640px) {
  .footer-content {
    padding: 1rem 1.5rem;
  }
}

/* Thank You screen */
#thankyou-screen {
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.thankyou-content {
  text-align: center;
  max-width: 28rem;
}

.success-icon {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 2rem;
  border-radius: 50%;
  background-color: hsl(var(--success) / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.3s ease-out;
}

.success-icon .icon-large {
  color: hsl(var(--success));
}

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

.thankyou-title {
  font-size: 1.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: hsl(var(--foreground));
  animation: fadeInUp 0.3s ease-out 0.1s both;
}

@media (min-width: 640px) {
  .thankyou-title {
    font-size: 1.875rem;
  }
}

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

/* Utility classes */
.text-muted {
  color: hsl(var(--muted-foreground));
}

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

.screen:not(.hidden) {
  animation: fadeIn 0.3s ease-out;
}
