/* ==========================================================================
   VIBE.exe — Apple × Nothing × Linear Design System
   ========================================================================== */

:root {
  --bg-base: #0B0B0F;
  --bg-card: rgba(19, 19, 26, 0.75);
  --bg-card-hover: rgba(28, 28, 38, 0.85);
  --bg-elevated: rgba(255, 255, 255, 0.03);
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-highlight: rgba(255, 255, 255, 0.16);
  --border-active: rgba(99, 102, 241, 0.8);
  
  --text-main: #FFFFFF;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;
  
  --accent-indigo: #6366F1;
  --accent-purple: #8B5CF6;
  --accent-pink: #EC4899;
  --accent-emerald: #10B981;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Space Grotesk', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 280ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Visibility & Utilities Fallback */
.hidden,
.quiz-view.hidden,
[hidden] {
  display: none !important;
}

/* SVG Icon Constraints */
svg:not(.card-visual-svg) {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

svg.w-3, .w-3 { width: 0.75rem !important; height: 0.75rem !important; }
svg.w-3\.5, .w-3\.5 { width: 0.875rem !important; height: 0.875rem !important; }
svg.w-4, .w-4 { width: 1rem !important; height: 1rem !important; }
svg.w-5, .w-5 { width: 1.25rem !important; height: 1.25rem !important; }
svg.w-6, .w-6 { width: 1.5rem !important; height: 1.5rem !important; }

.h-3 { height: 0.75rem !important; }
.h-3\.5 { height: 0.875rem !important; }
.h-4 { height: 1rem !important; }
.h-5 { height: 1.25rem !important; }
.h-6 { height: 1.5rem !important; }

html {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-main);
  color-scheme: dark;
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-base);
  line-height: 1.5;
}

/* Background Ambient Dynamic Aura */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
  will-change: transform;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.glow-orb-1 {
  width: 50vw;
  height: 50vw;
  top: -10vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.4) 0%, transparent 70%);
  animation-duration: 22s;
}

.glow-orb-2 {
  width: 55vw;
  height: 55vw;
  bottom: -15vw;
  right: -10vw;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, transparent 70%);
  animation-duration: 28s;
  animation-delay: -5s;
}

.glow-orb-3 {
  width: 40vw;
  height: 40vw;
  top: 40%;
  left: 35%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.2) 0%, transparent 70%);
  animation-duration: 25s;
  animation-delay: -10s;
}

.noise-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  pointer-events: none;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4vw, 5vh) scale(1.08); }
  100% { transform: translate(-3vw, -4vh) scale(0.95); }
}

/* Layout Containers & Views */
.quiz-app-container {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.quiz-view {
  width: 100%;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

#view-intro {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px;
}

#view-intro .max-w-xl {
  max-width: 580px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#view-quiz {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 16px;
  max-width: 860px;
  margin: 0 auto;
}

#view-analyzing {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px;
}

#view-result {
  min-height: 90vh;
  padding: 32px 16px;
  max-width: 768px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Common Flex & Alignment Helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* Grid Helpers */
.grid { display: grid; }
.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Glassmorphism Classes */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 
              inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
  transition: all var(--transition-normal);
}

.glass-pill {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.glass-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-highlight);
}

/* Buttons */
.vibe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  border: none;
  outline: none;
  user-select: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
}

.vibe-btn svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
}

.vibe-btn-primary {
  background: #FFFFFF;
  color: #0B0B0F;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 20px -3px rgba(255, 255, 255, 0.25),
              0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
}

.vibe-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px 2px rgba(255, 255, 255, 0.4),
              0 6px 20px rgba(0, 0, 0, 0.4);
}

.vibe-btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.vibe-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
}

.vibe-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-highlight);
  color: #FFFFFF;
}

.vibe-btn-secondary:active {
  transform: scale(0.98);
}

.btn-glow-layer {
  position: absolute;
  inset: -2px;
  background: linear-gradient(90deg, #6366F1, #A855F7, #EC4899);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-normal);
  filter: blur(8px);
}

.vibe-btn-primary:hover .btn-glow-layer {
  opacity: 0.6;
}

/* Typography Enhancements */
.gradient-text-subtle {
  background: linear-gradient(135deg, #FFFFFF 0%, #E2E8F0 50%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.font-mono {
  font-family: var(--font-mono);
}

/* Question Options Grid & Cards */
.options-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

@media (min-width: 640px) {
  .options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 900px) {
  .options-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

.option-card {
  position: relative;
  background: rgba(19, 19, 26, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-normal);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.option-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  opacity: 0.4;
}

.option-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.6);
}

.option-card:hover::before {
  opacity: 1;
}

.option-card:active {
  transform: scale(0.98);
}

.option-card.selected {
  border-color: rgba(129, 140, 248, 0.9);
  background: rgba(30, 27, 75, 0.5);
  box-shadow: 0 0 35px -5px rgba(99, 102, 241, 0.4),
              inset 0 0 15px rgba(99, 102, 241, 0.15);
}

.option-card.selected::before {
  background: linear-gradient(135deg, #818CF8, #C084FC);
  opacity: 1;
}

/* Card Visual Graphic Area */
.card-visual {
  width: 100%;
  height: 120px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background-size: cover;
  background-position: center;
  transition: transform var(--transition-normal);
}

.option-card:hover .card-visual {
  transform: scale(1.02);
}

.card-visual-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Card Content */
.card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-desc {
  font-size: 12px;
  color: #94A3B8;
  line-height: 1.45;
}

/* Palette Previews in Card */
.palette-bar {
  display: flex;
  height: 28px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.palette-bar-segment {
  flex: 1;
  height: 100%;
  transition: flex var(--transition-fast);
}

.palette-bar-segment:hover {
  flex: 1.5;
}

/* Swatch Preview Cards */
.swatch-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.swatch-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-highlight);
  transform: translateY(-2px);
}

.swatch-color-pill {
  width: 100%;
  height: 48px;
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Trait Card */
.trait-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(18, 18, 24, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-highlight);
  color: #FFFFFF;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
}

@keyframes toastSlideUp {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

.animate-fade-in {
  animation: fadeIn 0.6s var(--transition-normal) forwards;
}

.animate-fade-up {
  animation: fadeUp 0.6s var(--transition-smooth) forwards;
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

@keyframes pingSlow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.12); opacity: 0.2; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.animate-ping-slow {
  animation: pingSlow 3s infinite ease-in-out;
}

@keyframes pingSoft {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.4; }
}

.animate-ping-soft {
  animation: pingSoft 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.animate-shake {
  animation: shake 0.4s ease-in-out;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  position: relative;
  z-index: 10;
  animation: fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile Adjustments */
@media (max-width: 640px) {
  .card-visual {
    height: 100px;
  }
  .option-card {
    padding: 14px;
  }
}

/* ==========================================================================
   Result Screen Typography High-Contrast Enhancements
   ========================================================================== */
#view-result {
  color: #FFFFFF !important;
}

#res-title {
  color: #FFFFFF !important;
  font-weight: 800 !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

#res-subtitle {
  color: #A5B4FC !important;
  font-weight: 700 !important;
  letter-spacing: 0.15em !important;
}

#res-tagline {
  color: #F1F5F9 !important;
  font-weight: 400 !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

#res-description {
  color: #FFFFFF !important;
  font-size: 1.05rem !important;
  line-height: 1.8 !important;
  font-weight: 400 !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8) !important;
  letter-spacing: 0.01em !important;
  margin-bottom: 24px !important;
}

.trait-card {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.trait-card span:first-child {
  color: #94A3B8 !important;
  font-weight: 500 !important;
}

.trait-card span:last-child {
  color: #FFFFFF !important;
  font-weight: 600 !important;
}
