/* Custom animations and styling for Ragnaro Casino */

/* Parallax animation */
@keyframes parallax-float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-10px) translateX(5px);
  }
  50% {
    transform: translateY(-5px) translateX(-5px);
  }
  75% {
    transform: translateY(-15px) translateX(3px);
  }
}

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

.parallax-float-delayed {
  animation: parallax-float 8s ease-in-out infinite;
  animation-delay: 2s;
}

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

.marquee {
  display: flex;
  overflow: hidden;
  user-select: none;
  gap: 2rem;
  width: 100%;
  max-width: 100%;
}

.marquee-content {
  flex-shrink: 0;
  display: flex;
  gap: 2rem;
  min-width: 100%;
  animation: marquee 30s linear infinite;
  will-change: transform;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

/* Body overflow fix */
body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Prose styling for readability */
.prose {
  line-height: 1.6;
  color: #e5e7eb;
}

.prose h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #fff;
}

.prose h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #fff;
}

.prose p {
  margin-bottom: 1rem;
}

.prose ul,
.prose ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.prose th,
.prose td {
  padding: 0.75rem;
  border: 1px solid #374151;
  text-align: left;
}

.prose th {
  background-color: #1f2937;
  font-weight: 600;
}

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

/* Nordic snow effect */
.snow-bg {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  position: relative;
}

.snow-bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(2px 2px at 60% 70%, white, transparent), radial-gradient(1px 1px at 50% 50%, white, transparent),
    radial-gradient(1px 1px at 80% 10%, white, transparent), radial-gradient(2px 2px at 90% 60%, white, transparent);
  background-size: 200px 200px, 300px 300px, 250px 250px, 350px 350px, 280px 280px;
  opacity: 0.3;
  pointer-events: none;
}

/* Viking accent colors */
.viking-gold {
  color: #fbbf24;
}

.viking-gold-bg {
  background-color: #fbbf24;
}

.viking-blue {
  color: #3b82f6;
}

.viking-blue-bg {
  background-color: #1e40af;
}

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

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 25px -5px rgba(251, 191, 36, 0.3);
}

/* CTA button glow */
.cta-glow {
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
  transition: all 0.3s ease;
}

.cta-glow:hover {
  box-shadow: 0 0 30px rgba(251, 191, 36, 0.8);
  transform: scale(1.05);
}

/* Mobile bottom menu island */
.bottom-menu-island {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

/* Trustpilot star */
.star-gold {
  color: #00b67a;
}

/* Sidebar transition */
.sidebar-transition {
  transition: transform 0.3s ease-in-out;
}

/* Sidebar sticky behavior fixes */
#sidebar {
  /* Ensure proper sticky positioning on desktop */
  position: sticky;
  top: 4rem; /* 64px header height */
  height: calc(100vh - 4rem);
  overflow-y: auto;
  overflow-x: hidden;
  /* Custom scrollbar for better appearance */
  scrollbar-width: thin;
  scrollbar-color: #fbbf24 #1e40af;
}

#sidebar::-webkit-scrollbar {
  width: 6px;
}

#sidebar::-webkit-scrollbar-track {
  background: #1e40af;
}

#sidebar::-webkit-scrollbar-thumb {
  background: #fbbf24;
  border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
  background: #f59e0b;
}

/* Sidebar navigation improvements */
#sidebar nav {
  padding: 1rem;
}

#sidebar nav a {
  display: block;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sidebar nav a:hover {
  background-color: #1e40af;
}

#sidebar nav a i {
  margin-right: 0.75rem;
  width: 1.25rem;
  text-align: center;
}

/* Bonus calculator island */
.calculator-island {
  background: linear-gradient(135deg, #1e40af 0%, #3730a3 100%);
  border: 2px solid #fbbf24;
  box-shadow: 0 10px 40px rgba(251, 191, 36, 0.2);
}

/* Responsive utilities */
@media (max-width: 1023px) {
  #sidebar {
    position: fixed;
    top: 4rem;
    left: 0;
    height: calc(100vh - 4rem);
    width: 16rem;
    z-index: 40;
    /* Ensure full height and proper scrolling on mobile */
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    overflow-x: hidden;
  }
  
  .sidebar-open {
    transform: translateX(0);
  }

  .sidebar-closed {
    transform: translateX(-100%);
  }
}

/* Desktop sticky sidebar */
@media (min-width: 1024px) {
  #sidebar {
    position: sticky;
    top: 4rem;
    height: calc(100vh - 4rem);
    transform: translateX(0) !important;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    overflow-x: hidden;
  }
}

/* Number badge */
.number-badge {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 4px 10px rgba(251, 191, 36, 0.4);
}

/* Warning banner */
.warning-banner {
  background: linear-gradient(90deg, #dc2626 0%, #991b1b 100%);
  border-left: 4px solid #fbbf24;
}

/* Horizontal scroll fixes */
* {
  box-sizing: border-box;
}

/* Container and main area fixes */
.container {
  max-width: 100%;
  overflow-x: hidden;
}

main {
  max-width: 100%;
  overflow-x: hidden;
  min-width: 0;
}

/* Section overflow fixes */
section {
  max-width: 100%;
  overflow-x: hidden;
}

/* Grid and flex container fixes */
.grid {
  max-width: 100%;
  overflow: hidden;
}

.flex {
  max-width: 100%;
  overflow: hidden;
}

/* Image and content responsive fixes */
img {
  max-width: 100%;
  height: auto;
}

/* Mobile specific fixes */
@media (max-width: 767px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 100vw;
  }
  
  /* Ensure no element causes horizontal scroll on mobile */
  * {
    max-width: 100vw;
    box-sizing: border-box;
  }
  
  /* Fix for wide tables or content */
  .prose table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    max-width: 100%;
  }
  
  /* Fix for buttons and CTAs */
  .cta-glow {
    word-wrap: break-word;
    white-space: nowrap;
    max-width: 100%;
  }
  
  /* Fix for hero section and grid layouts */
  .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Fix for marquee on mobile */
  .marquee-content {
    min-width: 200%;
  }
  
  /* Fix for text overflow */
  h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  
  /* Fix for sidebar on mobile */
  #sidebar {
    max-width: 16rem;
    width: 16rem;
    /* Ensure sidebar content is not cut off */
    min-height: calc(100vh - 4rem);
    /* Add padding bottom to account for mobile navigation */
    padding-bottom: 5rem;
  }
  
  /* Adjust sidebar navigation for mobile */
  #sidebar nav {
    padding-bottom: 2rem;
  }
}

/* Desktop sidebar layout fixes */
@media (min-width: 1024px) {
  main {
    margin-left: 0;
    flex: 1;
    min-width: 0;
    max-width: calc(100vw - 16rem);
    /* Ensure main content doesn't overlap sidebar */
  }
  
  /* Ensure proper layout with sticky sidebar */
  .flex.min-h-screen {
    align-items: flex-start;
  }
}
