/* Core CSS layout for kkkkph website */
/* All classes use w3820- prefix for namespace isolation */

/* CSS Variables for consistent theming */
:root {
  /* Color palette from requirements */
  --w3820-primary: #B0E0E6;      /* Powder Blue */
  --w3820-secondary: #80CBC4;    /* Teal */
  --w3820-accent: #00FFFF;       /* Cyan */
  --w3820-highlight: #40E0D0;    /* Turquoise */
  --w3820-light: #E9ECEF;        /* Light Gray */
  --w3820-dark: #2D2D2D;         /* Dark Gray */

  /* Functional colors */
  --w3820-bg: #1a1a1a;
  --w3820-text: #ffffff;
  --w3820-text-secondary: #b0b0b0;
  --w3820-border: #333333;
  --w3820-success: #28a745;
  --w3820-warning: #ffc107;
  --w3820-error: #dc3545;

  /* Typography */
  --w3820-font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --w3820-font-size-base: 1.6rem;
  --w3820-line-height: 1.5;

  /* Spacing */
  --w3820-spacing-xs: 0.5rem;
  --w3820-spacing-sm: 1rem;
  --w3820-spacing-md: 1.5rem;
  --w3820-spacing-lg: 2rem;
  --w3820-spacing-xl: 3rem;

  /* Layout */
  --w3820-header-height: 6rem;
  --w3820-bottom-nav-height: 6rem;
  --w3820-max-width: 43rem;
  --w3820-border-radius: 0.8rem;
  --w3820-transition: all 0.3s ease;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%; /* 1rem = 10px */
  scroll-behavior: smooth;
}

body {
  font-family: var(--w3820-font-primary);
  font-size: var(--w3820-font-size-base);
  line-height: var(--w3820-line-height);
  color: var(--w3820-text);
  background-color: var(--w3820-bg);
  overflow-x: hidden;
}

/* Utility classes */
.w3820-container {
  max-width: var(--w3820-max-width);
  margin: 0 auto;
  padding: 0 var(--w3820-spacing-sm);
}

.w3820-wrapper {
  padding-bottom: var(--w3820-bottom-nav-height);
}

.w3820-text-center {
  text-align: center;
}

.w3820-text-primary {
  color: var(--w3820-primary);
}

.w3820-text-accent {
  color: var(--w3820-accent);
}

/* Header */
.w3820-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--w3820-header-height);
  background: linear-gradient(135deg, var(--w3820-dark) 0%, #1a1a1a 100%);
  border-bottom: 1px solid var(--w3820-border);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.w3820-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--w3820-spacing-sm);
}

.w3820-logo {
  display: flex;
  align-items: center;
  gap: var(--w3820-spacing-xs);
  text-decoration: none;
  color: var(--w3820-text);
}

.w3820-logo img {
  width: 2.4rem;
  height: 2.4rem;
}

.w3820-logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--w3820-primary), var(--w3820-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Navigation buttons */
.w3820-nav-buttons {
  display: flex;
  gap: var(--w3820-spacing-xs);
}

.w3820-btn {
  padding: 0.8rem 1.6rem;
  border: none;
  border-radius: var(--w3820-border-radius);
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--w3820-transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.4rem; /* Touch-friendly size */
}

.w3820-btn-primary {
  background: linear-gradient(135deg, var(--w3820-primary), var(--w3820-highlight));
  color: var(--w3820-dark);
}

.w3820-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(176, 224, 230, 0.3);
}

.w3820-btn-secondary {
  background: transparent;
  color: var(--w3820-primary);
  border: 2px solid var(--w3820-primary);
}

.w3820-btn-secondary:hover {
  background: var(--w3820-primary);
  color: var(--w3820-dark);
}

/* Mobile menu button */
.w3820-menu-btn {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.8rem;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
}

.w3820-menu-btn span {
  width: 2.4rem;
  height: 0.2rem;
  background: var(--w3820-primary);
  transition: var(--w3820-transition);
}

.w3820-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(0.5rem, 0.5rem);
}

.w3820-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.w3820-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(0.5rem, -0.5rem);
}

/* Mobile menu */
.w3820-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 32rem;
  height: 100vh;
  background: linear-gradient(135deg, var(--w3820-dark) 0%, #1a1a1a 100%);
  backdrop-filter: blur(10px);
  z-index: 9999;
  transition: right 0.3s ease;
  padding-top: var(--w3820-header-height);
  overflow-y: auto;
}

.w3820-mobile-menu.active {
  right: 0;
}

.w3820-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: var(--w3820-transition);
}

.w3820-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.w3820-menu-list {
  list-style: none;
  padding: var(--w3820-spacing-md);
}

.w3820-menu-item {
  border-bottom: 1px solid var(--w3820-border);
}

.w3820-menu-link {
  display: block;
  padding: var(--w3820-spacing-md);
  color: var(--w3820-text);
  text-decoration: none;
  font-size: 1.6rem;
  transition: var(--w3820-transition);
}

.w3820-menu-link:hover {
  color: var(--w3820-primary);
  background: rgba(176, 224, 230, 0.1);
}

/* Main content */
.w3820-main {
  padding-top: var(--w3820-header-height);
}

.w3820-section {
  padding: var(--w3820-spacing-lg) 0;
}

.w3820-section-title {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: var(--w3820-spacing-md);
  text-align: center;
  background: linear-gradient(135deg, var(--w3820-primary), var(--w3820-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Carousel */
.w3820-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--w3820-border-radius);
  margin-bottom: var(--w3820-spacing-lg);
}

.w3820-slide {
  display: none;
  width: 100%;
}

.w3820-slide.active {
  display: block;
}

.w3820-slide img {
  width: 100%;
  height: auto;
  max-height: 20rem;
  object-fit: cover;
}

.w3820-carousel-indicators {
  position: absolute;
  bottom: var(--w3820-spacing-sm);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--w3820-spacing-xs);
}

.w3820-indicator {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--w3820-transition);
}

.w3820-indicator.active {
  background: var(--w3820-primary);
  width: 2rem;
  border-radius: 0.4rem;
}

/* Game grid */
.w3820-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: var(--w3820-spacing-sm);
  margin-bottom: var(--w3820-spacing-lg);
}

.w3820-game-card {
  background: linear-gradient(135deg, #2a2a2a 0%, var(--w3820-dark) 100%);
  border-radius: var(--w3820-border-radius);
  padding: var(--w3820-spacing-xs);
  text-align: center;
  transition: var(--w3820-transition);
  cursor: pointer;
}

.w3820-game-card:hover {
  transform: translateY(-0.5rem);
  box-shadow: 0 0.5rem 2rem rgba(0, 255, 255, 0.2);
}

.w3820-game-icon {
  width: 100%;
  height: 6rem;
  object-fit: contain;
  margin-bottom: var(--w3820-spacing-xs);
}

.w3820-game-name {
  font-size: 1.2rem;
  color: var(--w3820-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Content sections */
.w3820-content-section {
  background: linear-gradient(135deg, #2a2a2a 0%, var(--w3820-dark) 100%);
  border-radius: var(--w3820-border-radius);
  padding: var(--w3820-spacing-md);
  margin-bottom: var(--w3820-spacing-md);
  border: 1px solid var(--w3820-border);
}

.w3820-content-section h2 {
  color: var(--w3820-primary);
  margin-bottom: var(--w3820-spacing-sm);
  font-size: 2rem;
}

.w3820-content-section p {
  color: var(--w3820-text-secondary);
  margin-bottom: var(--w3820-spacing-sm);
  line-height: 1.6;
}

/* Bottom navigation */
.w3820-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--w3820-bottom-nav-height);
  background: linear-gradient(135deg, var(--w3820-dark) 0%, #1a1a1a 100%);
  border-top: 1px solid var(--w3820-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding: 0.5rem 0;
}

.w3820-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 6rem;
  min-height: 5rem;
  text-decoration: none;
  color: var(--w3820-text-secondary);
  transition: var(--w3820-transition);
  cursor: pointer;
}

.w3820-bottom-nav-item:hover,
.w3820-bottom-nav-item.active {
  color: var(--w3820-primary);
  transform: scale(1.05);
}

.w3820-bottom-nav-icon {
  font-size: 2.4rem;
  margin-bottom: 0.2rem;
}

.w3820-bottom-nav-text {
  font-size: 1rem;
  font-weight: 500;
}

/* Footer */
.w3820-footer {
  background: linear-gradient(135deg, #1a1a1a 0%, var(--w3820-dark) 100%);
  padding: var(--w3820-spacing-lg) 0 var(--w3820-bottom-nav-height);
  margin-top: var(--w3820-spacing-xl);
}

.w3820-footer-section {
  margin-bottom: var(--w3820-spacing-md);
}

.w3820-footer-title {
  color: var(--w3820-primary);
  font-size: 1.8rem;
  margin-bottom: var(--w3820-spacing-sm);
}

.w3820-footer-links {
  list-style: none;
}

.w3820-footer-links li {
  margin-bottom: var(--w3820-spacing-xs);
}

.w3820-footer-links a {
  color: var(--w3820-text-secondary);
  text-decoration: none;
  transition: var(--w3820-transition);
}

.w3820-footer-links a:hover {
  color: var(--w3820-primary);
}

.w3820-partners {
  display: flex;
  flex-wrap: wrap;
  gap: var(--w3820-spacing-sm);
  justify-content: center;
  margin: var(--w3820-spacing-md) 0;
}

.w3820-partner {
  width: 4rem;
  height: 4rem;
  object-fit: contain;
  opacity: 0.7;
  transition: var(--w3820-transition);
}

.w3820-partner:hover {
  opacity: 1;
  transform: scale(1.1);
}

.w3820-copyright {
  text-align: center;
  color: var(--w3820-text-secondary);
  font-size: 1.2rem;
  margin-top: var(--w3820-spacing-md);
  padding-top: var(--w3820-spacing-md);
  border-top: 1px solid var(--w3820-border);
}

/* Responsive design */
@media (min-width: 769px) {
  .w3820-bottom-nav {
    display: none;
  }

  .w3820-wrapper {
    padding-bottom: 0;
  }

  .w3820-desktop-nav {
    display: flex;
  }

  .w3820-menu-btn {
    display: none;
  }
}

@media (max-width: 768px) {
  .w3820-desktop-nav {
    display: none;
  }

  .w3820-main {
    padding-bottom: var(--w3820-bottom-nav-height);
  }
}

/* Animations */
@keyframes w3820FadeIn {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.w3820-fade-in {
  animation: w3820FadeIn 0.6s ease-out;
}

/* 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 */
.w3820-btn:focus,
.w3820-menu-link:focus,
.w3820-bottom-nav-item:focus {
  outline: 2px solid var(--w3820-primary);
  outline-offset: 2px;
}

/* Loading states */
.w3820-loading {
  position: relative;
  pointer-events: none;
}

.w3820-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2rem;
  height: 2rem;
  margin: -1rem 0 0 -1rem;
  border: 2px solid var(--w3820-primary);
  border-radius: 50%;
  border-top-color: transparent;
  animation: w3820Spin 0.8s linear infinite;
}

@keyframes w3820Spin {
  to {
    transform: rotate(360deg);
  }
}