/* Maya Games - Core CSS Styles */
/* All classes use s8fe- prefix for namespace isolation */

/* CSS Variables for consistent theming */
:root {
  --s8fe-primary: #00B8D4;
  --s8fe-secondary: #2E4057;
  --s8fe-accent: #FFFFBA;
  --s8fe-background: #FDF5E6;
  --s8fe-text: #2E4057;
  --s8fe-text-light: #6C757D;
  --s8fe-border: #DEB887;
  --s8fe-success: #28a745;
  --s8fe-warning: #ffc107;
  --s8fe-danger: #dc3545;
  --s8fe-white: #ffffff;
  --s8fe-black: #000000;
  --s8fe-shadow: rgba(0, 0, 0, 0.1);
  --s8fe-shadow-hover: rgba(0, 0, 0, 0.15);
  --s8fe-transition: all 0.3s ease;
  --s8fe-border-radius: 8px;
  --s8fe-border-radius-lg: 12px;
  --s8fe-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%; /* 1rem = 10px for easy calculations */
  scroll-behavior: smooth;
}

body {
  font-family: var(--s8fe-font-family);
  font-size: 1.4rem;
  line-height: 1.5;
  color: var(--s8fe-text);
  background-color: var(--s8fe-background);
  overflow-x: hidden;
}

/* Container and layout utilities */
.s8fe-container {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.s8fe-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.s8fe-main {
  flex: 1;
  padding-bottom: 8rem; /* Space for bottom nav on mobile */
}

.s8fe-grid {
  display: grid;
  gap: 1.5rem;
}

.s8fe-flex {
  display: flex;
}

.s8fe-flex-col {
  flex-direction: column;
}

.s8fe-items-center {
  align-items: center;
}

.s8fe-justify-center {
  justify-content: center;
}

.s8fe-justify-between {
  justify-content: space-between;
}

.s8fe-text-center {
  text-align: center;
}

/* Header styles */
.s8fe-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--s8fe-secondary) 0%, var(--s8fe-primary) 100%);
  box-shadow: 0 2px 10px var(--s8fe-shadow);
  z-index: 1000;
  transition: var(--s8fe-transition);
}

.s8fe-header.scrolled {
  background: linear-gradient(135deg, var(--s8fe-secondary) 0%, var(--s8fe-primary) 90%);
  box-shadow: 0 4px 20px var(--s8fe-shadow-hover);
}

.s8fe-header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 430px;
  margin: 0 auto;
}

.s8fe-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--s8fe-white);
  font-weight: 700;
  font-size: 1.8rem;
}

.s8fe-logo-icon {
  width: 2.8rem;
  height: 2.8rem;
  background: var(--s8fe-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--s8fe-secondary);
}

/* Navigation styles */
.s8fe-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.s8fe-nav-desktop {
  display: none;
}

.s8fe-nav-link {
  color: var(--s8fe-white);
  text-decoration: none;
  padding: 0.8rem 1.2rem;
  border-radius: var(--s8fe-border-radius);
  transition: var(--s8fe-transition);
  font-weight: 500;
  font-size: 1.3rem;
}

.s8fe-nav-link:hover,
.s8fe-nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--s8fe-accent);
}

/* Button styles */
.s8fe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  border: none;
  border-radius: var(--s8fe-border-radius);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--s8fe-transition);
  min-height: 4.4rem; /* Touch-friendly minimum */
  min-width: 4.4rem;
}

.s8fe-btn-primary {
  background: linear-gradient(135deg, var(--s8fe-primary) 0%, var(--s8fe-secondary) 100%);
  color: var(--s8fe-white);
  box-shadow: 0 2px 8px var(--s8fe-shadow);
}

.s8fe-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--s8fe-shadow-hover);
}

.s8fe-btn-secondary {
  background: var(--s8fe-accent);
  color: var(--s8fe-secondary);
  box-shadow: 0 2px 8px var(--s8fe-shadow);
}

.s8fe-btn-secondary:hover {
  background: var(--s8fe-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--s8fe-shadow-hover);
}

.s8fe-btn-outline {
  background: transparent;
  color: var(--s8fe-primary);
  border: 2px solid var(--s8fe-primary);
}

.s8fe-btn-outline:hover {
  background: var(--s8fe-primary);
  color: var(--s8fe-white);
}

/* Hamburger menu */
.s8fe-hamburger {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.8rem;
  background: none;
  border: none;
  cursor: pointer;
  min-width: 4.4rem;
  min-height: 4.4rem;
}

.s8fe-hamburger span {
  width: 2.4rem;
  height: 0.3rem;
  background: var(--s8fe-white);
  border-radius: 2px;
  transition: var(--s8fe-transition);
}

.s8fe-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(0.5rem, 0.5rem);
}

.s8fe-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.s8fe-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(0.5rem, -0.5rem);
}

/* Mobile menu overlay */
.s8fe-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--s8fe-transition);
}

.s8fe-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile menu */
.s8fe-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: var(--s8fe-white);
  box-shadow: -4px 0 20px var(--s8fe-shadow);
  z-index: 10000;
  transition: var(--s8fe-transition);
  overflow-y: auto;
}

.s8fe-mobile-menu.active {
  right: 0;
}

.s8fe-mobile-menu-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--s8fe-secondary) 0%, var(--s8fe-primary) 100%);
  color: var(--s8fe-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.s8fe-mobile-menu-close {
  background: none;
  border: none;
  color: var(--s8fe-white);
  font-size: 2.4rem;
  cursor: pointer;
  padding: 0.5rem;
  min-width: 4.4rem;
  min-height: 4.4rem;
}

.s8fe-mobile-menu-nav {
  padding: 1rem 0;
}

.s8fe-mobile-menu-link {
  display: block;
  padding: 1.2rem 1.5rem;
  color: var(--s8fe-text);
  text-decoration: none;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: var(--s8fe-transition);
}

.s8fe-mobile-menu-link:hover,
.s8fe-mobile-menu-link.active {
  background: var(--s8fe-background);
  border-left-color: var(--s8fe-primary);
  color: var(--s8fe-primary);
}

/* Hero carousel */
.s8fe-hero {
  position: relative;
  margin-top: 6rem; /* Account for fixed header */
  background: var(--s8fe-secondary);
  border-radius: var(--s8fe-border-radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
}

.s8fe-hero-slides {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.s8fe-hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: pointer;
}

.s8fe-hero-slide.active {
  opacity: 1;
}

.s8fe-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.s8fe-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(46, 64, 87, 0.8) 0%, rgba(0, 184, 212, 0.6) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--s8fe-white);
  padding: 2rem;
}

.s8fe-hero-content h2 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.s8fe-hero-content p {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.s8fe-carousel-indicators {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.s8fe-carousel-indicator {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--s8fe-transition);
}

.s8fe-carousel-indicator.active {
  background: var(--s8fe-accent);
  transform: scale(1.2);
}

/* Card styles */
.s8fe-card {
  background: var(--s8fe-white);
  border-radius: var(--s8fe-border-radius);
  padding: 2rem;
  box-shadow: 0 2px 8px var(--s8fe-shadow);
  transition: var(--s8fe-transition);
  border: 1px solid var(--s8fe-border);
}

.s8fe-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--s8fe-shadow-hover);
}

.s8fe-card-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--s8fe-border);
}

.s8fe-card-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--s8fe-secondary);
  margin-bottom: 0.5rem;
}

.s8fe-card-subtitle {
  font-size: 1.2rem;
  color: var(--s8fe-text-light);
}

/* Game grid */
.s8fe-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.s8fe-game-card {
  background: var(--s8fe-white);
  border-radius: var(--s8fe-border-radius);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: var(--s8fe-transition);
  border: 1px solid var(--s8fe-border);
  text-decoration: none;
  color: var(--s8fe-text);
}

.s8fe-game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--s8fe-shadow-hover);
  border-color: var(--s8fe-primary);
}

.s8fe-game-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 0.5rem;
  border-radius: var(--s8fe-border-radius);
  overflow: hidden;
}

.s8fe-game-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.s8fe-game-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: var(--s8fe-secondary);
}

.s8fe-game-type {
  font-size: 0.9rem;
  color: var(--s8fe-text-light);
  text-transform: capitalize;
}

/* Typography */
.s8fe-h1 {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--s8fe-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.s8fe-h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--s8fe-secondary);
  margin-bottom: 1.2rem;
  line-height: 1.3;
}

.s8fe-h3 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--s8fe-secondary);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.s8fe-text {
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--s8fe-text);
  margin-bottom: 1rem;
}

.s8fe-text-small {
  font-size: 1.2rem;
  color: var(--s8fe-text-light);
}

.s8fe-text-large {
  font-size: 1.6rem;
  font-weight: 500;
}

/* Links */
.s8fe-link {
  color: var(--s8fe-primary);
  text-decoration: none;
  transition: var(--s8fe-transition);
  font-weight: 500;
}

.s8fe-link:hover {
  color: var(--s8fe-secondary);
  text-decoration: underline;
}

.s8fe-link-promo {
  color: var(--s8fe-primary);
  font-weight: 700;
  text-decoration: none;
  transition: var(--s8fe-transition);
  position: relative;
}

.s8fe-link-promo:hover {
  color: var(--s8fe-secondary);
  text-decoration: underline;
}

.s8fe-link-promo::after {
  content: '→';
  margin-left: 0.5rem;
  transition: var(--s8fe-transition);
}

.s8fe-link-promo:hover::after {
  margin-left: 0.8rem;
}

/* Sections */
.s8fe-section {
  padding: 3rem 0;
}

.s8fe-section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.s8fe-section-title h2 {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--s8fe-secondary);
  margin-bottom: 1rem;
}

.s8fe-section-title p {
  font-size: 1.4rem;
  color: var(--s8fe-text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* Footer */
.s8fe-footer {
  background: linear-gradient(135deg, var(--s8fe-secondary) 0%, var(--s8fe-primary) 100%);
  color: var(--s8fe-white);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.s8fe-footer-content {
  margin-bottom: 2rem;
}

.s8fe-footer-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--s8fe-accent);
}

.s8fe-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.s8fe-footer-link {
  color: var(--s8fe-white);
  text-decoration: none;
  font-size: 1.2rem;
  transition: var(--s8fe-transition);
}

.s8fe-footer-link:hover {
  color: var(--s8fe-accent);
}

.s8fe-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

.s8fe-partner {
  width: 4rem;
  height: 4rem;
  background: var(--s8fe-white);
  border-radius: var(--s8fe-border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--s8fe-shadow);
}

.s8fe-partner img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.s8fe-footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Bottom navigation for mobile */
.s8fe-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--s8fe-white);
  box-shadow: 0 -2px 10px var(--s8fe-shadow);
  z-index: 1000;
  padding: 0.5rem 0;
  border-top: 1px solid var(--s8fe-border);
}

.s8fe-bottom-nav-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 430px;
  margin: 0 auto;
}

.s8fe-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 6rem;
  min-height: 5.6rem;
  padding: 0.5rem;
  text-decoration: none;
  color: var(--s8fe-text-light);
  transition: var(--s8fe-transition);
  cursor: pointer;
  border: none;
  background: none;
  border-radius: var(--s8fe-border-radius);
}

.s8fe-bottom-nav-item:hover,
.s8fe-bottom-nav-item.active {
  color: var(--s8fe-primary);
  background: rgba(0, 184, 212, 0.1);
}

.s8fe-bottom-nav-icon {
  font-size: 2.4rem;
  margin-bottom: 0.3rem;
  transition: var(--s8fe-transition);
}

.s8fe-bottom-nav-item:hover .s8fe-bottom-nav-icon,
.s8fe-bottom-nav-item.active .s8fe-bottom-nav-icon {
  transform: scale(1.1);
}

.s8fe-bottom-nav-text {
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
  .s8fe-main {
    padding-bottom: 8rem; /* Space for bottom nav */
  }

  .s8fe-bottom-nav {
    display: block;
  }
}

@media (min-width: 769px) {
  .s8fe-bottom-nav {
    display: none;
  }

  .s8fe-nav-desktop {
    display: flex;
  }

  .s8fe-hamburger {
    display: none;
  }

  .s8fe-main {
    padding-bottom: 0;
  }
}

/* Utility classes */
.s8fe-mb-1 { margin-bottom: 1rem; }
.s8fe-mb-2 { margin-bottom: 2rem; }
.s8fe-mb-3 { margin-bottom: 3rem; }
.s8fe-mt-1 { margin-top: 1rem; }
.s8fe-mt-2 { margin-top: 2rem; }
.s8fe-mt-3 { margin-top: 3rem; }

.s8fe-p-1 { padding: 1rem; }
.s8fe-p-2 { padding: 2rem; }
.s8fe-p-3 { padding: 3rem; }

.s8fe-hidden {
  display: none !important;
}

.s8fe-visible {
  display: block !important;
}

/* Animation utilities */
@keyframes s8fe-fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.s8fe-fade-in {
  animation: s8fe-fadeIn 0.5s ease-out;
}

@keyframes s8fe-slideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.s8fe-slide-in {
  animation: s8fe-slideIn 0.3s ease-out;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --s8fe-shadow: rgba(0, 0, 0, 0.3);
    --s8fe-shadow-hover: rgba(0, 0, 0, 0.4);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for accessibility */
.s8fe-btn:focus,
.s8fe-link:focus,
.s8fe-nav-link:focus,
.s8fe-mobile-menu-link:focus {
  outline: 2px solid var(--s8fe-primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .s8fe-header,
  .s8fe-bottom-nav,
  .s8fe-mobile-menu,
  .s8fe-menu-overlay {
    display: none !important;
  }

  .s8fe-main {
    padding-bottom: 0 !important;
  }
}