/**
 * PHLWIN PH Design System - CSS Framework
 * All classes use vbf4- prefix for namespace isolation
 */

/* CSS Variables */
:root {
  --vbf4-primary: #191970;
  --vbf4-secondary: #DA70D6;
  --vbf4-accent: #9400D3;
  --vbf4-success: #00FF7F;
  --vbf4-bg: #0A0A0A;
  --vbf4-surface: #1a1a1a;
  --vbf4-card-bg: #242424;
  --vbf4-text-primary: #ffffff;
  --vbf4-text-secondary: #b0b0b0;
  --vbf4-text-muted: #808080;
  --vbf4-border: #333333;
  --vbf4-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --vbf4-shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --vbf4-gradient-primary: linear-gradient(135deg, var(--vbf4-primary), var(--vbf4-accent));
  --vbf4-gradient-secondary: linear-gradient(135deg, var(--vbf4-secondary), var(--vbf4-accent));
  --vbf4-gradient-success: linear-gradient(135deg, var(--vbf4-success), #32CD32);
  --vbf4-border-radius: 8px;
  --vbf4-border-radius-lg: 12px;
  --vbf4-transition: all 0.3s ease;
  --vbf4-header-height: 60px;
  --vbf4-mobile-nav-height: 56px;
  --vh: 1vh;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.4rem;
  line-height: 1.5;
  color: var(--vbf4-text-primary);
  background: var(--vbf4-bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--vbf4-transition);
}

button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  outline: none;
  transition: var(--vbf4-transition);
}

ul, ol {
  list-style: none;
}

/* Loading Screen */
.vbf4-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--vbf4-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.vbf4-loading::before {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid var(--vbf4-border);
  border-top: 3px solid var(--vbf4-primary);
  border-radius: 50%;
  animation: vbf4-spin 1s linear infinite;
}

@keyframes vbf4-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Container and Layout */
.vbf4-container {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 16px;
}

.vbf4-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.vbf4-main {
  flex: 1;
  padding-top: var(--vbf4-header-height);
  padding-bottom: var(--vbf4-mobile-nav-height);
}

/* Header */
.vbf4-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--vbf4-header-height);
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--vbf4-border);
  z-index: 1000;
  transition: transform 0.3s ease;
}

.vbf4-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
}

.vbf4-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--vbf4-text-primary);
}

.vbf4-logo img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.vbf4-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vbf4-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--vbf4-text-primary);
  border-radius: var(--vbf4-border-radius);
  transition: var(--vbf4-transition);
}

.vbf4-menu-toggle:hover {
  background: var(--vbf4-surface);
}

/* Mobile Navigation */
.vbf4-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transition: var(--vbf4-transition);
}

.vbf4-nav-overlay.vbf4-active {
  opacity: 1;
  visibility: visible;
}

.vbf4-mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100%;
  background: var(--vbf4-surface);
  z-index: 1600;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  border-left: 1px solid var(--vbf4-border);
}

.vbf4-mobile-nav.vbf4-active {
  right: 0;
}

.vbf4-mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--vbf4-border);
}

.vbf4-nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--vbf4-text-primary);
  border-radius: var(--vbf4-border-radius);
  transition: var(--vbf4-transition);
}

.vbf4-nav-close:hover {
  background: var(--vbf4-card-bg);
}

.vbf4-nav-menu {
  flex: 1;
  padding: 16px 0;
}

.vbf4-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--vbf4-text-primary);
  font-size: 1.4rem;
  transition: var(--vbf4-transition);
}

.vbf4-nav-link:hover {
  background: var(--vbf4-card-bg);
  color: var(--vbf4-primary);
}

/* Buttons */
.vbf4-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--vbf4-border-radius);
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
  border: 2px solid transparent;
  transition: var(--vbf4-transition);
  cursor: pointer;
  min-height: 44px;
  white-space: nowrap;
}

.vbf4-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--vbf4-shadow);
}

.vbf4-btn:active {
  transform: translateY(0);
}

.vbf4-btn-sm {
  padding: 6px 12px;
  font-size: 1.2rem;
  min-height: 36px;
}

.vbf4-btn-lg {
  padding: 14px 24px;
  font-size: 1.5rem;
  min-height: 52px;
}

.vbf4-btn-primary {
  background: var(--vbf4-gradient-primary);
  color: white;
}

.vbf4-btn-secondary {
  background: var(--vbf4-gradient-secondary);
  color: white;
}

.vbf4-btn-accent {
  background: var(--vbf4-gradient-success);
  color: var(--vbf4-bg);
}

.vbf4-btn-outline {
  background: transparent;
  border-color: var(--vbf4-primary);
  color: var(--vbf4-primary);
}

.vbf4-btn-outline:hover {
  background: var(--vbf4-primary);
  color: white;
}

/* Cards */
.vbf4-card {
  background: var(--vbf4-card-bg);
  border-radius: var(--vbf4-border-radius-lg);
  padding: 20px;
  border: 1px solid var(--vbf4-border);
  transition: var(--vbf4-transition);
}

.vbf4-card:hover {
  border-color: var(--vbf4-primary);
  box-shadow: var(--vbf4-shadow);
}

/* Hero Section */
.vbf4-hero {
  padding: 32px 0;
  background: var(--vbf4-gradient-primary);
  position: relative;
  overflow: hidden;
}

.vbf4-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="none"><path d="M0,0 C150,100 350,0 500,50 C650,100 850,0 1000,50 L1000,0 Z" fill="rgba(255,255,255,0.1)"/></svg>') repeat-x;
  background-size: 1000px 100px;
  animation: vbf4-wave 10s linear infinite;
}

@keyframes vbf4-wave {
  0% { background-position-x: 0; }
  100% { background-position-x: 1000px; }
}

.vbf4-hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

.vbf4-hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: white;
  margin-bottom: 16px;
  line-height: 1.2;
}

.vbf4-hero-text {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 24px;
  line-height: 1.4;
}

.vbf4-hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Slider */
.vbf4-slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--vbf4-border-radius-lg);
  margin-bottom: 24px;
  aspect-ratio: 16/9;
}

.vbf4-slider-track {
  display: flex;
  transition: transform 0.5s ease;
}

.vbf4-slider-item {
  min-width: 100%;
  position: relative;
  cursor: pointer;
}

.vbf4-slider-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vbf4-slider-indicators {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.vbf4-slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--vbf4-transition);
}

.vbf4-slider-dot.vbf4-active {
  background: var(--vbf4-success);
}

/* Section */
.vbf4-section {
  padding: 32px 0;
}

.vbf4-section-alt {
  background: var(--vbf4-surface);
}

.vbf4-section-title {
  font-size: 2.0rem;
  font-weight: 700;
  color: var(--vbf4-text-primary);
  margin-bottom: 20px;
  text-align: center;
}

/* Game Grid */
.vbf4-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.vbf4-game-card {
  background: var(--vbf4-card-bg);
  border-radius: var(--vbf4-border-radius);
  padding: 8px;
  text-align: center;
  border: 1px solid var(--vbf4-border);
  transition: var(--vbf4-transition);
  cursor: pointer;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.vbf4-game-card:hover,
.vbf4-game-card.vbf4-touching {
  border-color: var(--vbf4-primary);
  transform: translateY(-2px);
  box-shadow: var(--vbf4-shadow);
}

.vbf4-game-img {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  margin: 0 auto 4px;
}

.vbf4-game-name {
  font-size: 1.0rem;
  font-weight: 600;
  color: var(--vbf4-text-primary);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: 100%;
}

/* Stats Grid */
.vbf4-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.vbf4-stat-card {
  background: var(--vbf4-card-bg);
  border-radius: var(--vbf4-border-radius);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--vbf4-border);
}

.vbf4-stat-value {
  font-size: 2.0rem;
  font-weight: 700;
  color: var(--vbf4-success);
  margin-bottom: 4px;
}

.vbf4-stat-label {
  font-size: 1.2rem;
  color: var(--vbf4-text-secondary);
}

/* Feature List */
.vbf4-feature-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vbf4-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--vbf4-card-bg);
  border-radius: var(--vbf4-border-radius);
  border: 1px solid var(--vbf4-border);
}

.vbf4-feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--vbf4-gradient-primary);
  border-radius: 50%;
  color: white;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.vbf4-feature-content h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--vbf4-text-primary);
  margin-bottom: 4px;
}

.vbf4-feature-content p {
  font-size: 1.3rem;
  color: var(--vbf4-text-secondary);
  line-height: 1.4;
}

/* Bottom Navigation */
.vbf4-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--vbf4-mobile-nav-height);
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--vbf4-border);
  z-index: 1000;
}

.vbf4-bottom-nav-content {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 8px;
}

.vbf4-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 8px;
  color: var(--vbf4-text-secondary);
  font-size: 1.0rem;
  transition: var(--vbf4-transition);
  min-width: 60px;
  border-radius: 6px;
}

.vbf4-bottom-nav-item:hover,
.vbf4-bottom-nav-item.vbf4-active {
  color: var(--vbf4-primary);
  background: rgba(25, 25, 112, 0.1);
}

.vbf4-bottom-nav-icon {
  font-size: 2.0rem;
  margin-bottom: 2px;
}

.vbf4-bottom-nav-text {
  font-size: 1.0rem;
  font-weight: 500;
}

/* Footer */
.vbf4-footer {
  background: var(--vbf4-surface);
  padding: 24px 0;
  border-top: 1px solid var(--vbf4-border);
}

.vbf4-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.vbf4-footer-link {
  font-size: 1.2rem;
  color: var(--vbf4-text-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--vbf4-transition);
}

.vbf4-footer-link:hover {
  color: var(--vbf4-primary);
  background: rgba(25, 25, 112, 0.1);
}

.vbf4-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.vbf4-partner {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  opacity: 0.6;
  transition: var(--vbf4-transition);
}

.vbf4-partner:hover {
  opacity: 1;
  transform: scale(1.05);
}

.vbf4-footer-copyright {
  text-align: center;
  font-size: 1.2rem;
  color: var(--vbf4-text-muted);
  line-height: 1.4;
}

/* Utility Classes */
.vbf4-text-center { text-align: center; }
.vbf4-text-left { text-align: left; }
.vbf4-text-right { text-align: right; }

.vbf4-mb-1 { margin-bottom: 8px; }
.vbf4-mb-2 { margin-bottom: 16px; }
.vbf4-mb-3 { margin-bottom: 24px; }
.vbf4-mb-4 { margin-bottom: 32px; }

.vbf4-mt-1 { margin-top: 8px; }
.vbf4-mt-2 { margin-top: 16px; }
.vbf4-mt-3 { margin-top: 24px; }
.vbf4-mt-4 { margin-top: 32px; }

.vbf4-p-1 { padding: 8px; }
.vbf4-p-2 { padding: 16px; }
.vbf4-p-3 { padding: 24px; }
.vbf4-p-4 { padding: 32px; }

.vbf4-rounded { border-radius: var(--vbf4-border-radius); }
.vbf4-rounded-lg { border-radius: var(--vbf4-border-radius-lg); }

.vbf4-shadow { box-shadow: var(--vbf4-shadow); }
.vbf4-shadow-lg { box-shadow: var(--vbf4-shadow-lg); }

/* Responsive Design */
@media (min-width: 480px) {
  .vbf4-container {
    padding: 0 20px;
  }
  
  .vbf4-hero-title {
    font-size: 2.8rem;
  }
  
  .vbf4-games-grid {
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 16px;
  }
  
  .vbf4-game-img {
    width: 56px;
    height: 56px;
  }
  
  .vbf4-game-name {
    font-size: 1.1rem;
  }
}

/* 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 */
:focus-visible {
  outline: 2px solid var(--vbf4-success);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --vbf4-border: #666666;
    --vbf4-text-secondary: #cccccc;
  }
}