/**
 * PhilSlot CSS Design System
 * Prefix: ps-
 * Mobile-first responsive design
 */

/* CSS Variables - Color Palette */
:root {
  /* Primary Colors */
  --ps-primary: #FF8000;
  --ps-secondary: #2E4057;
  --ps-accent: #32CD32;
  --ps-warning: #BF360C;
  --ps-light: #F8F9FA;
  --ps-highlight: #FF4500;

  /* Background Colors */
  --ps-bg-primary: #1a1a1a;
  --ps-bg-secondary: #2d2d2d;
  --ps-bg-card: #333333;
  --ps-bg-hover: #404040;

  /* Text Colors */
  --ps-text-primary: #ffffff;
  --ps-text-secondary: #cccccc;
  --ps-text-muted: #999999;
  --ps-text-accent: #FF8000;

  /* Border Colors */
  --ps-border: #444444;
  --ps-border-light: #555555;

  /* Spacing */
  --ps-spacing-xs: 0.4rem;
  --ps-spacing-sm: 0.8rem;
  --ps-spacing-md: 1.2rem;
  --ps-spacing-lg: 1.6rem;
  --ps-spacing-xl: 2rem;
  --ps-spacing-xxl: 2.4rem;

  /* Typography */
  --ps-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --ps-font-size-xs: 1rem;
  --ps-font-size-sm: 1.2rem;
  --ps-font-size-md: 1.4rem;
  --ps-font-size-lg: 1.6rem;
  --ps-font-size-xl: 1.8rem;
  --ps-font-size-xxl: 2.2rem;

  /* Transitions */
  --ps-transition-fast: 0.2s ease;
  --ps-transition-medium: 0.3s ease;
  --ps-transition-slow: 0.5s ease;

  /* Border Radius */
  --ps-radius-sm: 0.4rem;
  --ps-radius-md: 0.8rem;
  --ps-radius-lg: 1.2rem;
  --ps-radius-xl: 1.6rem;

  /* Shadows */
  --ps-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --ps-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.2);
  --ps-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.3);
  --ps-shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.4);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  line-height: 1.5;
  scroll-behavior: smooth;
}

body {
  font-family: var(--ps-font-family);
  font-size: var(--ps-font-size-md);
  color: var(--ps-text-primary);
  background-color: var(--ps-bg-primary);
  line-height: 1.5;
  overflow-x: hidden;
}

/* Typography */
.ps-text-xxl { font-size: var(--ps-font-size-xxl); }
.ps-text-xl { font-size: var(--ps-font-size-xl); }
.ps-text-lg { font-size: var(--ps-font-size-lg); }
.ps-text-md { font-size: var(--ps-font-size-md); }
.ps-text-sm { font-size: var(--ps-font-size-sm); }
.ps-text-xs { font-size: var(--ps-font-size-xs); }

.ps-text-center { text-align: center; }
.ps-text-left { text-align: left; }
.ps-text-right { text-align: right; }

.ps-text-primary { color: var(--ps-text-primary); }
.ps-text-secondary { color: var(--ps-text-secondary); }
.ps-text-muted { color: var(--ps-text-muted); }
.ps-text-accent { color: var(--ps-text-accent); }

/* Layout */
.ps-container {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 var(--ps-spacing-md);
}

.ps-wrapper {
  min-height: 100vh;
  padding-bottom: 8rem;
}

.ps-grid {
  display: grid;
  gap: var(--ps-spacing-md);
}

.ps-flex {
  display: flex;
}

.ps-flex-col {
  flex-direction: column;
}

.ps-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ps-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Spacing */
.ps-m-0 { margin: 0; }
.ps-m-xs { margin: var(--ps-spacing-xs); }
.ps-m-sm { margin: var(--ps-spacing-sm); }
.ps-m-md { margin: var(--ps-spacing-md); }
.ps-m-lg { margin: var(--ps-spacing-lg); }
.ps-m-xl { margin: var(--ps-spacing-xl); }

.ps-mt-0 { margin-top: 0; }
.ps-mt-xs { margin-top: var(--ps-spacing-xs); }
.ps-mt-sm { margin-top: var(--ps-spacing-sm); }
.ps-mt-md { margin-top: var(--ps-spacing-md); }
.ps-mt-lg { margin-top: var(--ps-spacing-lg); }
.ps-mt-xl { margin-top: var(--ps-spacing-xl); }

.ps-mb-0 { margin-bottom: 0; }
.ps-mb-xs { margin-bottom: var(--ps-spacing-xs); }
.ps-mb-sm { margin-bottom: var(--ps-spacing-sm); }
.ps-mb-md { margin-bottom: var(--ps-spacing-md); }
.ps-mb-lg { margin-bottom: var(--ps-spacing-lg); }
.ps-mb-xl { margin-bottom: var(--ps-spacing-xl); }

.ps-p-0 { padding: 0; }
.ps-p-xs { padding: var(--ps-spacing-xs); }
.ps-p-sm { padding: var(--ps-spacing-sm); }
.ps-p-md { padding: var(--ps-spacing-md); }
.ps-p-lg { padding: var(--ps-spacing-lg); }
.ps-p-xl { padding: var(--ps-spacing-xl); }

/* Header */
.ps-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--ps-secondary) 0%, var(--ps-bg-secondary) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ps-border);
  box-shadow: var(--ps-shadow-md);
}

.ps-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ps-spacing-sm) var(--ps-spacing-md);
  min-height: 6rem;
}

.ps-logo {
  display: flex;
  align-items: center;
  gap: var(--ps-spacing-sm);
  text-decoration: none;
  color: var(--ps-text-primary);
}

.ps-logo-icon {
  width: 2.8rem;
  height: 2.8rem;
  background: var(--ps-primary);
  border-radius: var(--ps-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: var(--ps-font-size-sm);
}

.ps-logo-text {
  font-size: var(--ps-font-size-lg);
  font-weight: 700;
  color: var(--ps-text-primary);
  letter-spacing: -0.02em;
}

.ps-header-actions {
  display: flex;
  align-items: center;
  gap: var(--ps-spacing-sm);
}

.ps-header-btn {
  padding: var(--ps-spacing-sm) var(--ps-spacing-md);
  border: none;
  border-radius: var(--ps-radius-md);
  font-size: var(--ps-font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ps-transition-fast);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.4rem;
  min-width: 8rem;
}

.ps-btn-register {
  background: linear-gradient(135deg, var(--ps-primary) 0%, var(--ps-highlight) 100%);
  color: white;
  box-shadow: var(--ps-shadow-sm);
}

.ps-btn-register:hover {
  transform: translateY(-2px);
  box-shadow: var(--ps-shadow-md);
}

.ps-btn-login {
  background: transparent;
  color: var(--ps-text-primary);
  border: 2px solid var(--ps-primary);
}

.ps-btn-login:hover {
  background: var(--ps-primary);
  color: white;
}

.ps-menu-btn {
  background: none;
  border: none;
  color: var(--ps-text-primary);
  font-size: 2.4rem;
  cursor: pointer;
  padding: var(--ps-spacing-xs);
  border-radius: var(--ps-radius-sm);
  transition: all var(--ps-transition-fast);
}

.ps-menu-btn:hover {
  background: var(--ps-bg-hover);
}

/* Mobile Menu */
.ps-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: var(--ps-bg-secondary);
  z-index: 9999;
  transition: right var(--ps-transition-medium);
  overflow-y: auto;
  border-left: 1px solid var(--ps-border);
}

.ps-mobile-menu.active {
  right: 0;
}

.ps-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all var(--ps-transition-medium);
}

.ps-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.ps-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ps-spacing-lg);
  border-bottom: 1px solid var(--ps-border);
}

.ps-menu-close {
  background: none;
  border: none;
  color: var(--ps-text-primary);
  font-size: 2.4rem;
  cursor: pointer;
  padding: var(--ps-spacing-xs);
  border-radius: var(--ps-radius-sm);
  transition: all var(--ps-transition-fast);
}

.ps-menu-close:hover {
  background: var(--ps-bg-hover);
}

.ps-menu-nav {
  padding: var(--ps-spacing-md);
}

.ps-menu-item {
  display: block;
  padding: var(--ps-spacing-md);
  color: var(--ps-text-primary);
  text-decoration: none;
  border-radius: var(--ps-radius-md);
  transition: all var(--ps-transition-fast);
  margin-bottom: var(--ps-spacing-xs);
}

.ps-menu-item:hover {
  background: var(--ps-bg-hover);
  color: var(--ps-text-accent);
}

/* Main Content */
.ps-main {
  padding-top: 8rem;
  min-height: 100vh;
}

/* Carousel */
.ps-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--ps-radius-lg);
  margin-bottom: var(--ps-spacing-xl);
  box-shadow: var(--ps-shadow-lg);
}

.ps-carousel-container {
  display: flex;
  transition: transform var(--ps-transition-medium);
}

.ps-carousel-slide {
  min-width: 100%;
  position: relative;
  cursor: pointer;
}

.ps-carousel-slide img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--ps-radius-lg);
}

.ps-carousel-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--ps-spacing-lg);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  border-radius: var(--ps-radius-lg);
}

.ps-carousel-title {
  font-size: var(--ps-font-size-xl);
  font-weight: 700;
  color: white;
  margin-bottom: var(--ps-spacing-xs);
}

.ps-carousel-desc {
  font-size: var(--ps-font-size-sm);
  color: var(--ps-text-secondary);
  margin-bottom: var(--ps-spacing-md);
}

.ps-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  transition: all var(--ps-transition-fast);
}

.ps-carousel-nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

.ps-carousel-prev {
  left: var(--ps-spacing-md);
}

.ps-carousel-next {
  right: var(--ps-spacing-md);
}

.ps-carousel-indicators {
  display: flex;
  justify-content: center;
  gap: var(--ps-spacing-xs);
  padding: var(--ps-spacing-md);
}

.ps-carousel-indicator {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--ps-border);
  cursor: pointer;
  transition: all var(--ps-transition-fast);
}

.ps-carousel-indicator.active {
  background: var(--ps-primary);
  transform: scale(1.2);
}

/* Buttons */
.ps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--ps-spacing-sm) var(--ps-spacing-lg);
  border: none;
  border-radius: var(--ps-radius-md);
  font-size: var(--ps-font-size-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ps-transition-fast);
  text-decoration: none;
  min-height: 4.4rem;
  min-width: 12rem;
}

.ps-btn-primary {
  background: linear-gradient(135deg, var(--ps-primary) 0%, var(--ps-highlight) 100%);
  color: white;
  box-shadow: var(--ps-shadow-sm);
}

.ps-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--ps-shadow-md);
}

.ps-btn-secondary {
  background: transparent;
  color: var(--ps-text-primary);
  border: 2px solid var(--ps-primary);
}

.ps-btn-secondary:hover {
  background: var(--ps-primary);
  color: white;
}

/* Cards */
.ps-card {
  background: var(--ps-bg-card);
  border-radius: var(--ps-radius-lg);
  padding: var(--ps-spacing-lg);
  border: 1px solid var(--ps-border);
  box-shadow: var(--ps-shadow-sm);
  transition: all var(--ps-transition-fast);
}

.ps-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ps-shadow-md);
}

/* Game Grid */
.ps-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: var(--ps-spacing-sm);
  margin-bottom: var(--ps-spacing-xl);
}

.ps-game-item {
  background: var(--ps-bg-card);
  border-radius: var(--ps-radius-md);
  padding: var(--ps-spacing-sm);
  text-align: center;
  cursor: pointer;
  transition: all var(--ps-transition-fast);
  border: 1px solid var(--ps-border);
}

.ps-game-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--ps-shadow-md);
  border-color: var(--ps-primary);
}

.ps-game-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto var(--ps-spacing-xs);
  border-radius: var(--ps-radius-sm);
  overflow: hidden;
}

.ps-game-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ps-game-name {
  font-size: var(--ps-font-size-xs);
  color: var(--ps-text-primary);
  line-height: 1.3;
  font-weight: 500;
}

/* Filter Buttons */
.ps-filter-container {
  display: flex;
  gap: var(--ps-spacing-sm);
  margin-bottom: var(--ps-spacing-lg);
  overflow-x: auto;
  padding-bottom: var(--ps-spacing-xs);
}

.ps-filter-btn {
  padding: var(--ps-spacing-sm) var(--ps-spacing-md);
  border: 2px solid var(--ps-border);
  background: transparent;
  color: var(--ps-text-secondary);
  border-radius: var(--ps-radius-md);
  font-size: var(--ps-font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--ps-transition-fast);
  white-space: nowrap;
  min-height: 4rem;
}

.ps-filter-btn:hover,
.ps-filter-btn.active {
  border-color: var(--ps-primary);
  color: var(--ps-primary);
  background: rgba(255, 128, 0, 0.1);
}

/* Sections */
.ps-section {
  margin-bottom: var(--ps-spacing-xxl);
}

.ps-section-title {
  font-size: var(--ps-font-size-xl);
  font-weight: 700;
  color: var(--ps-text-primary);
  margin-bottom: var(--ps-spacing-lg);
  text-align: center;
}

.ps-section-subtitle {
  font-size: var(--ps-font-size-lg);
  font-weight: 600;
  color: var(--ps-text-secondary);
  margin-bottom: var(--ps-spacing-md);
}

/* Footer */
.ps-footer {
  background: var(--ps-bg-secondary);
  border-top: 1px solid var(--ps-border);
  padding: var(--ps-spacing-xl) 0 var(--ps-spacing-xxl);
  margin-top: var(--ps-spacing-xxl);
}

.ps-partners {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-spacing-md);
  justify-content: center;
  margin-bottom: var(--ps-spacing-lg);
}

.ps-partner-item {
  width: 6rem;
  height: 3rem;
  background: var(--ps-bg-card);
  border-radius: var(--ps-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ps-spacing-xs);
  border: 1px solid var(--ps-border);
}

.ps-partner-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: brightness(0.8);
}

.ps-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ps-spacing-md);
  justify-content: center;
  margin-bottom: var(--ps-spacing-lg);
}

.ps-footer-link {
  color: var(--ps-text-secondary);
  text-decoration: none;
  font-size: var(--ps-font-size-sm);
  transition: color var(--ps-transition-fast);
}

.ps-footer-link:hover {
  color: var(--ps-text-accent);
}

.ps-footer-copyright {
  text-align: center;
  color: var(--ps-text-muted);
  font-size: var(--ps-font-size-xs);
  margin-top: var(--ps-spacing-lg);
}

/* Bottom Navigation */
.ps-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--ps-secondary) 0%, var(--ps-bg-secondary) 100%);
  border-top: 1px solid var(--ps-border);
  backdrop-filter: blur(10px);
  padding: var(--ps-spacing-xs) 0;
  box-shadow: var(--ps-shadow-lg);
}

.ps-bottom-nav-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 430px;
  margin: 0 auto;
}

.ps-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 6rem;
  min-height: 5.6rem;
  padding: var(--ps-spacing-xs);
  color: var(--ps-text-secondary);
  text-decoration: none;
  border-radius: var(--ps-radius-md);
  transition: all var(--ps-transition-fast);
  cursor: pointer;
}

.ps-bottom-nav-item:hover,
.ps-bottom-nav-item.active {
  color: var(--ps-primary);
  background: rgba(255, 128, 0, 0.1);
  transform: translateY(-2px);
}

.ps-bottom-nav-icon {
  font-size: 2.4rem;
  margin-bottom: var(--ps-spacing-xs);
  transition: all var(--ps-transition-fast);
}

.ps-bottom-nav-item:hover .ps-bottom-nav-icon,
.ps-bottom-nav-item.active .ps-bottom-nav-icon {
  transform: scale(1.1);
}

.ps-bottom-nav-text {
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

/* Responsive Design */
@media (min-width: 769px) {
  .ps-bottom-nav {
    display: none;
  }

  .ps-wrapper {
    padding-bottom: 0;
  }

  .ps-container {
    max-width: 1200px;
  }

  .ps-game-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

@media (max-width: 768px) {
  .ps-main {
    padding-bottom: 8rem;
  }
}

/* Utility Classes */
.ps-hidden { display: none; }
.ps-visible { display: block; }
.ps-invisible { visibility: hidden; }

.ps-text-uppercase { text-transform: uppercase; }
.ps-text-capitalize { text-transform: capitalize; }

.ps-fw-bold { font-weight: 700; }
.ps-fw-semibold { font-weight: 600; }
.ps-fw-medium { font-weight: 500; }
.ps-fw-normal { font-weight: 400; }

.ps-rounded-sm { border-radius: var(--ps-radius-sm); }
.ps-rounded-md { border-radius: var(--ps-radius-md); }
.ps-rounded-lg { border-radius: var(--ps-radius-lg); }
.ps-rounded-xl { border-radius: var(--ps-radius-xl); }

.ps-shadow-sm { box-shadow: var(--ps-shadow-sm); }
.ps-shadow-md { box-shadow: var(--ps-shadow-md); }
.ps-shadow-lg { box-shadow: var(--ps-shadow-lg); }
.ps-shadow-xl { box-shadow: var(--ps-shadow-xl); }

/* Animations */
@keyframes psFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes psSlideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes psScaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.ps-animate-fade-in {
  animation: psFadeIn 0.5s ease-out;
}

.ps-animate-slide-in {
  animation: psSlideIn 0.3s ease-out;
}

.ps-animate-scale-in {
  animation: psScaleIn 0.3s ease-out;
}

/* Loading States */
.ps-loading {
  position: relative;
  pointer-events: none;
}

.ps-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: 2px solid var(--ps-border);
  border-top: 2px solid var(--ps-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}