/* ============================================
   Bookyspin Custom CSS
   Animation keyframes, overrides & prose styling
   ============================================ */

/* CSS Variables for Theme */
:root {
  --color-primary: #6366f1;
  --color-primary-dark: #4f46e5;
  --color-secondary: #f59e0b;
  --color-secondary-dark: #d97706;
  --color-bg-light: #fefce8;
  --color-bg-warm: #fffbeb;
  --color-bg-section: #f0fdf4;
  --color-bg-alt: #ecfeff;
  --color-text-dark: #1e293b;
  --color-text-muted: #475569;
  --color-text-light: #f8fafc;
  --color-border: #e2e8f0;
  --color-card-bg: #ffffff;
  --color-accent: #10b981;
}

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

/* ============================================
   ANIMATIONS
   ============================================ */

/* Tilt Animation */
@keyframes tilt {
  0%, 100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

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

.hover-tilt:hover {
  animation: tilt 0.5s ease-in-out;
}

/* Marquee Animation */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.animate-marquee {
  animation: marquee 25s linear infinite;
}

.animate-marquee:hover {
  animation-play-state: paused;
}

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

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

/* Pulse Glow */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0.3125rem rgba(99, 102, 241, 0.4);
  }
  50% {
    box-shadow: 0 0 1.25rem rgba(99, 102, 241, 0.8);
  }
}

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

/* Float Animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.625rem);
  }
}

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

/* ============================================
   LAYOUT OVERRIDES
   ============================================ */

/* Mobile Menu Background */
.mobile-menu {
  background-color: #1e293b !important;
  backdrop-filter: none;
}

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

.table-responsive table {
  min-width: 100%;
  white-space: nowrap;
}

/* Bonus Badge */
.bonus-badge {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  position: relative;
  overflow: hidden;
}

.bonus-badge::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}

/* Game Cards */
.game-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
  transform: translateY(-0.3125rem);
  box-shadow: 0 0.625rem 2.5rem rgba(99, 102, 241, 0.2);
}

/* Step Badges */
.step-badge {
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-text-dark);
  font-size: 1.25rem;
}

/* Provider Cloud */
.provider-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--color-bg-light);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--color-text-dark);
  margin: 0.25rem;
  transition: background-color 0.2s ease;
}

.provider-tag:hover {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}

/* FAQ Accordion */
.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  cursor: pointer;
  transition: color 0.2s ease;
}

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

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

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

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

.prose {
  color: var(--color-text-dark);
  max-width: 100%;
  line-height: 1.75;
  font-size: 1rem;
}

.prose > * + * {
  margin-top: 1.5em;
}

/* Headings */
.prose h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-top: 2.5em;
  margin-bottom: 1em;
  line-height: 1.3;
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.5em;
}

.prose h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text-dark);
  margin-top: 2em;
  margin-bottom: 0.75em;
  line-height: 1.4;
}

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

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

/* Links */
.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 0.125em;
  transition: color 0.2s ease;
}

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

/* Lists */
.prose ul {
  list-style-type: disc;
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

.prose ol {
  list-style-type: decimal;
  padding-left: 1.5em;
  margin-bottom: 1.25em;
}

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

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

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

/* Tables */
.prose .table-responsive {
  overflow-x: auto;
  margin: 1.5em 0;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
}

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

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

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

.prose tbody tr {
  border-bottom: 1px solid var(--color-border);
  background-color: var(--color-card-bg);
}

.prose tbody tr:nth-child(even) {
  background-color: var(--color-bg-light);
}

.prose tbody tr:hover {
  background-color: var(--color-bg-warm);
}

.prose td {
  padding: 0.75rem 1rem;
  color: var(--color-text-muted);
}

/* Blockquotes */
.prose blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 1em 1.5em;
  margin: 1.5em 0;
  background-color: var(--color-bg-light);
  border-radius: 0 0.5rem 0.5rem 0;
  font-style: italic;
}

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

/* Code */
.prose code {
  background-color: var(--color-bg-alt);
  padding: 0.125em 0.375em;
  border-radius: 0.25rem;
  font-size: 0.875em;
  color: var(--color-primary-dark);
}

.prose pre {
  background-color: var(--color-text-dark);
  color: var(--color-text-light);
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5em 0;
}

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

/* Images */
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 1.5em 0;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.1);
}

/* Horizontal Rule */
.prose hr {
  border: none;
  border-top: 2px solid var(--color-border);
  margin: 2.5em 0;
}

/* Strong and Emphasis */
.prose strong {
  font-weight: 700;
  color: var(--color-text-dark);
}

.prose em {
  font-style: italic;
}

/* Definition Lists */
.prose dl {
  margin: 1.5em 0;
}

.prose dt {
  font-weight: 600;
  color: var(--color-text-dark);
  margin-top: 1em;
}

.prose dd {
  margin-left: 1.5em;
  color: var(--color-text-muted);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 48rem) {
  .prose {
    font-size: 0.9375rem;
  }
  
  .prose h2 {
    font-size: 1.5rem;
  }
  
  .prose h3 {
    font-size: 1.25rem;
  }
  
  .prose h4 {
    font-size: 1.125rem;
  }
  
  .step-badge {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-balance {
  text-wrap: balance;
}

.bg-pattern {
  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='%236366f1' fill-opacity='0.05'%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");
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
