/* Pokebet88 Advanced Mobile-First CSS Framework */
/* All classes use 'pga3-' prefix for namespace isolation */
/* Optimized for 430px max-width mobile experience */

/* ===== ROOT VARIABLES AND CONFIGURATION ===== */
:root {
  /* Primary Color Palette - Dark and Rich Theme */
  --pga3-primary: #8B0000;          /* Dark Red - Primary Brand */
  --pga3-secondary: #FA8072;        /* Salmon - Secondary Accent */
  --pga3-accent: #CD853F;           /* Peru - Accent Color */
  --pga3-background: #0F0F23;       /* Dark Blue - Main Background */
  --pga3-surface: #1a1a2e;         /* Slightly Lighter Surface */
  --pga3-overlay: rgba(15, 15, 35, 0.95);

  /* Text Colors with High Contrast */
  --pga3-text-primary: #ffffff;
  --pga3-text-secondary: #FA8072;
  --pga3-text-muted: #cccccc;
  --pga3-text-inverse: #0F0F23;

  /* Interactive States */
  --pga3-hover: rgba(139, 0, 0, 0.8);
  --pga3-active: rgba(139, 0, 0, 1);
  --pga3-focus: rgba(250, 128, 114, 0.5);

  /* Gradients for Enhanced Visual Appeal */
  --pga3-gradient-primary: linear-gradient(135deg, var(--pga3-primary) 0%, var(--pga3-secondary) 100%);
  --pga3-gradient-background: linear-gradient(180deg, var(--pga3-background) 0%, var(--pga3-surface) 100%);
  --pga3-gradient-accent: linear-gradient(90deg, var(--pga3-accent) 0%, var(--pga3-secondary) 100%);

  /* Layout and Spacing */
  --pga3-max-width: 430px;
  --pga3-padding: 1rem;
  --pga3-gap: 0.75rem;
  --pga3-border-radius: 0.5rem;
  --pga3-border-radius-lg: 1rem;

  /* Typography Scale */
  --pga3-font-xs: 0.75rem;    /* 12px */
  --pga3-font-sm: 0.875rem;   /* 14px */
  --pga3-font-base: 1rem;     /* 16px */
  --pga3-font-lg: 1.125rem;   /* 18px */
  --pga3-font-xl: 1.25rem;    /* 20px */
  --pga3-font-2xl: 1.5rem;    /* 24px */
  --pga3-font-3xl: 1.875rem;  /* 30px */

  /* Shadows for Depth */
  --pga3-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --pga3-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  --pga3-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
  --pga3-shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4);

  /* Animation and Transitions */
  --pga3-transition-fast: 150ms ease-in-out;
  --pga3-transition-base: 250ms ease-in-out;
  --pga3-transition-slow: 350ms ease-in-out;

  /* Z-Index Scale */
  --pga3-z-dropdown: 1000;
  --pga3-z-overlay: 1040;
  --pga3-z-modal: 1050;
  --pga3-z-tooltip: 1070;
}

/* ===== RESET AND BASE STYLES ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 62.5%; /* 1rem = 10px for easier calculations */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: var(--pga3-font-base);
  line-height: 1.5;
  color: var(--pga3-text-primary);
  background: var(--pga3-gradient-background);
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

/* ===== UTILITY CLASSES ===== */
.pga3-container {
  width: 100%;
  max-width: var(--pga3-max-width);
  margin: 0 auto;
  padding: 0 var(--pga3-padding);
}

.pga3-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.pga3-main {
  flex: 1;
  padding-bottom: 8rem; /* Space for bottom navigation */
}

.pga3-section {
  padding: 2rem 0;
}

.pga3-section-alt {
  background: rgba(26, 26, 46, 0.5);
}

.pga3-card {
  background: var(--pga3-surface);
  border-radius: var(--pga3-border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--pga3-shadow);
  border: 1px solid rgba(250, 128, 114, 0.1);
}

.pga3-grid {
  display: grid;
  gap: var(--pga3-gap);
}

.pga3-flex {
  display: flex;
  gap: var(--pga3-gap);
}

.pga3-text-center {
  text-align: center;
}

.pga3-text-left {
  text-align: left;
}

.pga3-text-right {
  text-align: right;
}

.pga3-hidden {
  display: none;
}

.pga3-sr-only {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ===== HEADER AND NAVIGATION ===== */
.pga3-header {
  position: sticky;
  top: 0;
  z-index: var(--pga3-z-dropdown);
  background: rgba(139, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(250, 128, 114, 0.2);
  transition: background-color var(--pga3-transition-base);
}

.pga3-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem var(--pga3-padding);
  min-height: 60px;
}

.pga3-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--pga3-text-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--pga3-font-lg);
}

.pga3-logo img {
  width: 32px;
  height: 32px;
  border-radius: 0.25rem;
}

.pga3-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pga3-menu-toggle {
  background: none;
  border: none;
  color: var(--pga3-text-primary);
  font-size: var(--pga3-font-xl);
  padding: 0.5rem;
  border-radius: var(--pga3-border-radius);
  transition: all var(--pga3-transition-fast);
  cursor: pointer;
}

.pga3-menu-toggle:hover {
  background: var(--pga3-hover);
  color: var(--pga3-text-primary);
}

.pga3-menu-toggle.pga3-active {
  background: var(--pga3-primary);
  color: var(--pga3-text-primary);
}

/* Mobile Navigation */
.pga3-mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--pga3-gradient-background);
  transform: translateX(-100%);
  transition: transform var(--pga3-transition-base);
  z-index: var(--pga3-z-modal);
  box-shadow: var(--pga3-shadow-xl);
  border-right: 1px solid rgba(250, 128, 114, 0.2);
}

.pga3-mobile-nav.pga3-active {
  transform: translateX(0);
}

.pga3-mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid rgba(250, 128, 114, 0.2);
}

.pga3-nav-close {
  background: none;
  border: none;
  color: var(--pga3-text-primary);
  font-size: var(--pga3-font-xl);
  padding: 0.5rem;
  border-radius: var(--pga3-border-radius);
  cursor: pointer;
  transition: all var(--pga3-transition-fast);
}

.pga3-nav-close:hover {
  background: var(--pga3-hover);
}

.pga3-nav-menu {
  list-style: none;
  padding: 1rem 0;
}

.pga3-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--pga3-text-primary);
  text-decoration: none;
  transition: all var(--pga3-transition-fast);
  font-size: var(--pga3-font-base);
}

.pga3-nav-link:hover {
  background: rgba(139, 0, 0, 0.1);
  color: var(--pga3-secondary);
}

.pga3-nav-link i {
  width: 20px;
  text-align: center;
}

.pga3-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all var(--pga3-transition-base);
  z-index: var(--pga3-z-overlay);
  backdrop-filter: blur(2px);
}

.pga3-nav-overlay.pga3-active {
  opacity: 1;
  visibility: visible;
}

/* ===== BUTTONS ===== */
.pga3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: var(--pga3-font-sm);
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--pga3-border-radius);
  cursor: pointer;
  transition: all var(--pga3-transition-fast);
  min-height: 44px; /* Touch target size */
  background: var(--pga3-gradient-primary);
  color: var(--pga3-text-primary);
  box-shadow: var(--pga3-shadow-sm);
}

.pga3-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--pga3-shadow);
}

.pga3-btn:active, .pga3-btn.pga3-active {
  transform: translateY(0);
  box-shadow: var(--pga3-shadow-sm);
}

.pga3-btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--pga3-font-xs);
  min-height: 36px;
}

.pga3-btn-lg {
  padding: 1rem 2rem;
  font-size: var(--pga3-font-lg);
  min-height: 52px;
}

.pga3-btn-secondary {
  background: transparent;
  color: var(--pga3-secondary);
  border: 2px solid var(--pga3-secondary);
}

.pga3-btn-secondary:hover {
  background: var(--pga3-secondary);
  color: var(--pga3-text-inverse);
}

.pga3-btn-accent {
  background: var(--pga3-gradient-accent);
  color: var(--pga3-text-inverse);
}

.pga3-btn-ghost {
  background: transparent;
  color: var(--pga3-text-primary);
  border: 1px solid rgba(250, 128, 114, 0.3);
}

.pga3-btn-ghost:hover {
  background: rgba(250, 128, 114, 0.1);
}

/* ===== HERO SECTION ===== */
.pga3-hero {
  background: var(--pga3-gradient-primary);
  padding: 3rem 0 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.pga3-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none"><circle cx="10" cy="20" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="65" cy="30" r="1" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
  opacity: 0.3;
}

.pga3-hero-content {
  position: relative;
  z-index: 2;
}

.pga3-hero-title {
  font-size: var(--pga3-font-3xl);
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--pga3-text-primary);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.pga3-hero-text {
  font-size: var(--pga3-font-lg);
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.pga3-hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* ===== CAROUSEL ===== */
.pga3-carousel {
  position: relative;
  margin: 2rem 0;
  border-radius: var(--pga3-border-radius-lg);
  overflow: hidden;
  box-shadow: var(--pga3-shadow-lg);
}

.pga3-carousel-container {
  display: flex;
  transition: transform var(--pga3-transition-slow);
}

.pga3-carousel-slide {
  min-width: 100%;
  cursor: pointer;
}

.pga3-carousel-slide img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.pga3-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0;
}

.pga3-carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: rgba(250, 128, 114, 0.3);
  cursor: pointer;
  transition: all var(--pga3-transition-fast);
}

.pga3-carousel-dot.pga3-active {
  background: var(--pga3-secondary);
  transform: scale(1.2);
}

/* ===== GAME GRID ===== */
.pga3-games-section {
  margin: 2rem 0;
}

.pga3-games-title {
  font-size: var(--pga3-font-2xl);
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--pga3-text-primary);
  text-align: center;
}

.pga3-games-category {
  margin-bottom: 2rem;
}

.pga3-category-title {
  font-size: var(--pga3-font-xl);
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--pga3-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pga3-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
}

.pga3-game-card {
  background: var(--pga3-surface);
  border-radius: var(--pga3-border-radius);
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--pga3-transition-fast);
  border: 1px solid rgba(250, 128, 114, 0.1);
  min-height: 100px;
}

.pga3-game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--pga3-shadow);
  border-color: var(--pga3-secondary);
}

.pga3-game-card:active, .pga3-game-card.pga3-touch-active {
  transform: translateY(-1px);
  box-shadow: var(--pga3-shadow-sm);
}

.pga3-game-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--pga3-border-radius);
  margin: 0 auto 0.5rem;
  transition: transform var(--pga3-transition-fast);
}

.pga3-game-card:hover .pga3-game-img {
  transform: scale(1.05);
}

.pga3-game-name {
  font-size: var(--pga3-font-xs);
  font-weight: 500;
  color: var(--pga3-text-primary);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ===== CONTENT SECTIONS ===== */
.pga3-section-title {
  font-size: var(--pga3-font-2xl);
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--pga3-text-primary);
  text-align: center;
}

.pga3-content {
  font-size: var(--pga3-font-base);
  line-height: 1.6;
  color: var(--pga3-text-muted);
  margin-bottom: 1rem;
}

.pga3-highlight {
  color: var(--pga3-secondary);
  font-weight: 600;
}

.pga3-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.pga3-stat-card {
  background: rgba(139, 0, 0, 0.1);
  border-radius: var(--pga3-border-radius);
  padding: 1rem;
  text-align: center;
  border: 1px solid rgba(250, 128, 114, 0.2);
}

.pga3-stat-number {
  font-size: var(--pga3-font-2xl);
  font-weight: 800;
  color: var(--pga3-secondary);
  display: block;
}

.pga3-stat-label {
  font-size: var(--pga3-font-sm);
  color: var(--pga3-text-muted);
  margin-top: 0.25rem;
}

/* ===== BOTTOM NAVIGATION ===== */
.pga3-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--pga3-overlay);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(250, 128, 114, 0.2);
  z-index: var(--pga3-z-dropdown);
}

.pga3-bottom-nav-content {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0.5rem;
  max-width: var(--pga3-max-width);
  margin: 0 auto;
}

.pga3-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--pga3-text-muted);
  text-decoration: none;
  transition: all var(--pga3-transition-fast);
  min-height: 56px;
  min-width: 44px;
  border-radius: var(--pga3-border-radius);
}

.pga3-bottom-nav-item:hover,
.pga3-bottom-nav-item.pga3-active {
  color: var(--pga3-secondary);
  background: rgba(250, 128, 114, 0.1);
  transform: translateY(-2px);
}

.pga3-bottom-nav-icon {
  font-size: 20px;
  margin-bottom: 0.25rem;
}

.pga3-bottom-nav-text {
  font-size: var(--pga3-font-xs);
  font-weight: 500;
}

/* ===== FOOTER ===== */
.pga3-footer {
  background: var(--pga3-surface);
  padding: 2rem 0;
  margin-top: 3rem;
  border-top: 1px solid rgba(250, 128, 114, 0.2);
}

.pga3-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.pga3-footer-link {
  color: var(--pga3-text-secondary);
  text-decoration: none;
  font-size: var(--pga3-font-sm);
  padding: 0.5rem;
  border-radius: var(--pga3-border-radius);
  transition: all var(--pga3-transition-fast);
  background: none;
  border: none;
  cursor: pointer;
}

.pga3-footer-link:hover {
  background: rgba(250, 128, 114, 0.1);
  color: var(--pga3-secondary);
}

.pga3-partners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}

.pga3-partner-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity var(--pga3-transition-fast);
  filter: grayscale(1) brightness(1.5);
}

.pga3-partner-img:hover {
  opacity: 1;
  filter: grayscale(0) brightness(1);
}

.pga3-footer-copyright {
  text-align: center;
  color: var(--pga3-text-muted);
  font-size: var(--pga3-font-sm);
  line-height: 1.6;
}

/* ===== LOADING AND ANIMATIONS ===== */
.pga3-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--pga3-background);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--pga3-z-modal);
  opacity: 1;
  visibility: visible;
  transition: all var(--pga3-transition-slow);
}

.pga3-loading.pga3-hidden {
  opacity: 0;
  visibility: hidden;
}

.pga3-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(250, 128, 114, 0.2);
  border-top: 4px solid var(--pga3-secondary);
  border-radius: 50%;
  animation: pga3-spin 1s linear infinite;
}

@keyframes pga3-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.pga3-lazy {
  opacity: 0;
  transition: opacity var(--pga3-transition-base);
}

.pga3-loaded {
  opacity: 1;
}

.pga3-fade-in {
  animation: pga3-fadeIn 0.6s ease-out forwards;
}

@keyframes pga3-fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE ENHANCEMENTS ===== */
@media (max-width: 320px) {
  :root {
    --pga3-font-xs: 0.7rem;
    --pga3-font-sm: 0.8rem;
    --pga3-font-base: 0.9rem;
  }
  
  .pga3-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }
  
  .pga3-game-img {
    width: 45px;
    height: 45px;
  }
}

@media (min-width: 431px) {
  .pga3-container {
    max-width: 431px;
  }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.pga3-focus-visible {
  outline: 2px solid var(--pga3-focus);
  outline-offset: 2px;
}

/* ===== TOUCH ENHANCEMENTS ===== */
.pga3-touch-active {
  background: rgba(250, 128, 114, 0.1) !important;
  transform: scale(0.98) !important;
}

/* ===== PRINT STYLES ===== */
@media print {
  .pga3-header,
  .pga3-bottom-nav,
  .pga3-mobile-nav,
  .pga3-nav-overlay,
  .pga3-carousel,
  .pga3-btn {
    display: none !important;
  }
  
  .pga3-main {
    padding-bottom: 0;
  }
  
  body {
    background: white;
    color: black;
  }
}