/* SpinPH8 Design System - Mobile-First Gaming Platform */
/* CSS classes use s8- prefix for namespace isolation */

/* ===== CSS VARIABLES - SPINPH8 COLOR PALETTE ===== */
:root {
  /* Primary Colors - Electric Purple Theme */
  --s8-primary: #7B3FF2;
  --s8-primary-dark: #5A2BB8;
  --s8-primary-light: #9B66F5;
  --s8-secondary: #FF6B35;
  --s8-secondary-dark: #E55A2B;
  --s8-secondary-light: #FF8A5C;

  /* Accent Colors */
  --s8-accent-1: #00D4AA;
  --s8-accent-2: #FFD700;
  --s8-accent-3: #FF4757;

  /* Neutral Colors */
  --s8-dark: #0A0A0A;
  --s8-dark-2: #1A1A1A;
  --s8-dark-3: #2A2A2A;
  --s8-gray: #666666;
  --s8-gray-light: #999999;
  --s8-gray-lighter: #CCCCCC;
  --s8-light: #F8F8F8;
  --s8-white: #FFFFFF;

  /* Gradient Colors */
  --s8-gradient-primary: linear-gradient(135deg, #7B3FF2 0%, #9B6F5 100%);
  --s8-gradient-secondary: linear-gradient(135deg, #FF6B35 0%, #FF8A5C 100%);
  --s8-gradient-dark: linear-gradient(135deg, #0A0A0A 0%, #2A2A2A 100%);
  --s8-gradient-card: linear-gradient(135deg, #1A1A1A 0%, #2A2A2A 100%);

  /* Typography */
  --s8-font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --s8-font-secondary: 'Poppins', sans-serif;
  --s8-font-mono: 'Fira Code', monospace;

  /* Spacing */
  --s8-space-xs: 4px;
  --s8-space-sm: 8px;
  --s8-space-md: 16px;
  --s8-space-lg: 24px;
  --s8-space-xl: 32px;
  --s8-space-xxl: 48px;

  /* Border Radius */
  --s8-radius-sm: 4px;
  --s8-radius-md: 8px;
  --s8-radius-lg: 12px;
  --s8-radius-xl: 16px;
  --s8-radius-round: 50%;

  /* Shadows */
  --s8-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --s8-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --s8-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --s8-shadow-glow: 0 0 20px rgba(123, 63, 242, 0.3);

  /* Transitions */
  --s8-transition-fast: 0.2s ease;
  --s8-transition-normal: 0.3s ease;
  --s8-transition-slow: 0.5s ease;
}

/* ===== RESET AND BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--s8-font-primary);
  background: var(--s8-dark);
  color: var(--s8-white);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Mobile-first responsive font sizing */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
}

/* ===== TYPOGRAPHY ===== */
.s8-text-xs { font-size: 0.75rem; }
.s8-text-sm { font-size: 0.875rem; }
.s8-text-base { font-size: 1rem; }
.s8-text-lg { font-size: 1.125rem; }
.s8-text-xl { font-size: 1.25rem; }
.s8-text-2xl { font-size: 1.5rem; }
.s8-text-3xl { font-size: 1.875rem; }
.s8-text-4xl { font-size: 2.25rem; }

.s8-font-light { font-weight: 300; }
.s8-font-normal { font-weight: 400; }
.s8-font-medium { font-weight: 500; }
.s8-font-semibold { font-weight: 600; }
.s8-font-bold { font-weight: 700; }

.s8-text-center { text-align: center; }
.s8-text-left { text-align: left; }
.s8-text-right { text-align: right; }

.s8-text-primary { color: var(--s8-primary); }
.s8-text-secondary { color: var(--s8-secondary); }
.s8-text-accent { color: var(--s8-accent-1); }
.s8-text-white { color: var(--s8-white); }
.s8-text-gray { color: var(--s8-gray); }
.s8-text-gray-light { color: var(--s8-gray-light); }

/* ===== LAYOUT UTILITIES ===== */
.s8-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s8-space-md);
}

.s8-flex { display: flex; }
.s8-flex-col { flex-direction: column; }
.s8-flex-row { flex-direction: row; }
.s8-items-center { align-items: center; }
.s8-items-start { align-items: flex-start; }
.s8-items-end { align-items: flex-end; }
.s8-justify-center { justify-content: center; }
.s8-justify-between { justify-content: space-between; }
.s8-justify-around { justify-content: space-around; }

.s8-grid { display: grid; }
.s8-grid-cols-1 { grid-template-columns: 1fr; }
.s8-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.s8-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.s8-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

.s8-gap-sm { gap: var(--s8-space-sm); }
.s8-gap-md { gap: var(--s8-space-md); }
.s8-gap-lg { gap: var(--s8-space-lg); }

.s8-hidden { display: none !important; }
.s8-block { display: block !important; }
.s8-inline { display: inline !important; }
.s8-inline-block { display: inline-block !important; }

/* ===== SPACING UTILITIES ===== */
.s8-m-0 { margin: 0; }
.s8-m-sm { margin: var(--s8-space-sm); }
.s8-m-md { margin: var(--s8-space-md); }
.s8-m-lg { margin: var(--s8-space-lg); }

.s8-mt-sm { margin-top: var(--s8-space-sm); }
.s8-mt-md { margin-top: var(--s8-space-md); }
.s8-mt-lg { margin-top: var(--s8-space-lg); }
.s8-mt-xl { margin-top: var(--s8-space-xl); }

.s8-mb-sm { margin-bottom: var(--s8-space-sm); }
.s8-mb-md { margin-bottom: var(--s8-space-md); }
.s8-mb-lg { margin-bottom: var(--s8-space-lg); }
.s8-mb-xl { margin-bottom: var(--s8-space-xl); }

.s8-p-0 { padding: 0; }
.s8-p-sm { padding: var(--s8-space-sm); }
.s8-p-md { padding: var(--s8-space-md); }
.s8-p-lg { padding: var(--s8-space-lg); }

.s8-pt-sm { padding-top: var(--s8-space-sm); }
.s8-pt-md { padding-top: var(--s8-space-md); }
.s8-pt-lg { padding-top: var(--s8-space-lg); }

.s8-pb-sm { padding-bottom: var(--s8-space-sm); }
.s8-pb-md { padding-bottom: var(--s8-space-md); }
.s8-pb-lg { padding-bottom: var(--s8-space-lg); }

/* Mobile padding for bottom nav */
@media (max-width: 768px) {
  .s8-main-content {
    padding-bottom: 80px;
  }
}

/* ===== BUTTONS ===== */
.s8-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--s8-space-sm) var(--s8-space-md);
  border: none;
  border-radius: var(--s8-radius-md);
  font-family: var(--s8-font-primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--s8-transition-fast);
  position: relative;
  overflow: hidden;
}

.s8-btn-primary {
  background: var(--s8-gradient-primary);
  color: var(--s8-white);
  box-shadow: var(--s8-shadow-sm);
}

.s8-btn-primary:hover {
  box-shadow: var(--s8-shadow-md);
  transform: translateY(-2px);
}

.s8-btn-secondary {
  background: var(--s8-gradient-secondary);
  color: var(--s8-white);
  box-shadow: var(--s8-shadow-sm);
}

.s8-btn-secondary:hover {
  box-shadow: var(--s8-shadow-md);
  transform: translateY(-2px);
}

.s8-btn-outline {
  background: transparent;
  color: var(--s8-primary);
  border: 2px solid var(--s8-primary);
}

.s8-btn-outline:hover {
  background: var(--s8-primary);
  color: var(--s8-white);
}

.s8-btn-lg {
  padding: var(--s8-space-md) var(--s8-space-lg);
  font-size: var(--s8-text-lg);
}

.s8-btn-sm {
  padding: var(--s8-space-xs) var(--s8-space-sm);
  font-size: var(--s8-text-sm);
}

/* ===== HEADER ===== */
.s8-header {
  background: var(--s8-gradient-dark);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(123, 63, 242, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 60px;
}

.s8-header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--s8-space-md);
}

.s8-logo {
  font-family: var(--s8-font-secondary);
  font-size: var(--s8-text-xl);
  font-weight: 700;
  color: var(--s8-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--s8-space-sm);
}

.s8-logo::before {
  content: "🎰";
  font-size: var(--s8-text-2xl);
}

.s8-header-actions {
  display: flex;
  align-items: center;
  gap: var(--s8-space-sm);
}

.s8-register-btn,
.s8-login-btn {
  padding: var(--s8-space-sm) var(--s8-space-md);
  font-size: var(--s8-text-sm);
  font-weight: 600;
  border-radius: var(--s8-radius-md);
  text-decoration: none;
  transition: all var(--s8-transition-fast);
  cursor: pointer;
}

.s8-register-btn {
  background: var(--s8-gradient-primary);
  color: var(--s8-white);
  box-shadow: var(--s8-shadow-sm);
}

.s8-register-btn:hover {
  box-shadow: var(--s8-shadow-md);
  transform: translateY(-1px);
}

.s8-login-btn {
  background: transparent;
  color: var(--s8-primary);
  border: 2px solid var(--s8-primary);
}

.s8-login-btn:hover {
  background: var(--s8-primary);
  color: var(--s8-white);
}

.s8-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--s8-white);
  font-size: var(--s8-text-xl);
  cursor: pointer;
  padding: var(--s8-space-sm);
}

@media (max-width: 768px) {
  .s8-menu-toggle {
    display: block;
  }

  .s8-header-actions {
    gap: var(--s8-space-xs);
  }

  .s8-register-btn,
  .s8-login-btn {
    padding: var(--s8-space-xs) var(--s8-space-sm);
    font-size: var(--s8-text-xs);
  }
}

/* ===== MOBILE MENU ===== */
.s8-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--s8-dark-2);
  backdrop-filter: blur(10px);
  z-index: 9999;
  transition: right var(--s8-transition-normal);
  overflow-y: auto;
  border-left: 1px solid rgba(123, 63, 242, 0.2);
}

.s8-mobile-menu.active {
  right: 0;
}

.s8-mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all var(--s8-transition-normal);
}

.s8-mobile-overlay.active {
  opacity: 1;
  visibility: visible;
}

.s8-mobile-menu-header {
  padding: var(--s8-space-lg);
  border-bottom: 1px solid rgba(123, 63, 242, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.s8-mobile-menu-close {
  background: none;
  border: none;
  color: var(--s8-white);
  font-size: var(--s8-text-xl);
  cursor: pointer;
}

.s8-mobile-menu-nav {
  padding: var(--s8-space-md);
}

.s8-mobile-menu-nav a {
  display: block;
  padding: var(--s8-space-md);
  color: var(--s8-white);
  text-decoration: none;
  border-radius: var(--s8-radius-md);
  transition: all var(--s8-transition-fast);
}

.s8-mobile-menu-nav a:hover {
  background: rgba(123, 63, 242, 0.1);
  color: var(--s8-primary);
}

/* ===== CAROUSEL ===== */
.s8-carousel {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  border-radius: var(--s8-radius-lg);
  margin: var(--s8-space-lg) 0;
}

.s8-carousel-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.s8-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity var(--s8-transition-slow);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.s8-slide.active {
  opacity: 1;
}

.s8-slide-content {
  text-align: center;
  padding: var(--s8-space-xl);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  border-radius: var(--s8-radius-lg);
  max-width: 600px;
}

.s8-slide-title {
  font-family: var(--s8-font-secondary);
  font-size: var(--s8-text-3xl);
  font-weight: 700;
  color: var(--s8-white);
  margin-bottom: var(--s8-space-md);
}

.s8-slide-description {
  font-size: var(--s8-text-lg);
  color: var(--s8-gray-lighter);
  margin-bottom: var(--s8-space-lg);
}

.s8-carousel-controls {
  position: absolute;
  bottom: var(--s8-space-md);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--s8-space-sm);
}

.s8-indicator {
  width: 12px;
  height: 12px;
  border-radius: var(--s8-radius-round);
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all var(--s8-transition-fast);
}

.s8-indicator.active {
  background: var(--s8-primary);
  transform: scale(1.2);
}

.s8-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: var(--s8-white);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--s8-radius-round);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--s8-transition-fast);
}

.s8-carousel-nav:hover {
  background: var(--s8-primary);
}

.s8-prev {
  left: var(--s8-space-md);
}

.s8-next {
  right: var(--s8-space-md);
}

@media (max-width: 768px) {
  .s8-carousel {
    height: 200px;
    margin: var(--s8-space-md) 0;
  }

  .s8-slide-title {
    font-size: var(--s8-text-xl);
  }

  .s8-slide-description {
    font-size: var(--s8-text-base);
  }
}

/* ===== GAME GRID ===== */
.s8-games-section {
  padding: var(--s8-space-xl) 0;
}

.s8-section-title {
  font-family: var(--s8-font-secondary);
  font-size: var(--s8-text-3xl);
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--s8-space-xl);
  background: var(--s8-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.s8-game-filters {
  display: flex;
  justify-content: center;
  gap: var(--s8-space-sm);
  margin-bottom: var(--s8-space-xl);
  flex-wrap: wrap;
}

.s8-filter-btn {
  padding: var(--s8-space-sm) var(--s8-space-md);
  background: var(--s8-dark-2);
  color: var(--s8-gray-light);
  border: 1px solid var(--s8-dark-3);
  border-radius: var(--s8-radius-lg);
  cursor: pointer;
  transition: all var(--s8-transition-fast);
  font-weight: 500;
}

.s8-filter-btn:hover,
.s8-filter-btn.active {
  background: var(--s8-gradient-primary);
  color: var(--s8-white);
  border-color: var(--s8-primary);
  box-shadow: var(--s8-shadow-glow);
}

.s8-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--s8-space-md);
}

.s8-game-card {
  background: var(--s8-gradient-card);
  border-radius: var(--s8-radius-lg);
  overflow: hidden;
  transition: all var(--s8-transition-normal);
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
}

.s8-game-card:hover {
  transform: translateY(-4px);
  border-color: var(--s8-primary);
  box-shadow: var(--s8-shadow-lg), var(--s8-shadow-glow);
}

.s8-game-card.visible {
  animation: s8FadeInUp 0.3s ease;
}

@keyframes s8FadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.s8-game-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  transition: transform var(--s8-transition-normal);
}

.s8-game-card:hover .s8-game-image {
  transform: scale(1.05);
}

.s8-game-info {
  padding: var(--s8-space-sm);
}

.s8-game-title {
  font-size: var(--s8-text-sm);
  font-weight: 600;
  color: var(--s8-white);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.s8-game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(123, 63, 242, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--s8-transition-normal);
}

.s8-game-card:hover .s8-game-overlay {
  opacity: 1;
}

.s8-play-btn {
  background: var(--s8-white);
  color: var(--s8-primary);
  border: none;
  padding: var(--s8-space-sm) var(--s8-space-md);
  border-radius: var(--s8-radius-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--s8-transition-fast);
}

.s8-play-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--s8-shadow-md);
}

@media (max-width: 768px) {
  .s8-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--s8-space-sm);
  }

  .s8-game-image {
    height: 100px;
  }
}

/* ===== BOTTOM NAVIGATION ===== */
.s8-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--s8-dark-2);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(123, 63, 242, 0.2);
  z-index: 1000;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.s8-bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  min-height: 60px;
  background: none;
  border: none;
  color: var(--s8-gray-light);
  cursor: pointer;
  transition: all var(--s8-transition-fast);
  border-radius: var(--s8-radius-md);
  position: relative;
}

.s8-bottom-nav-btn:hover,
.s8-bottom-nav-btn.active {
  color: var(--s8-primary);
  background: rgba(123, 63, 242, 0.1);
}

.s8-bottom-nav-icon {
  font-size: 24px;
  margin-bottom: 2px;
}

.s8-bottom-nav-text {
  font-size: 10px;
  font-weight: 500;
}

.s8-bottom-nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--s8-primary);
  border-radius: var(--s8-radius-round);
}

@media (min-width: 769px) {
  .s8-bottom-nav {
    display: none;
  }
}

/* ===== FOOTER ===== */
.s8-footer {
  background: var(--s8-gradient-dark);
  border-top: 1px solid rgba(123, 63, 242, 0.2);
  padding: var(--s8-space-xl) 0 var(--s8-space-lg);
  margin-top: var(--s8-space-xxl);
}

.s8-footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--s8-space-xl);
  margin-bottom: var(--s8-space-lg);
}

.s8-footer-section h3 {
  color: var(--s8-primary);
  margin-bottom: var(--s8-space-md);
  font-family: var(--s8-font-secondary);
}

.s8-footer-links {
  list-style: none;
}

.s8-footer-links li {
  margin-bottom: var(--s8-space-sm);
}

.s8-footer-links a {
  color: var(--s8-gray-light);
  text-decoration: none;
  transition: color var(--s8-transition-fast);
}

.s8-footer-links a:hover {
  color: var(--s8-primary);
}

.s8-footer-bottom {
  text-align: center;
  padding-top: var(--s8-space-lg);
  border-top: 1px solid var(--s8-dark-3);
  color: var(--s8-gray);
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 768px) {
  .s8-hidden-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .s8-hidden-desktop {
    display: none !important;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes s8Pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.s8-pulse {
  animation: s8Pulse 2s infinite;
}

@keyframes s8Glow {
  0%, 100% {
    box-shadow: var(--s8-shadow-glow);
  }
  50% {
    box-shadow: 0 0 30px rgba(123, 63, 242, 0.6);
  }
}

.s8-glow {
  animation: s8Glow 2s infinite;
}

/* ===== UTILITY CLASSES ===== */
.s8-rounded { border-radius: var(--s8-radius-md); }
.s8-rounded-lg { border-radius: var(--s8-radius-lg); }
.s8-rounded-xl { border-radius: var(--s8-radius-xl); }

.s8-shadow { box-shadow: var(--s8-shadow-sm); }
.s8-shadow-md { box-shadow: var(--s8-shadow-md); }
.s8-shadow-lg { box-shadow: var(--s8-shadow-lg); }

.s8-transition { transition: all var(--s8-transition-normal); }
.s8-transition-fast { transition: all var(--s8-transition-fast); }

.s8-cursor-pointer { cursor: pointer; }
.s8-cursor-default { cursor: default; }

.s8-select-none { user-select: none; }

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
.s8-btn:focus,
.s8-filter-btn:focus,
.s8-bottom-nav-btn:focus {
  outline: 2px solid var(--s8-primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --s8-primary: #8B5CF6;
    --s8-secondary: #F97316;
    --s8-dark: #000000;
    --s8-white: #FFFFFF;
  }
}