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

/* === Theme tokens === */
:root{
  --bg-purple: #673ab7;      /* main purple */
  --bg-purple-dark: #4b2f8a; /* darker card/backdrop */
  --text: #ffffff;           /* white text */
  --border: #cfcfe6;         /* light border */
  --accent: #b388ff;         /* light purple accent */
}

/* === Base layout (keeps your original inline rules) === */
body {
  /* original layout */
  max-width: 460px;
  margin: 2rem auto;
  padding: 0 1rem;

  /* pixel look + theme */
  font-family: 'Inter', sans-serif;
  background: #ffffff; /* solid white */
  color: #673ab7;      /* purple text */
  text-shadow: none;   /* remove shadows */

  /* crisper rendering */
  image-rendering: pixelated;       /* helps images/icons if scaled */
  -webkit-font-smoothing: none;     /* disable subpixel AA for blocky look (WebKit) */
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
}

/* === Card (keeps original behavior) === */
.card {
  border: 1px solid #673ab7;
  border-radius: 10px;
  padding: 1rem;

  /* subtle card background to stand out on purple */
  background: #ffffff; /* solid white for consistency */
  box-shadow: none;
}

/* === Visibility helper (must exist for sign-in/sign-out toggles) === */
.hidden {
  display: none;
}

/* === Inputs & buttons (keeps original sizes, adds theme) === */
input,
button {
  padding: .6rem .8rem;              /* original */
  border-radius: 8px;                /* original */
  border: 1px solid #673ab7;
  background: #ffffff;
  color: #673ab7;
  outline: none;
  font-family: 'Inter', sans-serif;
  display: flex;
  margin: 1rem auto;
}

input::placeholder {
  color: #ddd;
}

/* === Buttons (keeps original cursor) === */
button {
  cursor: pointer;                   /* original */
  background: #ffffff;
  border-color: #673ab7;
  color: #673ab7;
  font-family: 'Inter', sans-serif;
}

button:hover {
    border-color: #4b2f8a;
}

button:active {
  transform: translateY(1px);
}

/* === Optional: headings spacing without breaking pixel vibe === */
h1, h2, h3 {
  line-height: 1.25;
  margin: 0 0 1rem 0;
}

/* === Optional: links === */
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* === Background animation canvas === */
#nameCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  /* Mobile optimizations */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
  #nameCanvas {
    /* Reduce quality on mobile for better performance */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
  }
}

/* === Profile Header === */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.profile-header h1 {
  margin: 0;
  flex: 1;
}


/* === Form Header === */
.form-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.btn-save-close {
  padding: 0.6rem 1.2rem;
  background: #f0f0f0;
  color: #673ab7;
  border: 1px solid #673ab7;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.btn-save-close:hover {
  background: #e0e0e0;
}

.profile-form {
  background: #ffffff;
  border: 1px solid #673ab7;
  border-radius: 10px;
  padding: 2rem;
  margin-top: 1rem;
}

/* === Age Range Inputs === */
.age-range-inputs {
  display: flex;
  gap: 1rem;
  align-items: end;
}

.age-input-group {
  flex: 1;
}

.age-input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #333;
}

.age-input-group input[type="number"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  text-align: center;
}

.age-input-group input[type="number"]:focus {
  outline: none;
  border-color: #673ab7;
  box-shadow: 0 0 0 2px rgba(103, 58, 183, 0.2);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #673ab7;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #673ab7;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  background: #ffffff;
  color: #673ab7;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #4b2f8a;
  box-shadow: 0 0 0 2px rgba(103, 58, 183, 0.2);
}

/* Hobbies */
.hobbies-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hobbies-container input {
  flex: 1;
}

.hobbies-container button {
  padding: 0.8rem 1rem;
  background: #673ab7;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}

.hobbies-container button:hover {
  background: #4b2f8a;
}

.hobbies-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hobby-tag {
  display: inline-flex;
  align-items: center;
  background: #f0f0f0;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin: 0.2rem;
}

.hobby-tag button {
  background: none;
  border: none;
  margin-left: 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
  padding: 0;
}

.hobby-tag button:hover {
  color: #ff0000;
}

/* Dual Range Slider */
.dual-range-container {
  max-width: 300px;
  margin: 0 auto;
}

.dual-range-track {
  position: relative;
  height: 6px;
  background: #ddd;
  border-radius: 3px;
  margin: 1rem 0;
}

.dual-range-fill {
  position: absolute;
  height: 100%;
  background: #673ab7;
  border-radius: 3px;
  pointer-events: none;
}

.dual-range-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
}

.dual-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: #673ab7;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dual-range-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #673ab7;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.age-display {
  text-align: center;
  font-weight: 600;
  color: #673ab7;
  margin-top: 0.5rem;
}

/* Checkbox Group */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
  justify-items: start;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  font-weight: normal;
  cursor: pointer;
  margin: 0;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
  margin-left: 0;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  gap: 1rem;
}

.btn-primary,
.btn-secondary {
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-size: 0.9rem;
}

.btn-primary {
  background: #673ab7;
  color: white;
}

.btn-primary:hover {
  background: #4b2f8a;
}

.btn-secondary {
  background: #f0f0f0;
  color: #673ab7;
  border: 1px solid #673ab7;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

/* Question Page Styles */
.question-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.question-card {
  background: #ffffff;
  border: 1px solid #673ab7;
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 1rem;
}

.question-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #673ab7;
  margin-bottom: 1rem;
  text-align: center;
}

.question-prompt {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  text-align: center;
}

.scale-container {
  margin-bottom: 2rem;
  text-align: center;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.scale-label {
  font-size: 0.9rem;
  color: #666;
  text-align: center;
  max-width: 120px;
}

.scale-slider {
  width: 100%;
  height: 8px;
  background: #ddd;
  border-radius: 4px;
  outline: none;
  margin-bottom: 0.5rem;
  -webkit-appearance: none;
}

.dots-container {
  position: relative;
  margin-bottom: 1rem;
}

.dots-scale {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
  padding: 0 1rem;
}

.dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ecf0f1;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid #bdc3c7;
}

.dot:nth-child(1), .dot:nth-child(7) {
  width: 30px;
  height: 30px;
}

.dot:nth-child(2), .dot:nth-child(6) {
  width: 26px;
  height: 26px;
}

.dot:nth-child(3), .dot:nth-child(5) {
  width: 22px;
  height: 22px;
}

.dot:nth-child(4) {
  width: 18px;
  height: 18px;
}

.dot:hover {
  background: #3498db;
  border-color: #2980b9;
  transform: scale(1.1);
}

.dot.active {
  background: #673ab7;
  border-color: #5e35b1;
  transform: scale(1.2);
}

.current-value {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #673ab7;
  margin-top: 1rem;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  display: inline-block;
  min-width: 60px;
}

.scale-slider::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  background: #673ab7;
  border-radius: 50%;
  cursor: pointer;
}

.scale-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: #673ab7;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  margin-bottom: 2rem;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #673ab7;
  transition: width 0.3s ease;
}

/* Confirmation Page Styles */
.confirmation-card {
  background: #ffffff;
  border: 1px solid #673ab7;
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  max-width: 600px;
  margin: 2rem auto;
}

.confirmation-content h1 {
  color: #673ab7;
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.confirmation-content p {
  margin-bottom: 1rem;
  line-height: 1.5;
}

.profile-summary {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: left;
}

.profile-summary h3 {
  color: #673ab7;
  margin-bottom: 1rem;
  text-align: center;
}

.profile-summary p {
  margin-bottom: 0.5rem;
}

.next-steps {
  background: #e8f5e8;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.next-steps h3 {
  color: #2e7d32;
  margin-bottom: 1rem;
}

.next-steps p {
  margin-bottom: 0.5rem;
  color: #2e7d32;
}

/* === Welcome message styles === */
.welcome-message {
  text-align: center;
  padding: 2rem;
}

.welcome-message h2 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 2rem;
}

.welcome-message p {
  color: #7f8c8d;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.profile-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.profile-actions .btn-primary,
.profile-actions .btn-secondary {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.profile-actions .btn-primary {
  background-color: #3498db;
  color: white;
}

.profile-actions .btn-primary:hover {
  background-color: #2980b9;
}

.profile-actions .btn-secondary {
  background-color: #ecf0f1;
  color: #2c3e50;
  border: 2px solid #bdc3c7;
}

.profile-actions .btn-secondary:hover {
  background-color: #d5dbdb;
  border-color: #95a5a6;
}