/* PH 799 App Styles - Mobile First Design */
/* All classes use pg30- prefix to avoid conflicts */

/* CSS Variables */
:root {
  --pg30-primary: #F0FDFF;
  --pg30-bg: #1A1A2E;
  --pg30-text: #F0FDFF;
  --pg30-secondary: #16213E;
  --pg30-accent: #3498DB;
  --pg30-success: #27AE60;
  --pg30-warning: #F39C12;
  --pg30-danger: #E74C3C;
  --pg30-header-height: 60px;
  --pg30-bottom-nav-height: 64px;
  --pg30-border-radius: 8px;
  --pg30-shadow: 0 2px 10px rgba(240, 253, 255, 0.1);
  --pg30-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --vh: 1vh;
}

/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 1.4rem;
  line-height: 1.5;
  color: var(--pg30-text);
  background-color: var(--pg30-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Layout Components */
.pg30-wrapper {
  min-height: 100vh;
  min-height: calc(var(--vh, 1vh) * 100);
  display: flex;
  flex-direction: column;
}

.pg30-container {
  max-width: 430px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.6rem;
}

.pg30-main {
  flex: 1;
  padding-top: var(--pg30-header-height);
  padding-bottom: calc(var(--pg30-bottom-nav-height) + 2rem);
}

/* Header Styles */
.pg30-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--pg30-header-height);
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pg30-secondary);
  z-index: 1000;
  transition: var(--pg30-transition);
}

.pg30-header-scrolled {
  background: rgba(26, 26, 46, 0.98);
  box-shadow: var(--pg30-shadow);
}

.pg30-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1.6rem;
}

.pg30-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--pg30-text);
  font-weight: 700;
  font-size: 1.8rem;
}

.pg30-logo img {
  width: 32px;
  height: 32px;
  margin-right: 0.8rem;
  border-radius: 6px;
}

.pg30-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.pg30-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.8rem 1.2rem;
  border: none;
  border-radius: var(--pg30-border-radius);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--pg30-transition);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.pg30-btn:focus {
  outline: 2px solid var(--pg30-accent);
  outline-offset: 2px;
}

.pg30-btn-primary {
  background: var(--pg30-success);
  color: #ffffff;
}

.pg30-btn-primary:hover, .pg30-btn-primary:focus {
  background: #219A52;
  transform: translateY(-1px);
}

.pg30-btn-secondary {
  background: var(--pg30-accent);
  color: #ffffff;
}

.pg30-btn-secondary:hover, .pg30-btn-secondary:focus {
  background: #2980B9;
  transform: translateY(-1px);
}

.pg30-btn i {
  margin-right: 0.4rem;
  font-size: 1.2rem;
}

/* Mobile Menu Button */
.pg30-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 0.8rem;
}

.pg30-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--pg30-text);
  margin: 2px 0;
  transition: var(--pg30-transition);
  transform-origin: center;
}

.pg30-menu-btn-active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.pg30-menu-btn-active span:nth-child(2) {
  opacity: 0;
}

.pg30-menu-btn-active span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Navigation Menu */
.pg30-nav-menu {
  position: fixed;
  top: var(--pg30-header-height);
  left: 0;
  right: 0;
  background: rgba(26, 26, 46, 0.98);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--pg30-secondary);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
  z-index: 999;
}

.pg30-menu-active {
  max-height: 500px;
}

.pg30-nav-menu a {
  display: flex;
  align-items: center;
  padding: 1.2rem 1.6rem;
  color: var(--pg30-text);
  text-decoration: none;
  border-bottom: 1px solid rgba(240, 253, 255, 0.1);
  transition: var(--pg30-transition);
}

.pg30-nav-menu a:hover {
  background: rgba(240, 253, 255, 0.05);
  padding-left: 2rem;
}

.pg30-nav-menu a i {
  margin-right: 1rem;
  width: 20px;
  font-size: 1.6rem;
  color: var(--pg30-accent);
}

/* Cards */
.pg30-card {
  background: var(--pg30-secondary);
  border-radius: var(--pg30-border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--pg30-shadow);
  border: 1px solid rgba(240, 253, 255, 0.1);
}

.pg30-card-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  color: var(--pg30-text);
  line-height: 1.3;
}

.pg30-card-content {
  font-size: 1.4rem;
  line-height: 1.6;
  color: rgba(240, 253, 255, 0.9);
}

/* Carousel */
.pg30-carousel {
  position: relative;
  width: 100%;
  height: 200px;
  border-radius: var(--pg30-border-radius);
  overflow: hidden;
  margin: 2rem 0;
}

.pg30-carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  cursor: pointer;
}

.pg30-carousel-item.pg30-active {
  opacity: 1;
}

.pg30-carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pg30-carousel-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.8rem;
}

.pg30-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--pg30-transition);
}

.pg30-carousel-dot.pg30-active {
  background: var(--pg30-accent);
  transform: scale(1.2);
}

/* Game Grid */
.pg30-games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.pg30-game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--pg30-text);
  padding: 1rem;
  border-radius: var(--pg30-border-radius);
  background: rgba(240, 253, 255, 0.02);
  border: 1px solid rgba(240, 253, 255, 0.1);
  transition: var(--pg30-transition);
  min-height: 100px;
}

.pg30-game-item:hover, .pg30-game-item:focus {
  background: rgba(240, 253, 255, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(240, 253, 255, 0.1);
}

.pg30-game-img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  margin-bottom: 0.8rem;
  object-fit: cover;
}

.pg30-game-name {
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Game Categories */
.pg30-game-category {
  margin: 3rem 0;
}

.pg30-category-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--pg30-text);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.pg30-category-title i {
  color: var(--pg30-accent);
  font-size: 2rem;
}

/* Statistics Grid */
.pg30-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.pg30-stat-item {
  background: rgba(240, 253, 255, 0.02);
  border: 1px solid rgba(240, 253, 255, 0.1);
  border-radius: var(--pg30-border-radius);
  padding: 2rem;
  text-align: center;
}

.pg30-stat-number {
  display: block;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--pg30-accent);
  line-height: 1.2;
}

.pg30-stat-label {
  font-size: 1.2rem;
  color: rgba(240, 253, 255, 0.8);
  margin-top: 0.5rem;
}

/* Features Grid */
.pg30-features-grid {
  display: grid;
  gap: 2rem;
  margin: 2rem 0;
}

.pg30-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem;
  background: rgba(240, 253, 255, 0.02);
  border: 1px solid rgba(240, 253, 255, 0.1);
  border-radius: var(--pg30-border-radius);
}

.pg30-feature-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--pg30-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 2rem;
}

.pg30-feature-content h3 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: var(--pg30-text);
}

.pg30-feature-content p {
  font-size: 1.3rem;
  line-height: 1.5;
  color: rgba(240, 253, 255, 0.8);
}

/* Footer */
.pg30-footer {
  background: var(--pg30-secondary);
  border-top: 1px solid rgba(240, 253, 255, 0.1);
  padding: 3rem 0 calc(var(--pg30-bottom-nav-height) + 2rem);
  margin-top: 4rem;
}

.pg30-footer-content {
  text-align: center;
}

.pg30-footer-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--pg30-text);
}

.pg30-footer-desc {
  font-size: 1.3rem;
  line-height: 1.6;
  color: rgba(240, 253, 255, 0.8);
  margin-bottom: 2rem;
}

.pg30-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}

.pg30-footer-links a,
.pg30-footer-links button {
  padding: 0.8rem 1.2rem;
  background: rgba(240, 253, 255, 0.05);
  border: 1px solid rgba(240, 253, 255, 0.1);
  border-radius: var(--pg30-border-radius);
  color: var(--pg30-text);
  text-decoration: none;
  font-size: 1.2rem;
  transition: var(--pg30-transition);
  cursor: pointer;
}

.pg30-footer-links a:hover,
.pg30-footer-links button:hover {
  background: rgba(240, 253, 255, 0.1);
  transform: translateY(-1px);
}

.pg30-partners {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin: 2rem 0;
  padding: 2rem;
  background: rgba(240, 253, 255, 0.02);
  border-radius: var(--pg30-border-radius);
}

.pg30-partner-logo {
  width: 100%;
  height: 40px;
  object-fit: contain;
  opacity: 0.6;
  transition: var(--pg30-transition);
}

.pg30-partner-logo:hover {
  opacity: 1;
}

.pg30-copyright {
  font-size: 1.1rem;
  color: rgba(240, 253, 255, 0.6);
  margin-top: 2rem;
}

/* Bottom Navigation */
.pg30-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--pg30-bottom-nav-height);
  background: rgba(26, 26, 46, 0.98);
  backdrop-filter: blur(15px);
  border-top: 1px solid var(--pg30-secondary);
  display: flex;
  z-index: 1000;
}

.pg30-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(240, 253, 255, 0.6);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: var(--pg30-transition);
  min-height: 44px;
  padding: 0.5rem;
}

.pg30-bottom-nav-item:hover,
.pg30-bottom-nav-item.pg30-active {
  color: var(--pg30-accent);
  background: rgba(52, 152, 219, 0.1);
}

.pg30-bottom-nav-item i,
.pg30-bottom-nav-item ion-icon {
  font-size: 2rem;
  margin-bottom: 0.2rem;
}

.pg30-bottom-nav-item span {
  font-size: 1rem;
  line-height: 1;
}

/* Utility Classes */
.pg30-text-center { text-align: center; }
.pg30-text-left { text-align: left; }
.pg30-text-right { text-align: right; }

.pg30-mt-1 { margin-top: 1rem; }
.pg30-mt-2 { margin-top: 2rem; }
.pg30-mb-1 { margin-bottom: 1rem; }
.pg30-mb-2 { margin-bottom: 2rem; }

.pg30-hidden { display: none; }
.pg30-visible { display: block; }

/* Error States */
.pg30-error {
  border-color: var(--pg30-danger) !important;
  background: rgba(231, 76, 60, 0.1) !important;
}

/* Loading States */
.pg30-loading {
  position: relative;
  pointer-events: none;
}

.pg30-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid var(--pg30-accent);
  border-radius: 50%;
  animation: pg30-spin 1s linear infinite;
}

@keyframes pg30-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Lazy Loading */
.pg30-lazy {
  opacity: 0;
  transition: opacity 0.3s;
}

/* Touch Device Optimizations */
.pg30-touch-device .pg30-btn:hover {
  transform: none;
}

.pg30-touch-device .pg30-game-item:hover {
  transform: none;
}

/* Responsive Design */
@media (max-width: 374px) {
  .pg30-container {
    padding: 0 1.2rem;
  }
  
  .pg30-games-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .pg30-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 375px) {
  .pg30-partners {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 430px) {
  .pg30-container {
    padding: 0 2rem;
  }
  
  .pg30-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Print Styles */
@media print {
  .pg30-header,
  .pg30-bottom-nav,
  .pg30-nav-menu {
    display: none;
  }
  
  .pg30-main {
    padding-top: 0;
    padding-bottom: 0;
  }
}