/**
 * JL11 Core Stylesheet - Part 1 Foundation
 * Class prefix: w3bf2
 * All classes use dynamic prefix for namespace isolation
 */

/* CSS 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 Neue', Arial, sans-serif;
  font-size: 1.6rem;
  line-height: 1.5;
  color: #A9A9A9;
  background-color: #1E1E1E;
  overflow-x: hidden;
  min-height: 100vh;
}

/* CSS Variables */
:root {
  --w3bf2-primary: #778899;
  --w3bf2-secondary: #A9A9A9;
  --w3bf2-dark: #1E1E1E;
  --w3bf2-darker: #0a0a0a;
  --w3bf2-light: #f5f5f5;
  --w3bf2-accent: #778899;
  --w3bf2-border: #333;
  --w3bf2-shadow: rgba(119, 136, 153, 0.1);
}

/* Container */
.w3bf2-container {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.w3bf2-wrapper {
  max-width: 430px;
  margin: 0 auto;
  width: 100%;
  overflow: hidden;
}

/* Header Styles */
.w3bf2-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--w3bf2-border);
  z-index: 1000;
  transition: all 0.3s ease;
}

.w3bf2-header.w3bf2-scrolled {
  box-shadow: 0 2px 10px var(--w3bf2-shadow);
}

.w3bf2-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 430px;
  margin: 0 auto;
}

.w3bf2-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  color: var(--w3bf2-primary);
  font-size: 2rem;
  font-weight: 700;
}

.w3bf2-logo-icon {
  width: 28px;
  height: 28px;
}

.w3bf2-header-buttons {
  display: flex;
  gap: 1rem;
}

.w3bf2-btn {
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.w3bf2-btn-primary {
  background-color: var(--w3bf2-primary);
  color: var(--w3bf2-light);
}

.w3bf2-btn-primary:hover {
  background-color: #6a7a8a;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(119, 136, 153, 0.3);
}

.w3bf2-btn-secondary {
  background-color: transparent;
  color: var(--w3bf2-primary);
  border: 2px solid var(--w3bf2-primary);
}

.w3bf2-btn-secondary:hover {
  background-color: var(--w3bf2-primary);
  color: var(--w3bf2-light);
}

.w3bf2-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--w3bf2-primary);
  font-size: 2.4rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* Mobile Menu */
.w3bf2-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.w3bf2-menu-overlay.w3bf2-active {
  opacity: 1;
  visibility: visible;
}

.w3bf2-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background-color: var(--w3bf2-dark);
  z-index: 9999;
  transition: right 0.3s ease;
  overflow-y: auto;
  border-left: 1px solid var(--w3bf2-border);
}

.w3bf2-mobile-menu.w3bf2-active {
  right: 0;
}

.w3bf2-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--w3bf2-border);
}

.w3bf2-menu-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--w3bf2-primary);
}

.w3bf2-close-menu {
  background: none;
  border: none;
  color: var(--w3bf2-secondary);
  font-size: 2.4rem;
  cursor: pointer;
  padding: 0.5rem;
}

.w3bf2-menu-list {
  list-style: none;
  padding: 1rem 0;
}

.w3bf2-menu-item {
  border-bottom: 1px solid var(--w3bf2-border);
}

.w3bf2-menu-link {
  display: block;
  padding: 1.2rem 1.5rem;
  color: var(--w3bf2-secondary);
  text-decoration: none;
  font-size: 1.5rem;
  transition: all 0.2s ease;
}

.w3bf2-menu-link:hover {
  background-color: rgba(119, 136, 153, 0.1);
  color: var(--w3bf2-primary);
  padding-left: 2rem;
}

.w3bf2-menu-link:active {
  background-color: rgba(119, 136, 153, 0.2);
}

/* Main Content */
main {
  margin-top: 70px;
  padding-bottom: 80px;
}

.w3bf2-section {
  padding: 2rem 0;
}

.w3bf2-section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--w3bf2-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.w3bf2-section-title h2 {
  font-size: 2rem;
  color: var(--w3bf2-primary);
}

/* Carousel/Slideshow */
.w3bf2-carousel {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.w3bf2-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: pointer;
}

.w3bf2-slide.w3bf2-active {
  opacity: 1;
}

.w3bf2-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Game Grid */
.w3bf2-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.w3bf2-game-item {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

.w3bf2-game-item:active {
  transform: scale(0.95);
}

.w3bf2-game-icon {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  background-color: var(--w3bf2-darker);
  border: 1px solid var(--w3bf2-border);
}

.w3bf2-game-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.w3bf2-game-item:hover .w3bf2-game-icon img {
  transform: scale(1.1);
}

.w3bf2-game-name {
  font-size: 1rem;
  text-align: center;
  color: var(--w3bf2-secondary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.w3bf2-category-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--w3bf2-primary);
  margin: 2rem 0 1rem;
  padding-left: 0.5rem;
  border-left: 4px solid var(--w3bf2-primary);
}

/* Card Component */
.w3bf2-card {
  background-color: var(--w3bf2-darker);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--w3bf2-border);
}

.w3bf2-card-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--w3bf2-primary);
  margin-bottom: 1rem;
}

.w3bf2-card-content {
  font-size: 1.4rem;
  color: var(--w3bf2-secondary);
  line-height: 1.6;
}

.w3bf2-card-content p {
  margin-bottom: 1rem;
}

.w3bf2-card-content a {
  color: var(--w3bf2-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.w3bf2-card-content a:hover {
  color: var(--w3bf2-light);
  text-decoration: underline;
}

/* List Styles */
.w3bf2-list {
  list-style: none;
  padding: 0;
}

.w3bf2-list-item {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--w3bf2-border);
  color: var(--w3bf2-secondary);
  font-size: 1.4rem;
}

.w3bf2-list-item:last-child {
  border-bottom: none;
}

.w3bf2-list-item a {
  color: var(--w3bf2-primary);
  text-decoration: none;
  font-weight: 600;
}

.w3bf2-list-item a:hover {
  text-decoration: underline;
}

/* Footer */
.w3bf2-footer {
  background-color: var(--w3bf2-darker);
  border-top: 1px solid var(--w3bf2-border);
  padding: 2rem 0 1rem;
  margin-top: 3rem;
}

.w3bf2-footer-content {
  max-width: 430px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.w3bf2-footer-section {
  margin-bottom: 2rem;
}

.w3bf2-footer-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--w3bf2-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.w3bf2-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.w3bf2-footer-link {
  color: var(--w3bf2-secondary);
  text-decoration: none;
  font-size: 1.3rem;
  padding: 0.5rem 1rem;
  background-color: rgba(119, 136, 153, 0.1);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.w3bf2-footer-link:hover {
  background-color: var(--w3bf2-primary);
  color: var(--w3bf2-light);
}

.w3bf2-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

.w3bf2-partner-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.w3bf2-partner-icon:hover {
  opacity: 1;
}

.w3bf2-copyright {
  text-align: center;
  color: var(--w3bf2-secondary);
  font-size: 1.2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--w3bf2-border);
}

/* Bottom Navigation (Mobile) */
.w3bf2-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--w3bf2-dark);
  border-top: 1px solid var(--w3bf2-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 60px;
  z-index: 1000;
  padding: 0 0.5rem;
}

.w3bf2-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--w3bf2-secondary);
  min-width: 60px;
  min-height: 60px;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.w3bf2-nav-item:hover {
  background-color: rgba(119, 136, 153, 0.1);
}

.w3bf2-nav-item:active {
  transform: scale(0.95);
}

.w3bf2-nav-icon {
  font-size: 22px;
  margin-bottom: 2px;
  color: var(--w3bf2-primary);
}

.w3bf2-nav-text {
  font-size: 10px;
  color: var(--w3bf2-secondary);
  text-align: center;
}

.w3bf2-nav-item.active .w3bf2-nav-icon,
.w3bf2-nav-item.active .w3bf2-nav-text {
  color: var(--w3bf2-primary);
}

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
  .w3bf2-bottom-nav {
    display: none;
  }

  main {
    padding-bottom: 2rem;
  }
}

/* Desktop Navigation */
@media (min-width: 769px) {
  .w3bf2-menu-btn {
    display: none;
  }
}

/* Mobile Navigation Button */
@media (max-width: 768px) {
  .w3bf2-menu-btn {
    display: block;
  }

  .w3bf2-header-buttons {
    gap: 0.8rem;
  }

  .w3bf2-btn {
    padding: 0.5rem 1rem;
    font-size: 1.2rem;
  }
}

/* Utility Classes */
.w3bf2-text-center {
  text-align: center;
}

.w3bf2-mb-1 {
  margin-bottom: 1rem;
}

.w3bf2-mb-2 {
  margin-bottom: 2rem;
}

.w3bf2-mt-1 {
  margin-top: 1rem;
}

.w3bf2-mt-2 {
  margin-top: 2rem;
}

.w3bf2-highlight {
  color: var(--w3bf2-primary);
  font-weight: 600;
}

/* Link Styling */
a {
  color: var(--w3bf2-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--w3bf2-light);
}

/* Image Styling */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Button Hover Effects */
.w3bf2-btn:active {
  transform: scale(0.98);
}

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Selection Color */
::selection {
  background-color: var(--w3bf2-primary);
  color: var(--w3bf2-light);
}

/* Focus States */
button:focus,
a:focus {
  outline: 2px solid var(--w3bf2-primary);
  outline-offset: 2px;
}

/* Loading States */
.w3bf2-loading {
  opacity: 0.6;
  pointer-events: none;
}
