/* ================================================
   BINNARY PULSE FRANCE - Custom Styles
   ================================================ */

/* === CSS Variables === */
:root {
  --color-primary: #6366f1;
  --color-primary-dark: #4f46e5;
  --color-secondary: #22d3ee;
  --color-accent: #f59e0b;
  --color-dark: #0f172a;
  --color-darker: #020617;
  --color-light: #f8fafc;
  --color-muted: #94a3b8;
  --color-success: #10b981;
  --color-card-bg: rgba(30, 41, 59, 0.85);
  --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  --gradient-dark: linear-gradient(180deg, var(--color-darker) 0%, var(--color-dark) 100%);
}

/* === Base Resets === */
html {
  scroll-behavior: smooth;
  overflow-x: clip;
  overflow-y: auto;
}

body {
  overflow-x: clip;
}

/* === Keyframe Animations === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1rem); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 1.25rem rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 2.5rem rgba(99, 102, 241, 0.8); }
}

@keyframes particle-drift {
  0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) translateX(3.125rem) scale(0.5); opacity: 0; }
}

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

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes fade-in-up {
  0% { opacity: 0; transform: translateY(1.25rem); }
  100% { opacity: 1; transform: translateY(0); }
}

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

@keyframes bounce-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.5rem); }
}

/* === Animation Utility Classes === */
.animate-float {
  animation: float 4s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient-shift 6s ease infinite;
}

.animate-shimmer {
  position: relative;
  overflow: hidden;
}

.animate-shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: shimmer 2s infinite;
}

.animate-fade-in-up {
  animation: fade-in-up 0.6s ease-out forwards;
}

.animate-spin-slow {
  animation: spin-slow 20s linear infinite;
}

.animate-bounce-subtle {
  animation: bounce-subtle 2s ease-in-out infinite;
}

/* === Particle System === */
.particle-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 0.375rem;
  height: 0.375rem;
  background: var(--color-secondary);
  border-radius: 50%;
  animation: particle-drift 15s linear infinite;
  opacity: 0;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 14s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 11s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 16s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 13s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 15s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2s; animation-duration: 10s; }
.particle:nth-child(8) { left: 80%; animation-delay: 4s; animation-duration: 17s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1s; animation-duration: 12s; }
.particle:nth-child(10) { left: 15%; animation-delay: 6s; animation-duration: 14s; }

/* === Parallax Effects === */
.parallax-layer {
  will-change: transform;
  transition: transform 0.1s linear;
}

.parallax-slow {
  transform: translateY(calc(var(--scroll-y, 0) * 0.3));
}

.parallax-medium {
  transform: translateY(calc(var(--scroll-y, 0) * 0.5));
}

.parallax-fast {
  transform: translateY(calc(var(--scroll-y, 0) * 0.7));
}

/* === SVG Pattern Background === */
.pattern-grid {
  background-image: 
    linear-gradient(rgba(99, 102, 241, 0.03) 0.0625rem, transparent 0.0625rem),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 0.0625rem, transparent 0.0625rem);
  background-size: 3rem 3rem;
}

.pattern-dots {
  background-image: radial-gradient(rgba(99, 102, 241, 0.15) 0.0625rem, transparent 0.0625rem);
  background-size: 1.5rem 1.5rem;
}

.pattern-diagonal {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 0.625rem,
    rgba(99, 102, 241, 0.03) 0.625rem,
    rgba(99, 102, 241, 0.03) 1.25rem
  );
}

/* === Card Styles === */
.card-glow {
  position: relative;
  background: var(--color-card-bg);
  border: 0.0625rem solid rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(0.625rem);
  transition: all 0.3s ease;
}

.card-glow:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 1.875rem rgba(99, 102, 241, 0.2);
  transform: translateY(-0.25rem);
}

/* === Button Styles === */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  padding: 0.875rem 2rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-0.125rem);
  box-shadow: 0 0.625rem 2.5rem rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--color-light);
  font-weight: 600;
  padding: 0.875rem 2rem;
  border: 0.125rem solid var(--color-secondary);
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

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

/* === Navigation === */
.nav-sticky {
  backdrop-filter: blur(0.75rem);
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 0.0625rem solid rgba(99, 102, 241, 0.1);
}

.nav-link {
  position: relative;
  color: var(--color-light);
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -0.25rem;
  left: 0;
  width: 0;
  height: 0.125rem;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--color-secondary);
}

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

/* === Mobile Menu === */
.mobile-menu {
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(1.25rem);
}

/* === Hero Section === */
.hero-bg {
  position: relative;
  background: var(--gradient-dark);
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/images/hero.webp') center/cover no-repeat;
  opacity: 0.3;
}

/* === Bonus Badge === */
.bonus-badge {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.9) 0%, rgba(34, 211, 238, 0.9) 100%);
  border: 0.125rem solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(0.625rem);
}

/* === Game Cards === */
.game-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  transition: all 0.4s ease;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(15, 23, 42, 0.95) 100%);
  z-index: 1;
}

.game-card:hover {
  transform: scale(1.05);
}

.game-card:hover .game-card-content {
  transform: translateY(0);
  opacity: 1;
}

.game-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  z-index: 2;
  transform: translateY(0.625rem);
  opacity: 0.9;
  transition: all 0.3s ease;
}

/* === Step Cards === */
.step-number {
  width: 3.5rem;
  height: 3.5rem;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 0 1.875rem rgba(99, 102, 241, 0.5);
}

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

.table-responsive table {
  min-width: 37.5rem;
}

/* === Promo Cards === */
.promo-card {
  background: var(--color-card-bg);
  border: 0.0625rem solid rgba(99, 102, 241, 0.15);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.promo-card:hover {
  border-color: var(--color-secondary);
  transform: translateY(-0.5rem);
  box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, 0.3);
}

/* === FAQ Accordion === */
.faq-item {
  border: 0.0625rem solid rgba(99, 102, 241, 0.15);
  border-radius: 0.75rem;
  margin-bottom: 0.75rem;
  overflow: hidden;
  background: var(--color-card-bg);
}

.faq-question {
  padding: 1.25rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-light);
  font-weight: 600;
  transition: background 0.3s ease;
}

.faq-question:hover {
  background: rgba(99, 102, 241, 0.1);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  color: var(--color-muted);
}

.faq-item.active .faq-answer {
  max-height: 31.25rem;
  padding: 0 1.25rem 1.25rem;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-icon {
  transition: transform 0.3s ease;
}

/* === Provider Cloud === */
.provider-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.1);
  border: 0.0625rem solid rgba(99, 102, 241, 0.2);
  border-radius: 2rem;
  color: var(--color-light);
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.provider-tag:hover {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--color-secondary);
  transform: scale(1.05);
}

/* === Footer === */
.footer-gradient {
  background: linear-gradient(180deg, var(--color-dark) 0%, var(--color-darker) 100%);
  border-top: 0.0625rem solid rgba(99, 102, 241, 0.1);
}

/* === Age Badge === */
.age-badge {
  width: 3rem;
  height: 3rem;
  border: 0.1875rem solid #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ef4444;
  font-size: 0.875rem;
}

/* ================================================
   PROSE STYLING FOR MARKDOWN CONTENT
   ================================================ */

.prose {
  color: #cbd5e1;
  line-height: 1.75;
  max-width: 100%;
}

.prose h2 {
  color: #f8fafc;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-top: 2.5em;
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 0.125rem solid rgba(99, 102, 241, 0.3);
  position: relative;
}

.prose h2::before {
  content: '';
  position: absolute;
  bottom: -0.125rem;
  left: 0;
  width: 4rem;
  height: 0.125rem;
  background: var(--gradient-primary);
}

.prose h3 {
  color: #e2e8f0;
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.prose h4 {
  color: #e2e8f0;
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

.prose p {
  margin-bottom: 1.25em;
  font-size: clamp(1rem, 1.5vw, 1.0625rem);
}

.prose a {
  color: var(--color-secondary);
  text-decoration: underline;
  text-underline-offset: 0.1875rem;
  transition: color 0.3s ease;
}

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

.prose strong {
  color: #f8fafc;
  font-weight: 600;
}

.prose em {
  font-style: italic;
  color: #94a3b8;
}

/* === Prose Lists === */
.prose ul {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.5em;
}

.prose ul li {
  position: relative;
  padding-left: 1.75em;
  margin-bottom: 0.75em;
}

.prose ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.625em;
  width: 0.5em;
  height: 0.5em;
  background: var(--gradient-primary);
  border-radius: 50%;
}

.prose ol {
  list-style: none;
  padding-left: 0;
  margin-bottom: 1.5em;
  counter-reset: prose-counter;
}

.prose ol li {
  position: relative;
  padding-left: 2.5em;
  margin-bottom: 0.75em;
  counter-increment: prose-counter;
}

.prose ol li::before {
  content: counter(prose-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75em;
  height: 1.75em;
  background: rgba(99, 102, 241, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875em;
  color: var(--color-secondary);
}

/* === Prose Tables === */
.prose .table-responsive {
  margin: 1.5em 0;
  border-radius: 0.75rem;
  overflow-x: auto;
  background: rgba(30, 41, 59, 0.6);
  border: 0.0625rem solid rgba(99, 102, 241, 0.15);
}

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

.prose thead {
  background: rgba(99, 102, 241, 0.15);
}

.prose th {
  color: #f8fafc;
  font-weight: 600;
  text-align: left;
  padding: 1rem 1.25rem;
  white-space: nowrap;
}

.prose td {
  padding: 0.875rem 1.25rem;
  border-top: 0.0625rem solid rgba(99, 102, 241, 0.1);
  color: #cbd5e1;
}

.prose tbody tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

/* === Prose Blockquotes === */
.prose blockquote {
  margin: 1.5em 0;
  padding: 1.25em 1.5em;
  background: rgba(99, 102, 241, 0.08);
  border-left: 0.25rem solid var(--color-primary);
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
  color: #94a3b8;
}

.prose blockquote p {
  margin-bottom: 0;
}

.prose blockquote strong {
  color: #e2e8f0;
}

/* === Prose Code === */
.prose code {
  background: rgba(99, 102, 241, 0.15);
  padding: 0.1875em 0.375em;
  border-radius: 0.25rem;
  font-size: 0.875em;
  color: var(--color-secondary);
}

.prose pre {
  background: rgba(15, 23, 42, 0.8);
  padding: 1.25rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  margin: 1.5em 0;
  border: 0.0625rem solid rgba(99, 102, 241, 0.15);
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: #e2e8f0;
}

/* === Prose Images === */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 1rem;
  margin: 2em auto;
  display: block;
  box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, 0.3);
}

/* === Prose HR === */
.prose hr {
  border: none;
  height: 0.0625rem;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
  margin: 2.5em 0;
}

/* === Scroll Progress === */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 0.1875rem;
  background: var(--gradient-primary);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}

/* === Responsive Adjustments === */
@media (max-width: 64rem) {
  .prose h2 {
    margin-top: 2em;
  }
  
  .prose table {
    font-size: 0.875rem;
  }
  
  .prose th,
  .prose td {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 40rem) {
  .prose {
    font-size: 0.9375rem;
  }
  
  .prose blockquote {
    padding: 1em 1.25em;
    margin-left: 0;
    margin-right: 0;
  }
  
  .prose ul li,
  .prose ol li {
    padding-left: 1.5em;
  }
}
