/* ==========================================================================
   BETENZA - Enza Momentum Core Alpine Theme
   Custom CSS: Animations, Overrides & Prose Styling
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
  --color-primary: #1e3a5f;
  --color-primary-light: #2d5a8a;
  --color-accent: #3b82f6;
  --color-accent-glow: rgba(59, 130, 246, 0.15);
  --color-gold: #d4a853;
  --color-gold-light: #e8c47a;
  --color-surface: #0f172a;
  --color-surface-elevated: #1e293b;
  --color-surface-card: #162032;
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-border: rgba(148, 163, 184, 0.15);
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --font-heading: "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   Keyframe Animations
   -------------------------------------------------------------------------- */

/* Particle Float Animation */
@keyframes particleFloat {
  0%,
  100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.4;
  }
  25% {
    transform: translateY(-1.5rem) translateX(0.5rem) scale(1.1);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-2.5rem) translateX(-0.5rem) scale(1);
    opacity: 0.5;
  }
  75% {
    transform: translateY(-1rem) translateX(0.75rem) scale(0.9);
    opacity: 0.6;
  }
}

/* Subtle Tilt Animation */
@keyframes subtleTilt {
  0%,
  100% {
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: perspective(1000px) rotateX(1deg) rotateY(-1deg);
  }
  75% {
    transform: perspective(1000px) rotateX(-1deg) rotateY(1deg);
  }
}

/* Glow Pulse */
@keyframes glowPulse {
  0%,
  100% {
    box-shadow: 0 0 1.25rem var(--color-accent-glow);
  }
  50% {
    box-shadow: 0 0 2rem var(--color-accent-glow), 0 0 3rem rgba(59, 130, 246, 0.1);
  }
}

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(1.25rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shimmer Effect */
@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* Slide In */
@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   Animation Utility Classes
   -------------------------------------------------------------------------- */
.animate-particle {
  animation: particleFloat 8s ease-in-out infinite;
}

.animate-particle-delayed {
  animation: particleFloat 10s ease-in-out infinite;
  animation-delay: -3s;
}

.animate-particle-slow {
  animation: particleFloat 12s ease-in-out infinite;
  animation-delay: -5s;
}

.animate-tilt {
  animation: subtleTilt 6s ease-in-out infinite;
}

.animate-glow {
  animation: glowPulse 3s ease-in-out infinite;
}

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

.animate-shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}

/* Staggered Animation Delays */
.delay-100 {
  animation-delay: 0.1s;
}
.delay-200 {
  animation-delay: 0.2s;
}
.delay-300 {
  animation-delay: 0.3s;
}
.delay-400 {
  animation-delay: 0.4s;
}
.delay-500 {
  animation-delay: 0.5s;
}

/* --------------------------------------------------------------------------
   Component Overrides
   -------------------------------------------------------------------------- */

/* Navigation */
.nav-link {
  position: relative;
  transition: color 0.3s var(--transition-smooth);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -0.25rem;
  left: 0;
  width: 0;
  height: 0.125rem;
  background: var(--color-accent);
  transition: width 0.3s var(--transition-smooth);
}

.nav-link:hover::after {
  width: 100%;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary-light) 100%);
  transition: all 0.3s var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-accent) 100%);
  opacity: 0;
  transition: opacity 0.3s var(--transition-smooth);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-0.125rem);
  box-shadow: 0 0.5rem 1.5rem rgba(59, 130, 246, 0.25);
}

.btn-secondary {
  border: 0.125rem solid var(--color-gold);
  color: var(--color-gold);
  background: transparent;
  transition: all 0.3s var(--transition-smooth);
}

.btn-secondary:hover {
  background: var(--color-gold);
  color: var(--color-surface);
}

/* Cards */
.card-game {
  background: var(--color-surface-card);
  border: 0.0625rem solid var(--color-border);
  transition: all 0.3s var(--transition-smooth);
}

.card-game:hover {
  transform: translateY(-0.375rem);
  border-color: var(--color-accent);
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.3), 0 0 1.25rem var(--color-accent-glow);
}

/* Bonus Badge */
.bonus-badge {
  background: linear-gradient(135deg, var(--color-surface-elevated) 0%, var(--color-surface-card) 100%);
  border: 0.0625rem solid var(--color-gold);
  position: relative;
}

.bonus-badge::before {
  content: "";
  position: absolute;
  inset: -0.0625rem;
  background: linear-gradient(135deg, var(--color-gold) 0%, transparent 50%, var(--color-gold) 100%);
  border-radius: inherit;
  z-index: -1;
  opacity: 0.3;
}

/* Particles Container */
.particles-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 0.375rem;
  height: 0.375rem;
  background: var(--color-accent);
  border-radius: 50%;
  opacity: 0.4;
}

/* Table Responsive Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------------------
   Prose Styling for Markdown Content
   -------------------------------------------------------------------------- */
.prose {
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 100%;
}

/* Prose Headings */
.prose h2 {
  color: var(--color-text-primary);
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2.5em;
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 0.125rem solid var(--color-border);
  letter-spacing: -0.025em;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  color: var(--color-text-primary);
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
  margin-top: 2em;
  margin-bottom: 0.75em;
  letter-spacing: -0.015em;
}

.prose h4 {
  color: var(--color-text-secondary);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

/* Prose Paragraphs */
.prose p {
  margin-bottom: 1.25em;
  color: var(--color-text-secondary);
}

.prose p:last-child {
  margin-bottom: 0;
}

/* Prose Links */
.prose a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.1875rem;
  transition: color 0.2s var(--transition-smooth);
}

.prose a:hover {
  color: var(--color-gold);
}

/* Prose Strong & Emphasis */
.prose strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.prose em {
  font-style: italic;
}

/* Prose Lists */
.prose ul,
.prose ol {
  margin-top: 1.25em;
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

.prose ul {
  list-style-type: disc;
}

.prose ol {
  list-style-type: decimal;
}

.prose li {
  margin-bottom: 0.5em;
  color: var(--color-text-secondary);
  padding-left: 0.375em;
}

.prose li::marker {
  color: var(--color-accent);
}

.prose ul ul,
.prose ol ol,
.prose ul ol,
.prose ol ul {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

/* Prose Tables */
.prose .table-responsive {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  border-radius: 0.5rem;
  border: 0.0625rem solid var(--color-border);
  overflow-x: auto;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.prose thead {
  background: var(--color-surface-elevated);
}

.prose th {
  color: var(--color-text-primary);
  font-weight: 600;
  text-align: left;
  padding: 0.875rem 1rem;
  border-bottom: 0.125rem solid var(--color-border);
  white-space: nowrap;
}

.prose td {
  padding: 0.75rem 1rem;
  border-bottom: 0.0625rem solid var(--color-border);
  color: var(--color-text-secondary);
}

.prose tbody tr:last-child td {
  border-bottom: none;
}

.prose tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
}

/* Prose Blockquotes */
.prose blockquote {
  margin: 1.5em 0;
  padding: 1em 1.5em;
  border-left: 0.25rem solid var(--color-accent);
  background: var(--color-surface-elevated);
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
}

.prose blockquote p {
  margin: 0;
  color: var(--color-text-secondary);
}

/* Prose Code */
.prose code {
  background: var(--color-surface-elevated);
  color: var(--color-gold);
  padding: 0.125em 0.375em;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: "Fira Code", "Consolas", monospace;
}

.prose pre {
  background: var(--color-surface-elevated);
  border: 0.0625rem solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5em 0;
}

.prose pre code {
  background: transparent;
  padding: 0;
  font-size: 0.875rem;
}

/* Prose Images */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 1.5em 0;
  border: 0.0625rem solid var(--color-border);
}

/* Prose HR */
.prose hr {
  border: none;
  height: 0.0625rem;
  background: var(--color-border);
  margin: 2.5em 0;
}

/* --------------------------------------------------------------------------
   Mobile Navigation Overrides
   -------------------------------------------------------------------------- */
.mobile-nav {
  background: var(--color-surface);
  backdrop-filter: blur(1rem);
}

.burger-btn {
  background: var(--color-surface) !important;
  opacity: 1 !important;
}

/* --------------------------------------------------------------------------
   Step Badge Styling
   -------------------------------------------------------------------------- */
.step-badge {
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary-light) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Provider Cloud
   -------------------------------------------------------------------------- */
.provider-tag {
  background: var(--color-surface-elevated);
  border: 0.0625rem solid var(--color-border);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  transition: all 0.2s var(--transition-smooth);
}

.provider-tag:hover {
  border-color: var(--color-accent);
  color: var(--color-text-primary);
}

/* --------------------------------------------------------------------------
   FAQ Schema Styling
   -------------------------------------------------------------------------- */
.faq-item {
  border-bottom: 0.0625rem solid var(--color-border);
}

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

.faq-question {
  cursor: pointer;
  transition: color 0.2s var(--transition-smooth);
}

.faq-question:hover {
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Smooth Scroll
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

/* --------------------------------------------------------------------------
   Selection Styling
   -------------------------------------------------------------------------- */
::selection {
  background: var(--color-accent);
  color: white;
}

/* --------------------------------------------------------------------------
   Focus Styling for Accessibility
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 0.125rem solid var(--color-accent);
  outline-offset: 0.125rem;
}

/* --------------------------------------------------------------------------
   Scrollbar Styling
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 0.5rem;
  height: 0.5rem;
}

::-webkit-scrollbar-track {
  background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--color-surface-elevated);
  border-radius: 0.25rem;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}
