/**
 * PPSSPP - Main Stylesheet
 * All classes use 'va7e-' prefix for namespace isolation
 * Mobile-first responsive design with max-width 430px
 */

/* CSS Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color palette from requirements */
  --va7e-primary: #6F4E37;
  --va7e-secondary: #FFE4B5;
  --va7e-dark: #2C3E50;
  --va7e-accent: #4DB6AC;
  --va7e-rose: #BC8F8F;

  /* Semantic colors */
  --va7e-bg-primary: #2C3E50;
  --va7e-bg-secondary: #34495E;
  --va7e-bg-card: #3D566E;
  --va7e-text-primary: #FFE4B5;
  --va7e-text-secondary: #E8D4B0;
  --va7e-text-muted: #BC8F8F;
  --va7e-border: #4DB6AC;
  --va7e-success: #4DB6AC;
  --va7e-warning: #FFE4B5;
  --va7e-danger: #E74C3C;

  /* Spacing */
  --va7e-spacing-xs: 0.25rem;
  --va7e-spacing-sm: 0.5rem;
  --va7e-spacing-md: 1rem;
  --va7e-spacing-lg: 1.5rem;
  --va7e-spacing-xl: 2rem;

  /* Typography */
  --va7e-font-size-xs: 0.75rem;
  --va7e-font-size-sm: 0.875rem;
  --va7e-font-size-base: 1rem;
  --va7e-font-size-lg: 1.125rem;
  --va7e-font-size-xl: 1.25rem;
  --va7e-font-size-2xl: 1.5rem;
  --va7e-font-size-3xl: 2rem;

  /* Z-index layers */
  --va7e-z-header: 1000;
  --va7e-z-bottom-nav: 1000;
  --va7e-z-mobile-menu: 9999;
  --va7e-z-modal: 10000;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--va7e-text-primary);
  background-color: var(--va7e-bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

body.va7e-loaded {
  opacity: 1;
}

/* Container & Layout */
.va7e-container {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 var(--va7e-spacing-md);
}

.va7e-wrapper {
  min-height: 100vh;
  padding-bottom: 80px; /* Space for bottom nav on mobile */
}

/* Header Styles */
.va7e-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--va7e-z-header);
  background: linear-gradient(135deg, var(--va7e-primary) 0%, var(--va7e-dark) 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.va7e-header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--va7e-spacing-sm) var(--va7e-spacing-md);
  max-width: 430px;
  margin: 0 auto;
}

.va7e-logo {
  display: flex;
  align-items: center;
  gap: var(--va7e-spacing-sm);
  text-decoration: none;
  color: var(--va7e-text-primary);
}

.va7e-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.va7e-logo-text {
  font-size: var(--va7e-font-size-lg);
  font-weight: 700;
  color: var(--va7e-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.va7e-header-buttons {
  display: flex;
  gap: var(--va7e-spacing-sm);
}

.va7e-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 20px;
  font-size: var(--va7e-font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.va7e-btn-primary {
  background: linear-gradient(135deg, var(--va7e-accent) 0%, #3DA89B 100%);
  color: var(--va7e-dark);
}

.va7e-btn-secondary {
  background: transparent;
  color: var(--va7e-secondary);
  border: 2px solid var(--va7e-secondary);
}

.va7e-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(77, 182, 172, 0.4);
}

.va7e-menu-button {
  background: none;
  border: none;
  color: var(--va7e-text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--va7e-spacing-xs);
  display: none;
}

/* Mobile Menu */
.va7e-mobile-menu {
  position: fixed;
  top: 60px;
  left: -100%;
  width: 100%;
  height: calc(100vh - 60px);
  background: var(--va7e-bg-secondary);
  z-index: var(--va7e-z-mobile-menu);
  transition: left 0.3s ease;
  overflow-y: auto;
  padding: var(--va7e-spacing-lg);
}

.va7e-mobile-menu.va7e-menu-open {
  left: 0;
}

.va7e-menu-open {
  overflow: hidden;
}

.va7e-menu-list {
  list-style: none;
}

.va7e-menu-item {
  margin-bottom: var(--va7e-spacing-md);
}

.va7e-menu-link {
  display: block;
  padding: var(--va7e-spacing-md);
  color: var(--va7e-text-primary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: var(--va7e-font-size-base);
  font-weight: 500;
}

.va7e-menu-link:hover,
.va7e-menu-link.va7e-active {
  background: var(--va7e-accent);
  color: var(--va7e-dark);
  transform: translateX(5px);
}

/* Main Content */
.va7e-main {
  margin-top: 60px;
  padding: var(--va7e-spacing-lg) 0;
}

/* Carousel */
.va7e-carousel {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: var(--va7e-spacing-lg);
}

.va7e-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.va7e-carousel-slide.va7e-active {
  opacity: 1;
}

.va7e-carousel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

/* Section Styles */
.va7e-section {
  margin-bottom: var(--va7e-spacing-xl);
}

.va7e-section-title {
  font-size: var(--va7e-font-size-xl);
  font-weight: 700;
  color: var(--va7e-accent);
  margin-bottom: var(--va7e-spacing-md);
  display: flex;
  align-items: center;
  gap: var(--va7e-spacing-sm);
}

.va7e-section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--va7e-accent);
  border-radius: 2px;
}

/* Game Grid */
.va7e-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--va7e-spacing-sm);
  margin-bottom: var(--va7e-spacing-lg);
}

.va7e-game-card {
  background: var(--va7e-bg-card);
  border-radius: 8px;
  padding: var(--va7e-spacing-sm);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.va7e-game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(77, 182, 172, 0.3);
}

.va7e-game-icon {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: var(--va7e-spacing-xs);
}

.va7e-game-name {
  font-size: var(--va7e-font-size-xs);
  color: var(--va7e-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

/* Content Cards */
.va7e-card {
  background: var(--va7e-bg-card);
  border-radius: 12px;
  padding: var(--va7e-spacing-lg);
  margin-bottom: var(--va7e-spacing-md);
  border: 1px solid rgba(77, 182, 172, 0.2);
}

.va7e-card-title {
  font-size: var(--va7e-font-size-lg);
  font-weight: 700;
  color: var(--va7e-secondary);
  margin-bottom: var(--va7e-spacing-md);
}

.va7e-card-content {
  font-size: var(--va7e-font-size-base);
  line-height: 1.7;
  color: var(--va7e-text-secondary);
}

.va7e-card-content p {
  margin-bottom: var(--va7e-spacing-md);
}

.va7e-card-content a {
  color: var(--va7e-accent);
  text-decoration: none;
  font-weight: 600;
}

.va7e-card-content a:hover {
  text-decoration: underline;
}

/* List Styles */
.va7e-list {
  list-style: none;
  margin: var(--va7e-spacing-md) 0;
}

.va7e-list-item {
  padding: var(--va7e-spacing-sm) 0;
  border-bottom: 1px solid rgba(255, 228, 181, 0.1);
  display: flex;
  align-items: flex-start;
  gap: var(--va7e-spacing-sm);
}

.va7e-list-item:last-child {
  border-bottom: none;
}

.va7e-list-icon {
  color: var(--va7e-accent);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Footer */
.va7e-footer {
  background: var(--va7e-bg-secondary);
  padding: var(--va7e-spacing-xl) var(--va7e-spacing-md);
  margin-top: var(--va7e-spacing-xl);
}

.va7e-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--va7e-spacing-md);
  margin-bottom: var(--va7e-spacing-lg);
}

.va7e-footer-link {
  color: var(--va7e-accent);
  text-decoration: none;
  font-size: var(--va7e-font-size-sm);
  transition: color 0.3s ease;
}

.va7e-footer-link:hover {
  color: var(--va7e-secondary);
}

.va7e-partners {
  display: flex;
  flex-wrap: wrap;
  gap: var(--va7e-spacing-md);
  justify-content: center;
  margin-bottom: var(--va7e-spacing-lg);
}

.va7e-partner-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.va7e-partner-logo:hover {
  opacity: 1;
}

.va7e-copyright {
  text-align: center;
  font-size: var(--va7e-font-size-xs);
  color: var(--va7e-text-muted);
}

/* Bottom Navigation (Mobile) */
.va7e-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, var(--va7e-dark) 0%, var(--va7e-primary) 100%);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: var(--va7e-z-bottom-nav);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

.va7e-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  min-height: 60px;
  text-decoration: none;
  color: var(--va7e-text-secondary);
  transition: all 0.3s ease;
  position: relative;
}

.va7e-bottom-nav-item:hover,
.va7e-bottom-nav-item.va7e-active {
  color: var(--va7e-accent);
}

.va7e-bottom-nav-icon {
  font-size: 22px;
  margin-bottom: 2px;
  transition: transform 0.3s ease;
}

.va7e-bottom-nav-item:hover .va7e-bottom-nav-icon,
.va7e-bottom-nav-item.va7e-active .va7e-bottom-nav-icon {
  transform: scale(1.2);
}

.va7e-bottom-nav-text {
  font-size: 10px;
  font-weight: 500;
}

/* H1 Title */
.va7e-page-title {
  font-size: var(--va7e-font-size-2xl);
  font-weight: 700;
  color: var(--va7e-secondary);
  margin-bottom: var(--va7e-spacing-md);
  line-height: 1.3;
}

/* Helper Classes */
.va7e-text-center {
  text-align: center;
}

.va7e-mb-lg {
  margin-bottom: var(--va7e-spacing-lg);
}

.va7e-mb-xl {
  margin-bottom: var(--va7e-spacing-xl);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .va7e-menu-button {
    display: block;
  }

  .va7e-header-buttons {
    display: none;
  }

  .va7e-bottom-nav {
    display: flex;
  }
}

@media (min-width: 769px) {
  .va7e-wrapper {
    padding-bottom: 0;
  }

  .va7e-bottom-nav {
    display: none;
  }

  .va7e-menu-button {
    display: none;
  }

  .va7e-header-buttons {
    display: flex;
  }
}

/* Touch Device Optimizations */
.va7e-touch-device .va7e-btn {
  min-height: 44px;
  min-width: 44px;
}

.va7e-touch-device .va7e-game-card {
  min-height: 44px;
}

/* Animation Classes */
@keyframes va7e-fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.va7e-fade-in {
  animation: va7e-fadeIn 0.5s ease forwards;
}
