/**
 * FunBingo CFD - Main Stylesheet
 * Mobile-first responsive design with unique visual identity
 */

/* CSS Variables for consistent theming */
:root {
  --g46b-primary: #7FFF00;      /* Chartreuse - vibrant green */
  --g46b-secondary: #FFFACD;    /* Lemon chiffon - light yellow */
  --g46b-accent: #CD853F;       /* Peru - warm brown */
  --g46b-light: #FFF8DC;        /* Cornsilk - cream */
  --g46b-dark: #212F3D;         /* Dark blue-gray - primary background */
  --g46b-text: #2C3E50;         /* Dark blue-gray for text */
  --g46b-text-light: #7F8C8D;   /* Light gray for secondary text */
  --g46b-success: #27AE60;      /* Green for success states */
  --g46b-warning: #F39C12;      /* Orange for warnings */
  --g46b-error: #E74C3C;        /* Red for errors */
  --g46b-white: #FFFFFF;
  --g46b-black: #000000;

  /* Spacing system */
  --g46b-space-xs: 0.5rem;
  --g46b-space-sm: 1rem;
  --g46b-space-md: 1.5rem;
  --g46b-space-lg: 2rem;
  --g46b-space-xl: 3rem;

  /* Border radius */
  --g46b-radius-sm: 0.25rem;
  --g46b-radius-md: 0.5rem;
  --g46b-radius-lg: 1rem;
  --g46b-radius-full: 50%;

  /* Shadows */
  --g46b-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --g46b-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --g46b-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --g46b-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --g46b-transition-fast: all 0.15s ease;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%; /* 1rem = 10px */
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 1.6rem;
  line-height: 1.5;
  color: var(--g46b-text);
  background: linear-gradient(135deg, var(--g46b-dark) 0%, #34495E 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
.g46b-h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--g46b-primary);
  margin-bottom: var(--g46b-space-md);
  text-align: center;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.g46b-h2 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--g46b-secondary);
  margin-bottom: var(--g46b-space-sm);
}

.g46b-h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--g46b-light);
  margin-bottom: var(--g46b-space-xs);
}

.g46b-text {
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--g46b-text);
  margin-bottom: var(--g46b-space-sm);
}

.g46b-text-small {
  font-size: 1.4rem;
  color: var(--g46b-text-light);
}

/* Layout components */
.g46b-container {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 var(--g46b-space-sm);
  position: relative;
}

.g46b-wrapper {
  background: var(--g46b-white);
  border-radius: var(--g46b-radius-lg);
  box-shadow: var(--g46b-shadow-lg);
  overflow: hidden;
  margin-bottom: var(--g46b-space-lg);
}

.g46b-grid {
  display: grid;
  gap: var(--g46b-space-sm);
}

.g46b-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.g46b-flex-col {
  display: flex;
  flex-direction: column;
}

/* Header and Navigation */
.g46b-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(90deg, var(--g46b-dark) 0%, #2C3E50 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(127, 255, 0, 0.2);
  padding: var(--g46b-space-sm) 0;
}

.g46b-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 var(--g46b-space-sm);
}

.g46b-logo {
  display: flex;
  align-items: center;
  gap: var(--g46b-space-xs);
  font-size: 2rem;
  font-weight: 700;
  color: var(--g46b-primary);
  text-decoration: none;
}

.g46b-logo-icon {
  width: 28px;
  height: 28px;
  background: var(--g46b-primary);
  border-radius: var(--g46b-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--g46b-dark);
}

.g46b-header-actions {
  display: flex;
  gap: var(--g46b-space-xs);
}

.g46b-btn {
  padding: var(--g46b-space-xs) var(--g46b-space-sm);
  border: none;
  border-radius: var(--g46b-radius-md);
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--g46b-transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px; /* Touch-friendly size */
  min-width: 44px;
}

.g46b-btn-primary {
  background: linear-gradient(135deg, var(--g46b-primary) 0%, #9AE65A 100%);
  color: var(--g46b-dark);
  box-shadow: var(--g46b-shadow-sm);
}

.g46b-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--g46b-shadow-md);
}

.g46b-btn-secondary {
  background: transparent;
  color: var(--g46b-secondary);
  border: 2px solid var(--g46b-secondary);
}

.g46b-btn-secondary:hover {
  background: var(--g46b-secondary);
  color: var(--g46b-dark);
}

.g46b-menu-toggle {
  background: none;
  border: none;
  color: var(--g46b-primary);
  font-size: 2.4rem;
  cursor: pointer;
  padding: var(--g46b-space-xs);
  border-radius: var(--g46b-radius-sm);
  transition: var(--g46b-transition);
}

.g46b-menu-toggle:hover {
  background: rgba(127, 255, 0, 0.1);
}

/* Mobile Menu */
.g46b-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: var(--g46b-dark);
  z-index: 9999;
  transform: translateX(100%);
  transition: var(--g46b-transition);
  padding: var(--g46b-space-lg) var(--g46b-space-md);
  overflow-y: auto;
}

.g46b-mobile-menu.active {
  transform: translateX(0);
}

.g46b-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: var(--g46b-transition);
}

.g46b-menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.g46b-nav-list {
  list-style: none;
  margin-top: var(--g46b-space-lg);
}

.g46b-nav-item {
  margin-bottom: var(--g46b-space-sm);
}

.g46b-nav-link {
  display: block;
  padding: var(--g46b-space-sm);
  color: var(--g46b-light);
  text-decoration: none;
  border-radius: var(--g46b-radius-md);
  transition: var(--g46b-transition);
  font-weight: 500;
}

.g46b-nav-link:hover {
  background: rgba(127, 255, 0, 0.1);
  color: var(--g46b-primary);
}

/* Main Content */
.g46b-main {
  padding-top: 80px; /* Account for fixed header */
  padding-bottom: 80px; /* Account for fixed bottom nav */
  min-height: 100vh;
}

/* Carousel */
.g46b-carousel {
  position: relative;
  height: 200px;
  border-radius: var(--g46b-radius-lg);
  overflow: hidden;
  margin-bottom: var(--g46b-space-lg);
  box-shadow: var(--g46b-shadow-md);
}

.g46b-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: var(--g46b-transition);
  cursor: pointer;
}

.g46b-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g46b-carousel-indicators {
  position: absolute;
  bottom: var(--g46b-space-sm);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--g46b-space-xs);
}

.g46b-carousel-indicator {
  width: 8px;
  height: 8px;
  border-radius: var(--g46b-radius-full);
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--g46b-transition-fast);
}

.g46b-carousel-indicator.g46b-active {
  background: var(--g46b-primary);
  width: 24px;
  border-radius: 4px;
}

/* Game Grid */
.g46b-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--g46b-space-sm);
  margin-bottom: var(--g46b-space-lg);
}

.g46b-game-card {
  background: var(--g46b-white);
  border-radius: var(--g46b-radius-md);
  padding: var(--g46b-space-xs);
  text-align: center;
  transition: var(--g46b-transition);
  cursor: pointer;
  box-shadow: var(--g46b-shadow-sm);
  border: 1px solid rgba(127, 255, 0, 0.1);
}

.g46b-game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--g46b-shadow-lg);
  border-color: var(--g46b-primary);
}

.g46b-game-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--g46b-space-xs);
  border-radius: var(--g46b-radius-md);
  overflow: hidden;
}

.g46b-game-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g46b-game-name {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--g46b-text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 3.2rem;
}

/* Content Sections */
.g46b-section {
  background: var(--g46b-white);
  border-radius: var(--g46b-radius-lg);
  padding: var(--g46b-space-md);
  margin-bottom: var(--g46b-space-lg);
  box-shadow: var(--g46b-shadow-sm);
}

.g46b-section-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--g46b-primary);
  margin-bottom: var(--g46b-space-md);
  text-align: center;
  position: relative;
}

.g46b-section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--g46b-primary) 0%, var(--g46b-accent) 100%);
  border-radius: 2px;
}

/* Promotional Links */
.g46b-promo-link {
  color: var(--g46b-primary);
  font-weight: 600;
  text-decoration: none;
  transition: var(--g46b-transition);
  cursor: pointer;
}

.g46b-promo-link:hover {
  color: var(--g46b-accent);
  text-decoration: underline;
}

.g46b-promo-btn {
  background: linear-gradient(135deg, var(--g46b-primary) 0%, #9AE65A 100%);
  color: var(--g46b-dark);
  padding: var(--g46b-space-sm) var(--g46b-space-md);
  border: none;
  border-radius: var(--g46b-radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--g46b-transition);
  display: inline-block;
  text-decoration: none;
  text-align: center;
  box-shadow: var(--g46b-shadow-sm);
}

.g46b-promo-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--g46b-shadow-md);
}

/* Footer */
.g46b-footer {
  background: var(--g46b-dark);
  color: var(--g46b-light);
  padding: var(--g46b-space-lg) 0 var(--g46b-space-xl);
  margin-top: var(--g46b-space-xl);
  border-top: 1px solid rgba(127, 255, 0, 0.2);
}

.g46b-footer-content {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 var(--g46b-space-sm);
}

.g46b-footer-section {
  margin-bottom: var(--g46b-space-lg);
}

.g46b-footer-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--g46b-primary);
  margin-bottom: var(--g46b-space-sm);
}

.g46b-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--g46b-space-sm);
  margin-bottom: var(--g46b-space-md);
}

.g46b-footer-link {
  color: var(--g46b-light);
  text-decoration: none;
  font-size: 1.4rem;
  transition: var(--g46b-transition);
}

.g46b-footer-link:hover {
  color: var(--g46b-primary);
}

.g46b-partners {
  display: flex;
  flex-wrap: wrap;
  gap: var(--g46b-space-sm);
  justify-content: center;
  margin-bottom: var(--g46b-space-md);
}

.g46b-partner-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--g46b-radius-sm);
  overflow: hidden;
  opacity: 0.7;
  transition: var(--g46b-transition);
}

.g46b-partner-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

.g46b-partner-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.g46b-copyright {
  text-align: center;
  font-size: 1.2rem;
  color: var(--g46b-text-light);
  border-top: 1px solid rgba(127, 255, 0, 0.1);
  padding-top: var(--g46b-space-md);
}

/* Bottom Navigation */
.g46b-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, var(--g46b-dark) 0%, #2C3E50 100%);
  border-top: 1px solid rgba(127, 255, 0, 0.2);
  z-index: 1000;
  padding: var(--g46b-space-xs) 0;
  backdrop-filter: blur(10px);
}

.g46b-bottom-nav-content {
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 var(--g46b-space-sm);
}

.g46b-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--g46b-text-light);
  transition: var(--g46b-transition);
  cursor: pointer;
  padding: var(--g46b-space-xs);
  border-radius: var(--g46b-radius-md);
  min-width: 60px;
  min-height: 60px;
  justify-content: center;
}

.g46b-bottom-nav-item:hover {
  color: var(--g46b-primary);
  background: rgba(127, 255, 0, 0.1);
}

.g46b-bottom-nav-item.g46b-active {
  color: var(--g46b-primary);
  background: rgba(127, 255, 0, 0.2);
}

.g46b-bottom-nav-icon {
  font-size: 2.4rem;
  margin-bottom: 0.2rem;
  transition: var(--g46b-transition);
}

.g46b-bottom-nav-item:hover .g46b-bottom-nav-icon {
  transform: scale(1.1);
}

.g46b-bottom-nav-text {
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

/* Utility Classes */
.g46b-text-center { text-align: center; }
.g46b-text-left { text-align: left; }
.g46b-text-right { text-align: right; }

.g46b-mb-xs { margin-bottom: var(--g46b-space-xs); }
.g46b-mb-sm { margin-bottom: var(--g46b-space-sm); }
.g46b-mb-md { margin-bottom: var(--g46b-space-md); }
.g46b-mb-lg { margin-bottom: var(--g46b-space-lg); }

.g46b-mt-xs { margin-top: var(--g46b-space-xs); }
.g46b-mt-sm { margin-top: var(--g46b-space-sm); }
.g46b-mt-md { margin-top: var(--g46b-space-md); }
.g46b-mt-lg { margin-top: var(--g46b-space-lg); }

.g46b-p-xs { padding: var(--g46b-space-xs); }
.g46b-p-sm { padding: var(--g46b-space-sm); }
.g46b-p-md { padding: var(--g46b-space-md); }
.g46b-p-lg { padding: var(--g46b-space-lg); }

.g46b-hidden { display: none; }
.g46b-visible { display: block; }

/* Loading States */
.g46b-loading {
  opacity: 0.6;
  pointer-events: none;
}

.g46b-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--g46b-primary);
  border-top-color: transparent;
  border-radius: var(--g46b-radius-full);
  animation: g46b-spin 1s linear infinite;
}

@keyframes g46b-spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .g46b-main {
    padding-bottom: 80px; /* Account for fixed bottom nav */
  }
}

@media (min-width: 769px) {
  .g46b-bottom-nav {
    display: none; /* Hide bottom nav on desktop */
  }

  .g46b-main {
    padding-bottom: var(--g46b-space-lg);
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --g46b-text: #ECF0F1;
    --g46b-text-light: #BDC3C7;
  }
}

/* Accessibility */
.g46b-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for keyboard navigation */
.g46b-btn:focus,
.g46b-nav-link:focus,
.g46b-promo-link:focus {
  outline: 2px solid var(--g46b-primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --g46b-primary: #00FF00;
    --g46b-secondary: #FFFF00;
    --g46b-accent: #FF6600;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}