/**
 * AAAAPh Website CSS Styles
 * Mobile-first casino gaming website for Philippine market
 * All classes use sc39- prefix for namespace isolation
 */

/* CSS Variables for consistent theming */
:root {
  /* Color palette - dark backgrounds, light text */
  --sc39-primary: #495057;
  --sc39-accent: #7FFF00;
  --sc39-secondary: #00FFFF;
  --sc39-success: #26A69A;
  --sc39-dark: #1E1E1E;
  --sc39-info: #20B2AA;

  /* Functional colors */
  --sc39-bg: #1E1E1E;
  --sc39-bg-secondary: #495057;
  --sc39-text: #FFFFFF;
  --sc39-text-secondary: #B0B0B0;
  --sc39-border: #495057;
  --sc39-shadow: rgba(0, 0, 0, 0.3);

  /* Typography */
  --sc39-font-size-base: 1.6rem;
  --sc39-font-size-sm: 1.4rem;
  --sc39-font-size-lg: 1.8rem;
  --sc39-font-size-xl: 2.2rem;
  --sc39-line-height: 1.5;

  /* Spacing */
  --sc39-spacing-xs: 0.5rem;
  --sc39-spacing-sm: 1rem;
  --sc39-spacing-md: 1.5rem;
  --sc39-spacing-lg: 2rem;
  --sc39-spacing-xl: 3rem;

  /* Border radius */
  --sc39-radius-sm: 0.4rem;
  --sc39-radius-md: 0.8rem;
  --sc39-radius-lg: 1.2rem;
  --sc39-radius-xl: 1.6rem;

  /* Transitions */
  --sc39-transition-fast: 0.2s ease;
  --sc39-transition-normal: 0.3s ease;
  --sc39-transition-slow: 0.5s ease;
}

/* 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: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--sc39-font-size-base);
  line-height: var(--sc39-line-height);
  color: var(--sc39-text);
  background-color: var(--sc39-bg);
  overflow-x: hidden;
  word-wrap: break-word;
}

/* Layout containers */
.sc39-container {
  width: 100%;
  max-width: 430px; /* Mobile-first constraint */
  margin: 0 auto;
  padding: 0 var(--sc39-spacing-sm);
}

.sc39-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sc39-main {
  flex: 1;
  padding-bottom: 8rem; /* Space for fixed bottom nav on mobile */
}

/* Grid system */
.sc39-grid {
  display: grid;
  gap: var(--sc39-spacing-sm);
}

.sc39-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.sc39-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.sc39-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Header and navigation */
.sc39-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--sc39-dark) 0%, var(--sc39-primary) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sc39-border);
  box-shadow: 0 2px 10px var(--sc39-shadow);
}

.sc39-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sc39-spacing-sm);
  min-height: 6rem;
}

.sc39-logo {
  display: flex;
  align-items: center;
  gap: var(--sc39-spacing-xs);
  text-decoration: none;
  color: var(--sc39-text);
  font-weight: bold;
  font-size: var(--sc39-font-size-lg);
}

.sc39-logo img {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--sc39-radius-sm);
}

.sc39-header-actions {
  display: flex;
  align-items: center;
  gap: var(--sc39-spacing-xs);
}

/* Buttons */
.sc39-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.6rem;
  border: none;
  border-radius: var(--sc39-radius-md);
  font-size: var(--sc39-font-size-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--sc39-transition-fast);
  min-height: 4.4rem; /* Touch-friendly minimum */
  min-width: 6rem;
  white-space: nowrap;
}

.sc39-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--sc39-shadow);
}

.sc39-btn:active {
  transform: translateY(0);
}

.sc39-btn-primary {
  background: linear-gradient(135deg, var(--sc39-accent) 0%, #6FFF00 100%);
  color: var(--sc39-dark);
}

.sc39-btn-primary:hover {
  background: linear-gradient(135deg, #6FFF00 0%, #5FFF00 100%);
}

.sc39-btn-secondary {
  background: linear-gradient(135deg, var(--sc39-secondary) 0%, #00DDDD 100%);
  color: var(--sc39-dark);
}

.sc39-btn-secondary:hover {
  background: linear-gradient(135deg, #00DDDD 0%, #00CCCC 100%);
}

.sc39-btn-outline {
  background: transparent;
  color: var(--sc39-text);
  border: 2px solid var(--sc39-border);
}

.sc39-btn-outline:hover {
  background: var(--sc39-border);
  color: var(--sc39-text);
}

/* Mobile menu */
.sc39-mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sc39-spacing-xs);
  border-radius: var(--sc39-radius-sm);
  transition: var(--sc39-transition-fast);
}

.sc39-mobile-menu-toggle span {
  width: 2rem;
  height: 0.2rem;
  background: var(--sc39-text);
  transition: var(--sc39-transition-fast);
  border-radius: 0.1rem;
}

.sc39-mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(0.5rem, 0.5rem);
}

.sc39-mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.sc39-mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(0.5rem, -0.5rem);
}

.sc39-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100vh;
  background: linear-gradient(135deg, var(--sc39-dark) 0%, var(--sc39-primary) 100%);
  backdrop-filter: blur(10px);
  z-index: 9999;
  transition: right var(--sc39-transition-normal);
  overflow-y: auto;
  padding-top: 6rem;
}

.sc39-mobile-menu.active {
  right: 0;
}

.sc39-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all var(--sc39-transition-normal);
}

.sc39-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sc39-nav-list {
  list-style: none;
  padding: var(--sc39-spacing-md);
}

.sc39-nav-item {
  margin-bottom: var(--sc39-spacing-sm);
}

.sc39-nav-link {
  display: block;
  padding: var(--sc39-spacing-sm);
  color: var(--sc39-text);
  text-decoration: none;
  border-radius: var(--sc39-radius-md);
  transition: all var(--sc39-transition-fast);
  font-weight: 500;
}

.sc39-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--sc39-accent);
}

/* Carousel */
.sc39-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--sc39-radius-lg);
  margin: var(--sc39-spacing-md) 0;
  box-shadow: 0 4px 20px var(--sc39-shadow);
}

.sc39-carousel-container {
  display: flex;
  transition: transform var(--sc39-transition-normal);
}

.sc39-carousel-slide {
  min-width: 100%;
  position: relative;
}

.sc39-carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
}

.sc39-carousel-indicators {
  position: absolute;
  bottom: var(--sc39-spacing-sm);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--sc39-spacing-xs);
}

.sc39-carousel-indicator {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--sc39-transition-fast);
}

.sc39-carousel-indicator.active {
  background: var(--sc39-accent);
  transform: scale(1.2);
}

/* Cards */
.sc39-card {
  background: linear-gradient(135deg, var(--sc39-primary) 0%, var(--sc39-dark) 100%);
  border-radius: var(--sc39-radius-lg);
  padding: var(--sc39-spacing-md);
  margin-bottom: var(--sc39-spacing-md);
  border: 1px solid var(--sc39-border);
  box-shadow: 0 2px 10px var(--sc39-shadow);
  transition: all var(--sc39-transition-normal);
}

.sc39-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--sc39-shadow);
}

.sc39-card-title {
  font-size: var(--sc39-font-size-lg);
  font-weight: 700;
  margin-bottom: var(--sc39-spacing-sm);
  color: var(--sc39-accent);
}

.sc39-card-content {
  color: var(--sc39-text-secondary);
  line-height: var(--sc39-line-height);
}

/* Game items */
.sc39-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sc39-spacing-sm);
  margin: var(--sc39-spacing-md) 0;
}

.sc39-game-item {
  background: linear-gradient(135deg, var(--sc39-primary) 0%, var(--sc39-dark) 100%);
  border-radius: var(--sc39-radius-md);
  padding: var(--sc39-spacing-xs);
  text-align: center;
  cursor: pointer;
  transition: all var(--sc39-transition-fast);
  border: 1px solid var(--sc39-border);
  min-height: 8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.sc39-game-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--sc39-shadow);
  border-color: var(--sc39-accent);
}

.sc39-game-icon {
  width: 3.2rem;
  height: 3.2rem;
  margin-bottom: var(--sc39-spacing-xs);
  border-radius: var(--sc39-radius-sm);
}

.sc39-game-name {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--sc39-text);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Sections */
.sc39-section {
  margin: var(--sc39-spacing-xl) 0;
}

.sc39-section-title {
  font-size: var(--sc39-font-size-xl);
  font-weight: 700;
  color: var(--sc39-accent);
  margin-bottom: var(--sc39-spacing-md);
  text-align: center;
}

.sc39-section-subtitle {
  font-size: var(--sc39-font-size-lg);
  font-weight: 600;
  color: var(--sc39-secondary);
  margin-bottom: var(--sc39-spacing-sm);
}

/* Bottom navigation */
.sc39-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--sc39-dark) 0%, var(--sc39-primary) 100%);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--sc39-border);
  padding: var(--sc39-spacing-xs) 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 6rem;
}

.sc39-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 6rem;
  min-height: 5rem;
  padding: var(--sc39-spacing-xs);
  cursor: pointer;
  transition: all var(--sc39-transition-fast);
  border: none;
  background: none;
  color: var(--sc39-text-secondary);
  text-decoration: none;
  border-radius: var(--sc39-radius-md);
}

.sc39-bottom-nav-item:hover {
  color: var(--sc39-accent);
  transform: translateY(-1px);
}

.sc39-bottom-nav-item.active {
  color: var(--sc39-accent);
  background: rgba(127, 255, 0, 0.1);
}

.sc39-bottom-nav-icon {
  font-size: 2.4rem;
  margin-bottom: 0.2rem;
  transition: var(--sc39-transition-fast);
}

.sc39-bottom-nav-label {
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
}

/* Footer */
.sc39-footer {
  background: linear-gradient(135deg, var(--sc39-dark) 0%, var(--sc39-primary) 100%);
  border-top: 1px solid var(--sc39-border);
  padding: var(--sc39-spacing-lg) 0 var(--sc39-spacing-xl);
  margin-top: var(--sc39-spacing-xl);
}

.sc39-footer-content {
  text-align: center;
}

.sc39-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sc39-spacing-md);
  margin-bottom: var(--sc39-spacing-md);
}

.sc39-footer-link {
  color: var(--sc39-text-secondary);
  text-decoration: none;
  font-size: var(--sc39-font-size-sm);
  transition: color var(--sc39-transition-fast);
}

.sc39-footer-link:hover {
  color: var(--sc39-accent);
}

.sc39-partners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--sc39-spacing-md);
  margin: var(--sc39-spacing-md) 0;
}

.sc39-partner-icon {
  width: 3.2rem;
  height: 3.2rem;
  opacity: 0.7;
  transition: opacity var(--sc39-transition-fast);
}

.sc39-partner-icon:hover {
  opacity: 1;
}

.sc39-copyright {
  color: var(--sc39-text-secondary);
  font-size: var(--sc39-font-size-sm);
  margin-top: var(--sc39-spacing-md);
}

/* Scroll to top button */
.sc39-scroll-top {
  position: fixed;
  bottom: 8rem;
  right: var(--sc39-spacing-sm);
  z-index: 999;
  background: linear-gradient(135deg, var(--sc39-accent) 0%, #6FFF00 100%);
  color: var(--sc39-dark);
  border: none;
  border-radius: 50%;
  width: 4.4rem;
  height: 4.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--sc39-transition-normal);
  box-shadow: 0 4px 15px var(--sc39-shadow);
}

.sc39-scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.sc39-scroll-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--sc39-shadow);
}

/* Utility classes */
.sc39-text-center {
  text-align: center;
}

.sc39-text-left {
  text-align: left;
}

.sc39-text-right {
  text-align: right;
}

.sc39-mb-sm {
  margin-bottom: var(--sc39-spacing-sm);
}

.sc39-mb-md {
  margin-bottom: var(--sc39-spacing-md);
}

.sc39-mb-lg {
  margin-bottom: var(--sc39-spacing-lg);
}

.sc39-mt-sm {
  margin-top: var(--sc39-spacing-sm);
}

.sc39-mt-md {
  margin-top: var(--sc39-spacing-md);
}

.sc39-mt-lg {
  margin-top: var(--sc39-spacing-lg);
}

.sc39-hidden {
  display: none;
}

.sc39-visible {
  display: block;
}

/* Responsive design */
@media (max-width: 768px) {
  .sc39-main {
    padding-bottom: 8rem; /* Space for fixed bottom nav */
  }

  .sc39-game-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sc39-spacing-xs);
  }

  .sc39-game-item {
    min-height: 7rem;
    padding: var(--sc39-spacing-xs);
  }

  .sc39-game-icon {
    width: 2.8rem;
    height: 2.8rem;
  }

  .sc39-game-name {
    font-size: 1rem;
  }
}

@media (min-width: 769px) {
  .sc39-bottom-nav {
    display: none; /* Hide bottom nav on desktop */
  }

  .sc39-main {
    padding-bottom: 0;
  }

  .sc39-scroll-top {
    bottom: var(--sc39-spacing-lg);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --sc39-bg: #000000;
    --sc39-text: #FFFFFF;
    --sc39-border: #FFFFFF;
  }
}

/* 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 */
.sc39-btn:focus,
.sc39-nav-link:focus,
.sc39-bottom-nav-item:focus {
  outline: 2px solid var(--sc39-accent);
  outline-offset: 2px;
}

/* Loading animation */
@keyframes sc39-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.sc39-loading {
  animation: sc39-pulse 1.5s ease-in-out infinite;
}

/* Fade in animation */
@keyframes sc39-fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sc39-fade-in {
  animation: sc39-fadeIn 0.6s ease-out;
}