/**
 * JL29 Core Stylesheet
 * Mobile-first responsive design with namespace isolation
 * All classes use 'v4ef-' prefix
 */

/* Reset and Base Styles */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette */
  --v4ef-primary: #40E0D0;
  --v4ef-primary-dark: #2BC4B5;
  --v4ef-bg: #212F3D;
  --v4ef-bg-light: #2D3F4F;
  --v4ef-bg-dark: #1A2530;
  --v4ef-text: #F5F5F5;
  --v4ef-text-muted: #B0BEC5;
  --v4ef-border: #37474F;
  --v4ef-white: #FFFFFF;
  --v4ef-success: #4CAF50;
  --v4ef-warning: #FF9800;
  --v4ef-danger: #F44336;

  /* Spacing */
  --v4ef-spacing-xs: 0.5rem;
  --v4ef-spacing-sm: 0.75rem;
  --v4ef-spacing-md: 1rem;
  --v4ef-spacing-lg: 1.5rem;
  --v4ef-spacing-xl: 2rem;

  /* Typography */
  --v4ef-font-size-base: 1.6rem;
  --v4ef-font-size-sm: 1.4rem;
  --v4ef-font-size-lg: 1.8rem;
  --v4ef-font-size-xl: 2.4rem;

  /* Layout */
  --v4ef-max-width: 43rem;
  --v4ef-header-height: 6.4rem;
  --v4ef-bottom-nav-height: 6rem;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--v4ef-font-size-base);
  line-height: 1.6;
  color: var(--v4ef-text);
  background-color: var(--v4ef-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Container */
.v4ef-container {
  width: 100%;
  max-width: var(--v4ef-max-width);
  margin: 0 auto;
  padding: 0 var(--v4ef-spacing-md);
}

/* Header */
.v4ef-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--v4ef-header-height);
  background: linear-gradient(135deg, var(--v4ef-bg-dark) 0%, var(--v4ef-bg) 100%);
  border-bottom: 2px solid var(--v4ef-primary);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.v4ef-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--v4ef-spacing-md);
  max-width: var(--v4ef-max-width);
  margin: 0 auto;
}

.v4ef-logo {
  display: flex;
  align-items: center;
  gap: var(--v4ef-spacing-sm);
  text-decoration: none;
  color: var(--v4ef-text);
  font-size: var(--v4ef-font-size-lg);
  font-weight: 700;
}

.v4ef-logo img {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  border: 2px solid var(--v4ef-primary);
}

.v4ef-header-actions {
  display: flex;
  gap: var(--v4ef-spacing-sm);
}

.v4ef-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--v4ef-spacing-sm) var(--v4ef-spacing-md);
  font-size: var(--v4ef-font-size-sm);
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 4rem;
  min-width: 8rem;
}

.v4ef-btn-primary {
  background: linear-gradient(135deg, var(--v4ef-primary) 0%, var(--v4ef-primary-dark) 100%);
  color: var(--v4ef-bg-dark);
  box-shadow: 0 4px 15px rgba(64, 224, 208, 0.3);
}

.v4ef-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(64, 224, 208, 0.4);
}

.v4ef-btn-secondary {
  background: transparent;
  color: var(--v4ef-primary);
  border: 2px solid var(--v4ef-primary);
}

.v4ef-btn-secondary:hover {
  background: var(--v4ef-primary);
  color: var(--v4ef-bg-dark);
}

.v4ef-menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 4.4rem;
  height: 4.4rem;
  background: transparent;
  border: 2px solid var(--v4ef-primary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.v4ef-menu-toggle span {
  display: block;
  width: 2.4rem;
  height: 0.2rem;
  background: var(--v4ef-primary);
  margin: 0.3rem 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.v4ef-menu-toggle:hover {
  background: var(--v4ef-primary);
}

.v4ef-menu-toggle:hover span {
  background: var(--v4ef-bg-dark);
}

/* Mobile Menu */
.v4ef-mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--v4ef-bg-dark);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  padding: var(--v4ef-header-height) var(--v4ef-spacing-md) var(--v4ef-bottom-nav-height);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.v4ef-mobile-menu.v4ef-menu-active {
  transform: translateX(0);
}

.v4ef-menu-close {
  position: absolute;
  top: var(--v4ef-spacing-md);
  right: var(--v4ef-spacing-md);
  width: 4.4rem;
  height: 4.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 2px solid var(--v4ef-primary);
  border-radius: 50%;
  color: var(--v4ef-primary);
  font-size: var(--v4ef-font-size-xl);
  cursor: pointer;
  transition: all 0.3s ease;
}

.v4ef-menu-close:hover {
  background: var(--v4ef-primary);
  color: var(--v4ef-bg-dark);
}

.v4ef-menu-nav {
  display: flex;
  flex-direction: column;
  gap: var(--v4ef-spacing-sm);
  margin-top: var(--v4ef-spacing-lg);
}

.v4ef-menu-nav a {
  display: flex;
  align-items: center;
  padding: var(--v4ef-spacing-md);
  background: var(--v4ef-bg-light);
  color: var(--v4ef-text);
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid var(--v4ef-border);
  transition: all 0.3s ease;
  font-size: var(--v4ef-font-size-base);
  font-weight: 500;
}

.v4ef-menu-nav a:hover {
  background: var(--v4ef-primary);
  color: var(--v4ef-bg-dark);
  border-color: var(--v4ef-primary);
  transform: translateX(4px);
}

.v4ef-menu-nav i {
  margin-right: var(--v4ef-spacing-sm);
  font-size: var(--v4ef-font-size-lg);
}

/* Main Content */
main {
  padding-top: var(--v4ef-header-height);
  padding-bottom: var(--v4ef-bottom-nav-height);
  min-height: 100vh;
}

.v4ef-section {
  padding: var(--v4ef-spacing-lg) 0;
  border-bottom: 1px solid var(--v4ef-border);
}

.v4ef-section-title {
  font-size: var(--v4ef-font-size-xl);
  font-weight: 700;
  color: var(--v4ef-primary);
  margin-bottom: var(--v4ef-spacing-md);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Carousel */
.v4ef-carousel {
  position: relative;
  width: 100%;
  height: 20rem;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: var(--v4ef-spacing-lg);
}

.v4ef-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.v4ef-carousel-slide.active {
  opacity: 1;
}

.v4ef-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Game Grid */
.v4ef-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--v4ef-spacing-sm);
  margin-bottom: var(--v4ef-spacing-lg);
}

.v4ef-game-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--v4ef-bg-light);
  border: 2px solid var(--v4ef-border);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--v4ef-spacing-xs);
  text-decoration: none;
}

.v4ef-game-item:hover {
  border-color: var(--v4ef-primary);
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(64, 224, 208, 0.3);
}

.v4ef-game-item img {
  width: 100%;
  height: auto;
  max-height: 70%;
  object-fit: contain;
  margin-bottom: var(--v4ef-spacing-xs);
}

.v4ef-game-item span {
  font-size: 1rem;
  color: var(--v4ef-text);
  text-align: center;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Content Cards */
.v4ef-card {
  background: var(--v4ef-bg-light);
  border: 1px solid var(--v4ef-border);
  border-radius: 12px;
  padding: var(--v4ef-spacing-md);
  margin-bottom: var(--v4ef-spacing-md);
  transition: all 0.3s ease;
}

.v4ef-card:hover {
  border-color: var(--v4ef-primary);
  box-shadow: 0 4px 15px rgba(64, 224, 208, 0.2);
}

.v4ef-card-title {
  font-size: var(--v4ef-font-size-lg);
  font-weight: 700;
  color: var(--v4ef-primary);
  margin-bottom: var(--v4ef-spacing-sm);
}

.v4ef-card-content {
  color: var(--v4ef-text-muted);
  line-height: 1.8;
}

.v4ef-card-content p {
  margin-bottom: var(--v4ef-spacing-sm);
}

.v4ef-link {
  color: var(--v4ef-primary);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: all 0.3s ease;
}

.v4ef-link:hover {
  border-bottom-color: var(--v4ef-primary);
}

/* Bottom Navigation */
.v4ef-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--v4ef-bottom-nav-height);
  background: linear-gradient(180deg, var(--v4ef-bg-dark) 0%, var(--v4ef-bg) 100%);
  border-top: 2px solid var(--v4ef-primary);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.v4ef-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--v4ef-text-muted);
  transition: all 0.3s ease;
  min-width: 6rem;
  min-height: 6rem;
  padding: var(--v4ef-spacing-xs);
}

.v4ef-bottom-nav a:hover {
  color: var(--v4ef-primary);
  transform: scale(1.1);
}

.v4ef-bottom-nav a.v4ef-nav-active {
  color: var(--v4ef-primary);
}

.v4ef-bottom-nav i {
  font-size: var(--v4ef-font-size-lg);
  margin-bottom: var(--v4ef-spacing-xs);
}

.v4ef-bottom-nav span {
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
}

/* Footer */
.v4ef-footer {
  background: var(--v4ef-bg-dark);
  border-top: 2px solid var(--v4ef-border);
  padding: var(--v4ef-spacing-lg) var(--v4ef-spacing-md) calc(var(--v4ef-bottom-nav-height) + var(--v4ef-spacing-md));
  margin-top: var(--v4ef-spacing-xl);
}

.v4ef-footer-description {
  text-align: center;
  color: var(--v4ef-text-muted);
  margin-bottom: var(--v4ef-spacing-md);
  line-height: 1.8;
}

.v4ef-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--v4ef-spacing-sm);
  margin-bottom: var(--v4ef-spacing-lg);
}

.v4ef-footer-links a {
  color: var(--v4ef-primary);
  text-decoration: none;
  font-size: var(--v4ef-font-size-sm);
  padding: var(--v4ef-spacing-xs) var(--v4ef-spacing-sm);
  border: 1px solid var(--v4ef-border);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.v4ef-footer-links a:hover {
  background: var(--v4ef-primary);
  color: var(--v4ef-bg-dark);
  border-color: var(--v4ef-primary);
}

.v4ef-partners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--v4ef-spacing-sm);
  margin-bottom: var(--v4ef-spacing-md);
}

.v4ef-partners img {
  width: auto;
  height: 3rem;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.v4ef-partners img:hover {
  opacity: 1;
  transform: scale(1.05);
}

.v4ef-copyright {
  text-align: center;
  color: var(--v4ef-text-muted);
  font-size: var(--v4ef-font-size-sm);
  padding-top: var(--v4ef-spacing-md);
  border-top: 1px solid var(--v4ef-border);
}

/* Responsive */
@media (min-width: 769px) {
  .v4ef-bottom-nav {
    display: none;
  }

  main {
    padding-bottom: var(--v4ef-spacing-lg);
  }

  .v4ef-footer {
    padding-bottom: var(--v4ef-spacing-lg);
  }
}

/* Typography Utilities */
.v4ef-text-center {
  text-align: center;
}

.v4ef-text-primary {
  color: var(--v4ef-primary);
}

.v4ef-text-bold {
  font-weight: 700;
}

.v4ef-mb-sm {
  margin-bottom: var(--v4ef-spacing-sm);
}

.v4ef-mb-md {
  margin-bottom: var(--v4ef-spacing-md);
}

.v4ef-mb-lg {
  margin-bottom: var(--v4ef-spacing-lg);
}
