/*
 * Application styles
 */

/* === Animated background === */
.animated-bg {
  background: linear-gradient(-45deg, #0f0b1e, #1a1333, #0d1f3c, #121028);
  background-size: 400% 400%;
  animation: bg-shift 15s ease infinite;
}

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

/* === Floating shapes === */
.floating-shapes {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.floating-shapes span {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: 0.06;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
}

.floating-shapes span:nth-child(1) { width: 80px; height: 80px; top: 10%; left: 10%; animation: float-around 20s linear infinite; }
.floating-shapes span:nth-child(2) { width: 120px; height: 120px; top: 60%; right: 10%; animation: float-around 25s linear infinite reverse; }
.floating-shapes span:nth-child(3) { width: 60px; height: 60px; top: 40%; left: 50%; animation: float-around 18s linear infinite; }
.floating-shapes span:nth-child(4) { width: 150px; height: 150px; bottom: 10%; left: 20%; animation: float-around 22s linear infinite reverse; }
.floating-shapes span:nth-child(5) { width: 40px; height: 40px; top: 20%; right: 30%; animation: float-around 16s linear infinite; }

@keyframes float-around {
  0% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.9); }
  75% { transform: translate(40px, 10px) scale(1.05); }
  100% { transform: translate(0, 0) scale(1); }
}

/* === Gradient text === */
.gradient-text {
  background: linear-gradient(135deg, #c7d2fe, #a78bfa, #818cf8, #6366f1);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-shimmer 4s ease-in-out infinite;
}

@keyframes text-shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 200% center; }
}

/* === Glass card === */
.glass-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='32' style='font-size:24px'><text y='24'>🧠</text></svg>") 14 16, auto;
}

/* === CTA button === */
.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.875rem 2rem;
  min-height: 48px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 9999px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  transition: all 0.3s ease;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.6);
  background: linear-gradient(135deg, #818cf8, #a78bfa);
}

.cta-button:active {
  transform: translateY(0);
}

/* === Share banner === */
.share-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0 0 1rem 1rem;
  background: rgba(99, 102, 241, 0.08);
  color: #a5b4fc;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-banner:hover {
  background: rgba(99, 102, 241, 0.15);
  color: #c7d2fe;
}

.share-banner:active {
  background: rgba(99, 102, 241, 0.2);
}

.cta-icon {
  font-size: 1.25rem;
}

/* === Float animation for hero emoji === */
.float-animation {
  animation: gentle-float 3s ease-in-out infinite;
}

@keyframes gentle-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* === Fade in up entrance === */
.fade-in-up {
  animation: fade-in-up 0.6s ease-out;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Result card appear === */
.result-appear {
  animation: result-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes result-pop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* === Loading brain animation === */
.loading-brain {
  font-size: 3.5rem;
  animation: brain-bounce 1s ease-in-out infinite, brain-glow 2s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.6));
}

@keyframes brain-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-12px) rotate(-5deg); }
  75% { transform: translateY(-4px) rotate(5deg); }
}

@keyframes brain-glow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4)); }
  50% { filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.8)); }
}

/* Bouncing dots */
.loading-dots {
  display: flex;
  gap: 6px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  animation: dot-bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* Message fade transition */
.loading-message {
  transition: opacity 0.3s ease, transform 0.3s ease;
  min-height: 1.25rem;
}

.loading-fade-out {
  opacity: 0;
  transform: translateY(6px);
}

.loading-fade-in {
  opacity: 1;
  transform: translateY(0);
}

/* Fake progress bar */
.loading-progress-bar {
  width: 200px;
  height: 4px;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.loading-progress-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, #6366f1, #a78bfa, #6366f1);
  background-size: 200% 100%;
  border-radius: 9999px;
  animation: progress-slide 2.5s ease-in-out infinite;
}

@keyframes progress-slide {
  0% { width: 0%; transform: translateX(0); background-position: 0% 0; }
  50% { width: 70%; background-position: 100% 0; }
  100% { width: 30%; transform: translateX(560%); background-position: 0% 0; }
}

/* Result card styling */
.result-card h2 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  color: #e0e7ff;
  margin: 0 0 0.25rem 0;
}

.result-card > h2 + p {
  margin: 0 0 1.25rem 0;
}

.result-card > h2 + p em {
  font-style: normal;
  color: #818cf8;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.025em;
}

.result-card p {
  color: #c7d2fe;
}

.result-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result-card h2,
.result-card p,
.result-card ul {
  text-align: center;
}

.result-card ul li {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #c7d2fe;
  text-align: left;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.result-card ul li:last-child {
  border-bottom: none;
}

.result-card ul li strong {
  color: #e0e7ff;
  font-weight: 600;
}

/* === Title shake on hover (TDAH clin d'oeil) === */
.gradient-text:hover {
  animation: text-shimmer 4s ease-in-out infinite, title-shake 0.4s ease-in-out infinite;
}

@keyframes title-shake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-1px, 1px); }
  50% { transform: translate(1px, -1px); }
  75% { transform: translate(-1px, -1px); }
}

/* === Brain spin on click === */
.brain-spin {
  animation: brain-full-spin 0.6s ease-in-out;
}

@keyframes brain-full-spin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.3); }
  100% { transform: rotate(360deg) scale(1); }
}

/* === Tabs === */
.tab-bar {
  display: flex;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9999px;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}

.tab-bar button {
  flex: 1;
  padding: 0.5rem 0.25rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.tab-active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.tab-inactive {
  background: transparent;
  color: #9ca3af;
}

.tab-inactive:hover {
  color: #c7d2fe;
  background: rgba(255, 255, 255, 0.04);
}

/* === Quiz === */
.quiz-choice {
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.quiz-choice:hover {
  background: rgba(99, 102, 241, 0.08);
}

.quiz-step {
  animation: fade-in-up 0.3s ease-out;
}
