/* =============================================
   MafiaCasino - Noir Prestige Lounge Flow
   Custom CSS: Animations, Overrides, Prose
   ============================================= */

/* ----- CSS Variables ----- */
:root {
  --color-bg-dark: #0d0d0f;
  --color-bg-card: #1a1a1f;
  --color-bg-elevated: #242429;
  --color-accent-gold: #c9a962;
  --color-accent-gold-light: #e0c98a;
  --color-accent-crimson: #8b2942;
  --color-text-primary: #f5f5f5;
  --color-text-secondary: #a8a8b0;
  --color-text-muted: #6b6b75;
  --color-border: #2d2d35;
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- Keyframe Animations ----- */
@keyframes tilt {
  0%,
  100% {
    transform: rotate(-1deg);
  }
  50% {
    transform: rotate(1deg);
  }
}

@keyframes particle-float {
  0%,
  100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.6;
  }
  25% {
    transform: translateY(-1.5em) translateX(0.5em) scale(1.1);
    opacity: 0.8;
  }
  50% {
    transform: translateY(-2.5em) translateX(-0.5em) scale(0.9);
    opacity: 0.5;
  }
  75% {
    transform: translateY(-1em) translateX(0.75em) scale(1.05);
    opacity: 0.7;
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 1.25em rgba(201, 169, 98, 0.3);
  }
  50% {
    box-shadow: 0 0 2em rgba(201, 169, 98, 0.5);
  }
}

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

/* ----- Animation Utility Classes ----- */
.animate-tilt {
  animation: tilt 6s ease-in-out infinite;
}

.animate-particle {
  animation: particle-float 8s ease-in-out infinite;
}

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

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(201, 169, 98, 0.15), transparent);
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}

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

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

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

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

.particle:nth-child(1) {
  left: 10%;
  top: 20%;
  animation-delay: 0s;
}
.particle:nth-child(2) {
  left: 20%;
  top: 60%;
  animation-delay: 1s;
}
.particle:nth-child(3) {
  left: 35%;
  top: 30%;
  animation-delay: 2s;
}
.particle:nth-child(4) {
  left: 50%;
  top: 70%;
  animation-delay: 0.5s;
}
.particle:nth-child(5) {
  left: 65%;
  top: 25%;
  animation-delay: 1.5s;
}
.particle:nth-child(6) {
  left: 80%;
  top: 55%;
  animation-delay: 2.5s;
}
.particle:nth-child(7) {
  left: 90%;
  top: 40%;
  animation-delay: 3s;
}

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

/* ----- Global Overflow Control ----- */
html,
body {
  overflow-x: clip;
  overflow-y: auto;
}

/* ----- Button Styles ----- */
.btn-primary {
  background: linear-gradient(135deg, var(--color-accent-gold) 0%, var(--color-accent-gold-light) 100%);
  color: var(--color-bg-dark);
  font-weight: 600;
  padding: 0.875em 2em;
  border-radius: 0.5em;
  transition: all 0.3s var(--transition-smooth);
  box-shadow: 0 0.25em 1em rgba(201, 169, 98, 0.3);
}

.btn-primary:hover {
  transform: translateY(-0.125em);
  box-shadow: 0 0.5em 1.5em rgba(201, 169, 98, 0.4);
}

.btn-secondary {
  background: transparent;
  border: 0.125em solid var(--color-accent-gold);
  color: var(--color-accent-gold);
  font-weight: 600;
  padding: 0.75em 1.75em;
  border-radius: 0.5em;
  transition: all 0.3s var(--transition-smooth);
}

.btn-secondary:hover {
  background: rgba(201, 169, 98, 0.1);
  transform: translateY(-0.125em);
}

/* ----- Card Styles ----- */
.card-noir {
  background: var(--color-bg-card);
  border: 0.0625em solid var(--color-border);
  border-radius: 0.75em;
  transition: all 0.4s var(--transition-smooth);
}

.card-noir:hover {
  border-color: var(--color-accent-gold);
  transform: translateY(-0.25em);
  box-shadow: 0 0.75em 2em rgba(0, 0, 0, 0.4);
}

/* ----- Table Responsive Wrapper ----- */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5em 0;
}

.table-responsive table {
  min-width: 100%;
  border-collapse: collapse;
}

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

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

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

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

/* ----- Mobile Menu ----- */
.burger-menu {
  background: var(--color-bg-card);
  border: 0.0625em solid var(--color-border);
  padding: 0.5em;
  border-radius: 0.5em;
}

.mobile-nav {
  position: fixed;
  top: 4em;
  left: 0;
  right: 0;
  background: var(--color-bg-dark);
  border-bottom: 0.0625em solid var(--color-border);
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.4s var(--transition-smooth);
  z-index: 40;
}

.mobile-nav.active {
  transform: translateY(0);
  opacity: 1;
}

/* ----- Hero Section ----- */
.hero-bg {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 13, 15, 0.7) 0%, rgba(13, 13, 15, 0.85) 50%, rgba(13, 13, 15, 0.95) 100%);
}

/* ----- Bonus Badge ----- */
.bonus-badge {
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-card) 100%);
  border: 0.125em solid var(--color-accent-gold);
  border-radius: 1em;
  position: relative;
  overflow: hidden;
}

.bonus-badge::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 30%, rgba(201, 169, 98, 0.05) 50%, transparent 70%);
  animation: shimmer 4s infinite;
}

/* ----- Game Cards ----- */
.game-card {
  background: var(--color-bg-card);
  border-radius: 0.75em;
  overflow: hidden;
  transition: all 0.4s var(--transition-smooth);
}

.game-card:hover {
  transform: scale(1.03);
  box-shadow: 0 0.5em 1.5em rgba(201, 169, 98, 0.2);
}

.game-card img {
  transition: transform 0.5s var(--transition-smooth);
}

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

/* ----- Step Badges ----- */
.step-badge {
  width: 3em;
  height: 3em;
  background: linear-gradient(135deg, var(--color-accent-gold) 0%, var(--color-accent-gold-light) 100%);
  color: var(--color-bg-dark);
  font-weight: 700;
  font-size: 1.25em;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0.25em 1em rgba(201, 169, 98, 0.4);
}

/* ----- Provider Cloud ----- */
.provider-tag {
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  padding: 0.5em 1em;
  border-radius: 2em;
  font-size: 0.875em;
  border: 0.0625em solid var(--color-border);
  transition: all 0.3s var(--transition-smooth);
}

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

/* ----- Promo Cards ----- */
.promo-card {
  background: linear-gradient(145deg, var(--color-bg-card) 0%, var(--color-bg-elevated) 100%);
  border: 0.0625em solid var(--color-border);
  border-radius: 0.75em;
  padding: 1.5em;
  transition: all 0.4s var(--transition-smooth);
}

.promo-card:hover {
  border-color: var(--color-accent-gold);
  transform: translateY(-0.375em);
}

/* ----- FAQ Accordion ----- */
.faq-item {
  background: var(--color-bg-card);
  border: 0.0625em solid var(--color-border);
  border-radius: 0.5em;
  overflow: hidden;
  transition: all 0.3s var(--transition-smooth);
}

.faq-item:hover {
  border-color: rgba(201, 169, 98, 0.5);
}

.faq-question {
  cursor: pointer;
  padding: 1.25em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-text-primary);
  transition: background 0.3s var(--transition-smooth);
}

.faq-question:hover {
  background: rgba(201, 169, 98, 0.05);
}

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

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

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

.faq-icon {
  transition: transform 0.3s var(--transition-smooth);
}

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

.prose {
  color: var(--color-text-primary);
  line-height: 1.75;
  max-width: 100%;
}

/* ----- Prose Headings ----- */
.prose h2 {
  color: var(--color-accent-gold);
  font-size: clamp(1.5em, 4vw, 2em);
  font-weight: 700;
  margin-top: 2.5em;
  margin-bottom: 1em;
  padding-bottom: 0.5em;
  border-bottom: 0.125em solid var(--color-border);
  position: relative;
}

.prose h2::before {
  content: "";
  position: absolute;
  bottom: -0.125em;
  left: 0;
  width: 4em;
  height: 0.125em;
  background: var(--color-accent-gold);
}

.prose h3 {
  color: var(--color-text-primary);
  font-size: clamp(1.25em, 3vw, 1.5em);
  font-weight: 600;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

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

/* ----- Prose Paragraphs ----- */
.prose p {
  color: var(--color-text-secondary);
  margin-bottom: 1.5em;
  font-size: clamp(0.9375em, 2.5vw, 1.0625em);
}

.prose p:first-of-type {
  font-size: clamp(1em, 2.75vw, 1.125em);
  color: var(--color-text-primary);
}

/* ----- Prose Links ----- */
.prose a {
  color: var(--color-accent-gold);
  text-decoration: underline;
  text-underline-offset: 0.25em;
  transition: color 0.3s var(--transition-smooth);
}

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

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

.prose ul {
  list-style: none;
}

.prose ul li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.75em;
  color: var(--color-text-secondary);
}

.prose ul li::before {
  content: "◆";
  position: absolute;
  left: 0;
  color: var(--color-accent-gold);
  font-size: 0.625em;
  top: 0.5em;
}

.prose ol {
  list-style: none;
  counter-reset: prose-counter;
}

.prose ol li {
  position: relative;
  padding-left: 2em;
  margin-bottom: 0.75em;
  color: var(--color-text-secondary);
  counter-increment: prose-counter;
}

.prose ol li::before {
  content: counter(prose-counter) ".";
  position: absolute;
  left: 0;
  color: var(--color-accent-gold);
  font-weight: 600;
}

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

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

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

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

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

.prose tbody tr {
  transition: background 0.3s var(--transition-smooth);
}

.prose tbody tr:hover {
  background: rgba(201, 169, 98, 0.05);
}

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

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

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

.prose blockquote p::before {
  content: '"';
  color: var(--color-accent-gold);
  font-size: 1.5em;
  margin-right: 0.25em;
}

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

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

.prose em {
  color: var(--color-accent-gold-light);
  font-style: italic;
}

/* ----- Prose Code ----- */
.prose code {
  background: var(--color-bg-elevated);
  color: var(--color-accent-gold);
  padding: 0.125em 0.375em;
  border-radius: 0.25em;
  font-size: 0.875em;
}

.prose pre {
  background: var(--color-bg-card);
  border: 0.0625em solid var(--color-border);
  border-radius: 0.5em;
  padding: 1.5em;
  overflow-x: auto;
  margin: 2em 0;
}

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

/* ----- Prose Horizontal Rule ----- */
.prose hr {
  border: none;
  height: 0.0625em;
  background: linear-gradient(90deg, transparent, var(--color-accent-gold), transparent);
  margin: 3em 0;
}

/* ----- 18+ Badge ----- */
.badge-18 {
  width: 2.5em;
  height: 2.5em;
  border: 0.125em solid var(--color-accent-crimson);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75em;
  color: var(--color-accent-crimson);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-gold);
}

/* ----- Selection Styling ----- */
::selection {
  background: rgba(201, 169, 98, 0.3);
  color: var(--color-text-primary);
}

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

/* ----- SVG Pattern Background ----- */
.pattern-bg {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a962' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
