:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --visual-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --auditory-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --story-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --card-light: rgba(255, 255, 255, 0.15);
  --card-dark: rgba(0, 0, 0, 0.3);
  --text-light: #1a202c;
  --text-dark: #e2e8f0;
  --accent: #4fd1c7;
  --success: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --question-light: rgba(255, 255, 255, 0.2);
  --question-dark: rgba(0, 0, 0, 0.2);
  --shadow-light: rgba(0, 0, 0, 0.1);
  --shadow-dark: rgba(0, 0, 0, 0.3);
}

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

body {
  background: var(--primary-gradient);
  color: var(--text-light);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  padding: 20px;
  min-height: 100vh;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow-x: hidden;
}

body.dark {
  background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
  color: var(--text-dark);
}

.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(79, 209, 197, 0.4) 0%,
    rgba(102, 126, 234, 0.2) 50%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate(-50%, -50%);
  filter: blur(40px);
}

.container {
  background: var(--card-light);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 40px;
  border-radius: 30px;
  max-width: 900px;
  margin: auto;
  box-shadow: 0 25px 50px var(--shadow-light);
  position: relative;
  z-index: 2;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark .container {
  background: var(--card-dark);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 25px 50px var(--shadow-dark);
}

.container:hover {
  transform: translateY(-8px);
  box-shadow: 0 35px 70px var(--shadow-light);
}

body.dark .container:hover {
  box-shadow: 0 35px 70px var(--shadow-dark);
}

h2 {
  text-align: center;
  font-size: clamp(24px, 4vw, 36px);
  margin-bottom: 30px;
  color: #2d3748;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.learning-icon {
  width: 40px;
  height: 40px;
  transition: transform 0.3s ease;
}

h2:hover .learning-icon {
  transform: scale(1.2) rotate(5deg);
}

.question {
  background: var(--question-light);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 30px;
  border-radius: 25px;
  margin-bottom: 25px;
  font-size: clamp(18px, 2.5vw, 22px);
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  color: var(--text-light);
}

body.dark .question {
  background: var(--question-dark);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-dark);
}

.question::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transition: left 0.6s ease;
}

.question:hover::before {
  left: 100%;
}

.question:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 15px 40px rgba(79, 209, 197, 0.3);
  border-color: var(--accent);
}

.question.visible {
  opacity: 1;
  transform: translateX(0);
}

.question p {
  font-weight: 600;
  margin-bottom: 20px;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 15px;
}

.question-icon {
  width: 30px;
  height: 30px;
  opacity: 0.8;
}

label {
  display: block;
  margin: 15px 0;
  font-size: clamp(16px, 2vw, 20px);
  cursor: pointer;
  padding: 15px 25px;
  border-radius: 15px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid transparent;
  color: inherit;
  backdrop-filter: blur(10px);
}

label:hover {
  background: rgba(79, 209, 197, 0.15);
  border-color: var(--accent);
  transform: translateX(15px) scale(1.02);
  box-shadow: 0 8px 25px rgba(79, 209, 197, 0.25);
}

input[type="radio"] {
  margin-right: 15px;
  accent-color: var(--accent);
  transform: scale(1.3);
}

button {
  margin-top: 40px;
  padding: 18px 45px;
  font-size: clamp(18px, 2.5vw, 22px);
  background: var(--success);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.6s ease;
}

button:hover::before {
  left: 100%;
}

button:hover {
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 18px 50px rgba(102, 126, 234, 0.5);
}

button:active {
  transform: translateY(-2px) scale(1.05);
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-spinner {
  width: 80px;
  height: 80px;
  border: 4px solid rgba(79, 209, 197, 0.3);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  color: white;
  font-size: 20px;
  margin-top: 20px;
  text-align: center;
}

#result {
  margin-top: 40px;
  padding: 35px;
  background: linear-gradient(
    135deg,
    rgba(79, 209, 197, 0.25),
    rgba(102, 126, 234, 0.25)
  );
  backdrop-filter: blur(25px);
  border: 2px solid rgba(79, 209, 197, 0.4);
  border-radius: 25px;
  font-size: clamp(18px, 2.5vw, 25px);
  display: none;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  color: var(--text-light);
}

body.dark #result {
  color: var(--text-dark);
}

#result.show {
  display: block;
  animation: bounceUp 1s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: translateY(0);
}

@keyframes bounceUp {
  0% {
    transform: translateY(50px) scale(0.8);
    opacity: 0;
  }
  50% {
    transform: translateY(-15px) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.result-chart {
  margin: 25px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.chart-container {
  position: relative;
  width: 150px;
  height: 150px;
}

.chart-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.chart-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 8;
}

.chart-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 0 377;
  animation: drawChart 2s ease-out;
}

@keyframes drawChart {
  from {
    stroke-dasharray: 0 377;
  }
}

.chart-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  font-size: 14px;
  text-align: center;
}

.learning-style-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  display: block;
}

.toggle-container {
  text-align: right;
  margin-bottom: 20px;
}

.toggle-container button {
  font-size: 16px;
  padding: 12px 20px;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(15px);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.4s ease;
  font-weight: 500;
}

body.dark .toggle-container button {
  color: var(--text-dark);
}

.toggle-container button:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  .container {
    padding: 25px;
    border-radius: 20px;
  }

  .question {
    padding: 20px;
    margin-bottom: 20px;
  }

  label {
    padding: 12px 18px;
    margin: 10px 0;
  }

  button {
    padding: 16px 35px;
    margin-top: 30px;
  }

  #result {
    padding: 25px;
    margin-top: 30px;
  }

  .result-chart {
    gap: 20px;
  }

  .chart-container {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 20px;
  }

  .question {
    padding: 15px;
  }

  label {
    padding: 10px 15px;
  }

  .chart-container {
    width: 100px;
    height: 100px;
  }
}

.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(79, 209, 197, 0.6);
  border-radius: 50%;
  animation: float 8s infinite linear;
  box-shadow: 0 0 10px rgba(79, 209, 197, 0.8);
}

.particle.interactive {
  animation: none;
  transition: all 0.3s ease;
}

@keyframes float {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) scale(1);
    opacity: 0;
  }
}

.personality-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 25px;
}

.personality-trait {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 15px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.trait-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  display: block;
}

.clear-form-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  color: white;
  font-weight: 600;
  font-size: 14px;
  padding: 0;
}

.clear-form-btn:hover {
  width: 140px;
  border-radius: 30px;
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(255, 107, 107, 0.5);
}

.clear-form-btn .btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.clear-form-btn .btn-icon {
  width: 24px;
  height: 24px;
  transition: all 0.3s ease;
  flex-shrink: 0;
  fill: white;
}
.clear-form-btn .btn-icon svg {
  fill: white;
}

.clear-form-btn .btn-text {
  opacity: 0;
  margin-left: 8px;
  white-space: nowrap;
  transition: opacity 0.3s ease 0.1s;
  font-size: 14px;
}

.clear-form-btn:hover .btn-text {
  opacity: 1;
}

.clear-form-btn:hover .btn-icon {
  transform: rotate(180deg);
}

.clear-form-btn:active {
  transform: translateY(-1px) scale(0.95);
}

@media (max-width: 768px) {
  .clear-form-btn {
    bottom: 20px;
    right: 20px;
    width: 120px;
    border-radius: 30px;
  }

  .clear-form-btn:hover {
    width: 120px;
  }

  .clear-form-btn .btn-icon {
    width: 20px;
    height: 20px;
  }

  .clear-form-btn .btn-text {
    font-size: 12px;
    opacity: 1;
    transition: none;
  }

  .clear-form-btn:hover .btn-text {
    opacity: 1;
  }

  .clear-form-btn:hover .btn-icon {
    transform: none;
  }
}
