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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #0a0a0a;
  color: #fff;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Animated gradient background */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #0a0a0a, #1a0033, #000d1a, #001a0d);
  background-size: 400% 400%;
  z-index: -2;
}

/* Particle canvas */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Container */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 60px;
  animation: fadeInDown 1s ease;
}

.header h1 {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  text-shadow: 0 0 40px rgba(102, 126, 234, 0.5);
}

.header .subtitle {
  font-size: 1.2rem;
  color: #aaa;
  letter-spacing: 2px;
}

/* Progress bar */
.progress-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin-bottom: 40px;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb);
  width: 0%;
  transition: width 0.5s ease;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
}

/* Question card */
.question-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
  border-radius: 20px;
  padding: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.6s ease;
  position: relative;
  overflow: visible;
}

.purple-hover::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #667eea, #764ba2, #783680, #667eea);
  border-radius: 20px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  background-size: 300% 300%;
}

.question-card:hover::before {
  opacity: 0.2;
}

@keyframes rotateBorder {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.question-number {
  font-size: 0.9rem;
  color: #667eea;
  font-weight: 600;
  letter-spacing: 3px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.question-text {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.3;
}

.question-hint {
  font-size: 1rem;
  color: #999;
  margin-bottom: 30px;
  font-style: italic;
}

/* Input field */
.input-wrapper {
  position: relative;
  margin-bottom: 30px;
}

textarea {
  width: 100%;
  padding: 20px;
  font-size: 1.1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #fff;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  transition: all 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
  background: rgba(255, 255, 255, 0.12);
}

textarea::placeholder {
  color: #a1a1a1;
}

/* Buttons */
.button-container {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  flex-direction: row-reverse;
}

button {
  flex: 1;
  padding: 18px 35px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
}

.btn-back {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-next {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

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

/* Animations */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Hidden state */
.hidden {
  display: none !important;
}

/* Results screen */
.results {
  text-align: center;
  animation: fadeInDown 1s ease;
}

.results h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #667eea 0%, #f093fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 40px auto;
}

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

/* Welcome screen */
.welcome-screen {
  text-align: center;
  animation: fadeInDown 1s ease;
}

.welcome-screen h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.welcome-screen h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #a78bfa;
  margin-bottom: 1em;
  letter-spacing: 0.5px;
}

.welcome-screen li {
  margin-bottom: 0.7em;
}

.welcome-screen p {
  font-size: 1.1rem;
  color: #aaa;
  margin-bottom: 40px;
  line-height: 1.5;
}

.btn-start {
  padding: 20px 60px;
  font-size: 1.3rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
  transition: all 0.3s ease;
}

.btn-start:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.7);
}

/* Match Result Styles */
.match-result {
  animation: fadeInUp 0.8s ease;
}

.match-header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
}

.match-header h2 {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #667eea 0%, #f093fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  animation: pulse 2s ease infinite;
}

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

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.similarity-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px 40px;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
  animation: glow 2s ease infinite;
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
  }
  50% {
    box-shadow: 0 8px 40px rgba(102, 126, 234, 0.8);
  }
}

/* AI Avatar Section */
.avatar-section {
  margin: 40px 0;
}

.avatars-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin: 0 auto;
  max-width: 1200px;
}

@media (max-width: 900px) {
  .avatars-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-title {
  font-size: 1.3rem;
  margin-bottom: 20px;
  color: #667eea;
  text-align: center;
}

.avatar-placeholder {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(102, 126, 234, 0.4);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.avatar-placeholder:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: rgba(102, 126, 234, 0.6);
}

.create-avatar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  background: none;
  border: none;
  color: #667eea;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  padding: 20px;
}

.create-avatar-btn:hover {
  color: #f093fb;
  transform: scale(1.05);
}

.avatar-plus {
  font-size: 4rem;
  font-weight: 200;
  line-height: 1;
}

.avatar-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.avatar-loading p {
  color: #999;
  font-size: 1rem;
}

.avatar-container {
  animation: fadeInUp 0.8s ease;
  width: 100%;
  max-width: 400px;
}

.avatar-image {
  width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar-image:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 50px rgba(102, 126, 234, 0.6);
}

.avatar-caption {
  margin-top: 15px;
  color: #999;
  font-size: 0.85rem;
  font-style: italic;
  text-align: center;
}

.similarity-score {
  font-size: 3rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.similarity-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 3px;
  margin-top: 5px;
}

/* Profile Grid */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-bottom: 30px;
}

.profile-section h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #667eea;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  transition: all 0.3s ease;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  color: #999;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.info-value {
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  text-align: right;
}

/* Quote Sections */
.quote-section {
  margin-bottom: 30px;
}

.quote-section h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #667eea;
}

.quote-card {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.2),
    rgba(118, 75, 162, 0.2)
  );
  border-left: 5px solid #667eea;
  padding: 30px;
  margin-bottom: 30px;
  border-radius: 15px;
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.7;
  color: #f0f0f0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  position: relative;
}

.quote-card::before {
  content: '"';
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 3rem;
  color: rgba(102, 126, 234, 0.3);
  font-family: Georgia, serif;
  line-height: 1;
}

.quote-card:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.25),
    rgba(118, 75, 162, 0.25)
  );
  transform: translateX(8px) translateY(-2px);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
}

/* AI Opinions */
.ai-opinions {
  margin-bottom: 30px;
}

.ai-opinions h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #667eea;
}

.opinion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.opinion-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  transition: all 0.3s ease;
}

.opinion-card:hover {
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-3px);
}

.opinion-title {
  font-size: 0.9rem;
  color: #999;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.opinion-text {
  font-size: 1.05rem;
  color: #fff;
  font-weight: 500;
  line-height: 1.5;
}

/* Personal Section */
.personal-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-bottom: 30px;
}

.personal-card {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.08),
    rgba(118, 75, 162, 0.08)
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 25px;
  transition: all 0.3s ease;
}

.personal-card:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.12),
    rgba(118, 75, 162, 0.12)
  );
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.personal-card h3 {
  font-size: 1.2rem;
  margin-bottom: 15px;
  color: #667eea;
}

.theme-song,
.favorite-lyric {
  font-size: 1.1rem;
  color: #e0e0e0;
  line-height: 1.6;
  font-style: italic;
}

/* Story Section */
.story-section {
  margin-bottom: 30px;
}

.story-section h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: #667eea;
}

.story-card {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
  border-left: 4px solid #667eea;
  padding: 25px;
  border-radius: 12px;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #e0e0e0;
  transition: all 0.3s ease;
}

.story-card:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.15),
    rgba(118, 75, 162, 0.15)
  );
  transform: translateX(5px);
}

/* Restart Button */
.restart-container {
  text-align: center;
  margin-top: 40px;
}

.btn-restart {
  padding: 18px 50px;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
  transition: all 0.3s ease;
}

.btn-restart:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.7);
}

/* Insights Section */
.insights-section {
  margin-bottom: 40px;
}

.insights-section h3 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: #667eea;
  text-align: center;
}

.match-summary {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 15px;
  padding: 20px 25px;
  margin-bottom: 25px;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #e0e0e0;
  text-align: center;
  animation: fadeIn 0.8s ease;
}

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

.insights-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.insight-card {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.15),
    rgba(118, 75, 162, 0.15)
  );
  border-left: 4px solid #667eea;
  padding: 20px;
  border-radius: 12px;
  animation: slideInLeft 0.5s ease forwards;
  opacity: 0;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.insight-number {
  min-width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: #fff;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.insight-content {
  flex: 1;
}

.insight-field {
  font-size: 0.9rem;
  color: #667eea;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.insight-text {
  font-size: 1.05rem;
  color: #e0e0e0;
  line-height: 1.6;
}

/* Highlighted Field */
.highlighted-field {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.2),
    rgba(118, 75, 162, 0.2)
  );
  border-left: 4px solid #f093fb !important;
  animation: glow-pulse 2s ease infinite;
}

@keyframes glow-pulse {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(240, 147, 251, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(240, 147, 251, 0.6);
  }
}

/* Margin Notes (Teacher's Comment Style) */
.margin-note {
  position: absolute;
  right: -320px;
  top: 0;
  width: 280px;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(102, 126, 234, 0.6);
  border-radius: 12px;
  padding: 12px;
  padding-top: 12px;
  animation: slideInFromRight 0.5s ease forwards;
  opacity: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.margin-note::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 20px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 10px solid rgba(102, 126, 234, 0.6);
}

.margin-note-left {
  right: auto;
  left: -320px;
  animation: slideInFromLeft 0.5s ease forwards;
}

.margin-note-left::before {
  left: auto;
  right: -10px;
  border-right: none;
  border-left: 10px solid rgba(102, 126, 234, 0.6);
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    left: -340px;
  }
  to {
    opacity: 1;
    left: -320px;
  }
}

/* Responsive: inline margin notes for narrow screens */
@media (max-width: 1349px) {
  .margin-note {
    position: relative;
    right: auto;
    left: auto;
    top: auto;
    width: 100%;
    margin-top: 15px;
    animation: fadeInUp 0.5s ease forwards;
  }

  .margin-note::before {
    display: none;
  }

  .margin-note-left {
    left: auto;
    animation: fadeInUp 0.5s ease forwards;
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    right: -340px;
  }
  to {
    opacity: 1;
    right: -320px;
  }
}

.margin-note-content {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.margin-note-text {
  font-size: 1rem;
  font-style: italic;
  line-height: 1.4;
  color: #e0e0e0;
  padding-right: 15px;
  flex: 1;
}

.margin-note-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: inherit;
  border: none;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  z-index: 1001;
}

/* List Sections with Tags */
.list-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.list-section {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 25px;
  transition: all 0.3s ease;
}

.list-section:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(102, 126, 234, 0.3);
  transform: translatey(-3px);
}

.list-section h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: #667eea;
}

.list-section .info-label {
  font-size: 0.85rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(102, 126, 234, 0.15);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 20px;
  padding: 8px 15px;
  font-size: 0.9rem;
  color: #e0e0e0;
  transition: all 0.3s ease;
  animation: tagFadeIn 0.4s ease;
}

@keyframes tagFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.tag-item.highlighted {
  background: rgba(240, 147, 251, 0.2);
  border-color: #f093fb;
  box-shadow: 0 0 15px rgba(240, 147, 251, 0.4);
  animation: tagGlow 2s ease infinite;
}

@keyframes tagGlow {
  0%,
  100% {
    box-shadow: 0 0 15px rgba(240, 147, 251, 0.4);
  }
  50% {
    box-shadow: 0 0 25px rgba(240, 147, 251, 0.6);
  }
}

.tag-checkbox {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.tag-item.highlighted .tag-checkbox {
  background: linear-gradient(135deg, #f093fb, #764ba2);
}

.tag-text {
  line-height: 1.2;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

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

.modal-content {
  background: rgba(20, 20, 30, 0.95);
  border: 2px solid rgba(102, 126, 234, 0.4);
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  position: relative;
  animation: slideUp 0.3s ease;
}

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

.modal-content h2 {
  color: #667eea;
  margin-bottom: 10px;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #999;
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
  padding: 0;
  width: 30px;
  height: 30px;
  -webkit-text-stroke: 1px white;
  color: black;
}

.modal-close:hover {
  color: #f093fb;
}

.modal-input {
  width: 100%;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.modal-input:focus {
  outline: none;
  border-color: #667eea;
}

.modal-input::placeholder {
  color: #666;
}

.tag-item.no-checkbox {
  background: rgba(102, 126, 234, 0.08);
  border-color: rgba(102, 126, 234, 0.2);
}

.tag-item.no-checkbox .tag-text {
  color: #b0b0b0;
}

.single-value {
  padding: 10px;
  background: rgba(102, 126, 234, 0.1);
  border-left: 8px solid #667eea;
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 1rem;
  margin-top: 10px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.single-value.highlighted-single-value {
  background: rgba(240, 147, 251, 0.2);
  border-left-color: #f093fb;
  box-shadow: 0 0 20px rgba(240, 147, 251, 0.4);
  animation: glow-pulse 2s ease infinite;
}

.no-data {
  color: #666;
  font-style: italic;
  padding: 10px;
}

/* Achievements Section */
.achievements-section {
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 25px;
}

.achievements-section h3 {
  font-size: 1.5rem;
  margin-bottom: 25px;
  color: #667eea;
  text-align: center;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.achievement-badge {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 15px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.achievement-badge.locked {
  opacity: 0.4;
  filter: grayscale(100%);
}

.achievement-badge.unlocked {
  border-color: #667eea;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
  animation: unlockPulse 0.6s ease;
}

.achievement-badge.highlighted {
  border-color: #f093fb !important;
  background: linear-gradient(
    135deg,
    rgba(240, 147, 251, 0.2),
    rgba(118, 75, 162, 0.2)
  ) !important;
  box-shadow: 0 0 20px rgba(240, 147, 251, 0.5);
}

@keyframes unlockPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.achievement-badge:hover.unlocked {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.achievement-icon {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.achievement-name {
  font-size: 0.9rem;
  color: #e0e0e0;
  line-height: 1.3;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.achievement-checkmark {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.6);
  animation: checkPop 0.3s ease;
}

@keyframes checkPop {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .header h1 {
    font-size: 2.5rem;
  }
  .question-card {
    padding: 30px;
  }
  .question-text {
    font-size: 1.5rem;
  }
  .button-container {
    flex-direction: column;
  }
  .profile-grid,
  .opinion-grid,
  .personal-section {
    grid-template-columns: 1fr;
  }
  .match-header h2 {
    font-size: 2rem;
  }
  .similarity-score {
    font-size: 2.5rem;
  }
}

/* Music Entity Links (Spotify links) */
a.music-entity {
  color: #1db954;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid rgba(29, 185, 84, 0.3);
  transition: all 0.3s ease;
  position: relative;
  padding: 2px 4px;
  border-radius: 3px;
}

a.music-entity:hover {
  background: rgba(29, 185, 84, 0.1);
  border-bottom-color: #1db954;
  color: #1ed760;
}

a.music-entity:active {
  transform: scale(0.98);
}

/* Optional: Add Spotify icon after links */
a.music-entity::after {
  content: "🎵";
  font-size: 0.8em;
  margin-left: 4px;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

a.music-entity:hover::after {
  opacity: 1;
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  animation: slideIn 0.3s ease;
  max-width: 400px;
  word-wrap: break-word;
}

.toast.error {
  background: linear-gradient(135deg, #ff6b6b, #c92a2a);
}

.toast.success {
  background: linear-gradient(135deg, #51cf66, #2f9e44);
}

.toast.hidden {
  display: none;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Recreate Avatar Button */
.recreate-avatar-btn {
  margin-top: 12px;
  padding: 10px 20px;
  background: rgba(102, 126, 234, 0.2);
  border: 2px solid #667eea;
  border-radius: 8px;
  color: #667eea;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.recreate-avatar-btn:hover {
  background: rgba(102, 126, 234, 0.3);
  transform: translateY(-2px);
}

.recreate-avatar-btn:active {
  transform: translateY(0);
}

/* Clickable Avatar Images */
.clickable-avatar {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.clickable-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
}

.clickable-avatar:active {
  transform: scale(1.02);
}
