/* Milyon88 - Mobile-First Gaming Platform CSS */
/* All classes prefixed with "g8d6-" to avoid conflicts */

/* CSS Custom Properties */
:root {
  --g8d6-primary: #FF0000;
  --g8d6-secondary: #1E90FF;
  --g8d6-accent: #4682B4;
  --g8d6-dark: #141414;
  --g8d6-bg: #1a1a1a;
  --g8d6-bg-light: #2a2a2a;
  --g8d6-text: #ffffff;
  --g8d6-text-light: #cccccc;
  --g8d6-text-muted: #999999;
  --g8d6-border: #333333;
  --g8d6-shadow: rgba(255, 0, 0, 0.3);
  --g8d6-gradient: linear-gradient(135deg, #FF0000, #4682B4);
  --g8d6-success: #28a745;
  --g8d6-warning: #ffc107;
  --g8d6-error: #dc3545;
  --g8d6-border-radius: 8px;
  --g8d6-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --g8d6-container-padding: 1rem;
  --g8d6-header-height: 56px;
  --g8d6-bottom-nav-height: 64px;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%; /* 10px base for rem calculations */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.4rem;
  line-height: 1.5;
  color: var(--g8d6-text);
  background: var(--g8d6-dark);
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255, 0, 0, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(70, 130, 180, 0.1) 0%, transparent 50%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Container System */
.g8d6-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.g8d6-container {
  max-width: 43rem;
  margin: 0 auto;
  padding: 0 var(--g8d6-container-padding);
  width: 100%;
}

.g8d6-main {
  flex: 1;
  padding-top: var(--g8d6-header-height);
  padding-bottom: calc(var(--g8d6-bottom-nav-height) + 2rem);
}

/* Typography */
.g8d6-h1 {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--g8d6-text);
  background: var(--g8d6-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.g8d6-h2 {
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1.2rem;
  color: var(--g8d6-text);
}

.g8d6-h3 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 1rem;
  color: var(--g8d6-text);
}

.g8d6-h4 {
  font-size: 1.8rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.8rem;
  color: var(--g8d6-text-light);
}

.g8d6-text-center {
  text-align: center;
}

/* Header Navigation */
.g8d6-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--g8d6-header-height);
  background: var(--g8d6-dark);
  border-bottom: 2px solid var(--g8d6-primary);
  z-index: 1000;
  box-shadow: 0 2px 20px var(--g8d6-shadow);
}

.g8d6-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 43rem;
  margin: 0 auto;
  padding: 0 var(--g8d6-container-padding);
}

.g8d6-logo {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  font-size: 2rem;
  font-weight: 700;
  color: var(--g8d6-primary);
}

.g8d6-logo-icon {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  border: 2px solid var(--g8d6-primary);
}

.g8d6-header-buttons {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.g8d6-btn-header {
  padding: 0.6rem 1.2rem;
  font-size: 1.2rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--g8d6-border-radius);
  transition: var(--g8d6-transition);
  cursor: pointer;
  min-height: 4.4rem;
  display: flex;
  align-items: center;
}

.g8d6-btn-register {
  background: var(--g8d6-gradient);
  color: var(--g8d6-text);
  border: none;
}

.g8d6-btn-login {
  background: transparent;
  color: var(--g8d6-primary);
  border: 1px solid var(--g8d6-primary);
}

.g8d6-btn-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--g8d6-shadow);
}

/* Mobile Menu Burger */
.g8d6-burger {
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  padding: 0.8rem;
  margin-left: 0.8rem;
}

.g8d6-burger-line {
  width: 2.4rem;
  height: 2px;
  background: var(--g8d6-primary);
  transition: var(--g8d6-transition);
  border-radius: 1px;
}

.g8d6-burger--active .g8d6-burger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.g8d6-burger--active .g8d6-burger-line:nth-child(2) {
  opacity: 0;
}

.g8d6-burger--active .g8d6-burger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Navigation */
.g8d6-mobile-menu {
  position: fixed;
  top: var(--g8d6-header-height);
  left: -100%;
  width: 28rem;
  height: calc(100vh - var(--g8d6-header-height));
  background: var(--g8d6-bg);
  transition: var(--g8d6-transition);
  z-index: 999;
  box-shadow: 2px 0 20px var(--g8d6-shadow);
  border-right: 2px solid var(--g8d6-primary);
}

.g8d6-mobile-menu--active {
  left: 0;
}

.g8d6-nav-list {
  list-style: none;
  padding: 2rem 0;
}

.g8d6-nav-item {
  border-bottom: 1px solid var(--g8d6-border);
}

.g8d6-nav-link {
  display: block;
  padding: 1.5rem 2rem;
  text-decoration: none;
  color: var(--g8d6-text-light);
  font-size: 1.6rem;
  transition: var(--g8d6-transition);
}

.g8d6-nav-link:hover,
.g8d6-nav-link--active {
  background: var(--g8d6-bg-light);
  color: var(--g8d6-primary);
  border-left: 4px solid var(--g8d6-primary);
}

.g8d6-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  visibility: hidden;
  opacity: 0;
  transition: var(--g8d6-transition);
  z-index: 998;
}

.g8d6-menu-overlay--active {
  visibility: visible;
  opacity: 1;
}

/* Button Components */
.g8d6-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1.2rem 2.4rem;
  font-size: 1.4rem;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  border: none;
  border-radius: var(--g8d6-border-radius);
  cursor: pointer;
  transition: var(--g8d6-transition);
  min-width: 4.4rem;
  min-height: 4.4rem;
  position: relative;
  overflow: hidden;
}

.g8d6-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--g8d6-transition);
}

.g8d6-btn:hover::before {
  left: 100%;
}

.g8d6-btn--primary {
  background: var(--g8d6-gradient);
  color: var(--g8d6-text);
}

.g8d6-btn--secondary {
  background: var(--g8d6-secondary);
  color: var(--g8d6-text);
}

.g8d6-btn--outline {
  background: transparent;
  color: var(--g8d6-primary);
  border: 2px solid var(--g8d6-primary);
}

.g8d6-btn--small {
  padding: 0.8rem 1.6rem;
  font-size: 1.2rem;
  min-height: 3.6rem;
}

.g8d6-btn--large {
  padding: 1.6rem 3.2rem;
  font-size: 1.6rem;
  min-height: 5.6rem;
}

.g8d6-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--g8d6-shadow);
}

.g8d6-btn--outline:hover {
  background: var(--g8d6-primary);
  color: var(--g8d6-text);
}

/* Card Components */
.g8d6-card {
  background: var(--g8d6-bg-light);
  border-radius: var(--g8d6-border-radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
  overflow: hidden;
  border: 1px solid var(--g8d6-border);
}

.g8d6-card-header {
  background: var(--g8d6-gradient);
  color: var(--g8d6-text);
  padding: 1.5rem 2rem;
  border-bottom: 2px solid var(--g8d6-primary);
}

.g8d6-card-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
}

.g8d6-card-body {
  padding: 2rem;
}

.g8d6-section {
  margin-bottom: 3rem;
}

/* Grid System */
.g8d6-grid {
  display: grid;
  gap: 1.5rem;
}

.g8d6-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.g8d6-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.g8d6-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Carousel/Slider */
.g8d6-carousel {
  position: relative;
  width: 100%;
  height: 20rem;
  overflow: hidden;
  border-radius: var(--g8d6-border-radius);
  margin-bottom: 2rem;
  border: 2px solid var(--g8d6-primary);
}

.g8d6-carousel-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  cursor: pointer;
}

.g8d6-carousel-slide--active {
  opacity: 1;
}

.g8d6-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g8d6-carousel-indicators {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.g8d6-carousel-indicator {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--g8d6-transition);
  border: 2px solid var(--g8d6-primary);
}

.g8d6-carousel-indicator--active {
  background: var(--g8d6-primary);
  transform: scale(1.2);
}

.g8d6-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--g8d6-primary);
  color: var(--g8d6-text);
  border: none;
  padding: 1rem;
  cursor: pointer;
  font-size: 1.8rem;
  transition: var(--g8d6-transition);
  border-radius: var(--g8d6-border-radius);
}

.g8d6-carousel-prev {
  left: 1rem;
}

.g8d6-carousel-next {
  right: 1rem;
}

.g8d6-carousel-nav:hover {
  background: var(--g8d6-secondary);
  transform: translateY(-50%) scale(1.1);
}

/* Game Components */
.g8d6-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.g8d6-game-card {
  background: var(--g8d6-bg-light);
  border-radius: var(--g8d6-border-radius);
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  transition: var(--g8d6-transition);
  cursor: pointer;
  border: 1px solid var(--g8d6-border);
  position: relative;
  overflow: hidden;
}

.g8d6-game-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(transparent, var(--g8d6-primary), transparent);
  opacity: 0;
  transition: var(--g8d6-transition);
}

.g8d6-game-card:hover::before {
  opacity: 0.1;
  animation: g8d6-spin 2s linear infinite;
}

@keyframes g8d6-spin {
  to {
    transform: rotate(360deg);
  }
}

.g8d6-game-card:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 30px var(--g8d6-shadow);
  border-color: var(--g8d6-primary);
}

.g8d6-game-icon {
  width: 6rem;
  height: 6rem;
  border-radius: var(--g8d6-border-radius);
  margin-bottom: 0.8rem;
  object-fit: cover;
  border: 2px solid var(--g8d6-border);
  transition: var(--g8d6-transition);
}

.g8d6-game-card:hover .g8d6-game-icon {
  border-color: var(--g8d6-primary);
}

.g8d6-game-name {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--g8d6-text-light);
  display: block;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

/* Filter Buttons */
.g8d6-filter-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.g8d6-filter-btn {
  padding: 0.8rem 1.6rem;
  background: var(--g8d6-bg-light);
  color: var(--g8d6-text-light);
  border: 1px solid var(--g8d6-border);
  border-radius: 2rem;
  font-size: 1.3rem;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--g8d6-transition);
}

.g8d6-filter-btn--active,
.g8d6-filter-btn:hover {
  background: var(--g8d6-primary);
  color: var(--g8d6-text);
  border-color: var(--g8d6-primary);
  transform: translateY(-2px);
}

/* Footer */
.g8d6-footer {
  background: var(--g8d6-bg);
  color: var(--g8d6-text-light);
  padding: 3rem 0 calc(var(--g8d6-bottom-nav-height) + 2rem);
  margin-top: auto;
  border-top: 2px solid var(--g8d6-primary);
}

.g8d6-footer-content {
  max-width: 43rem;
  margin: 0 auto;
  padding: 0 var(--g8d6-container-padding);
}

.g8d6-footer-section {
  margin-bottom: 2rem;
}

.g8d6-footer-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--g8d6-primary);
}

.g8d6-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.g8d6-footer-link {
  color: var(--g8d6-text-light);
  text-decoration: none;
  font-size: 1.3rem;
  transition: var(--g8d6-transition);
  padding: 0.5rem 1rem;
  border-radius: var(--g8d6-border-radius);
}

.g8d6-footer-link:hover {
  color: var(--g8d6-primary);
  background: var(--g8d6-bg-light);
}

.g8d6-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
  padding: 2rem;
  background: var(--g8d6-bg-light);
  border-radius: var(--g8d6-border-radius);
  border: 1px solid var(--g8d6-border);
}

.g8d6-partner-logo {
  width: 4rem;
  height: 4rem;
  object-fit: contain;
  opacity: 0.7;
  transition: var(--g8d6-transition);
  border-radius: var(--g8d6-border-radius);
}

.g8d6-partner-logo:hover {
  opacity: 1;
  transform: scale(1.1);
}

.g8d6-copyright {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--g8d6-border);
  color: var(--g8d6-text-muted);
  font-size: 1.2rem;
}

/* Bottom Navigation */
.g8d6-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--g8d6-bottom-nav-height);
  background: var(--g8d6-dark);
  border-top: 2px solid var(--g8d6-primary);
  display: flex;
  z-index: 1000;
  box-shadow: 0 -2px 20px var(--g8d6-shadow);
}

.g8d6-bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 0.4rem;
  text-decoration: none;
  color: var(--g8d6-text-muted);
  font-size: 1rem;
  transition: var(--g8d6-transition);
  min-height: 4.4rem;
}

.g8d6-bottom-nav-icon {
  font-size: 2rem;
  margin-bottom: 0.2rem;
  transition: var(--g8d6-transition);
}

.g8d6-bottom-nav-item--active,
.g8d6-bottom-nav-item:hover {
  color: var(--g8d6-primary);
  background: var(--g8d6-bg-light);
}

.g8d6-bottom-nav-item--active .g8d6-bottom-nav-icon {
  transform: scale(1.2);
  color: var(--g8d6-primary);
}

/* Toast Notifications */
.g8d6-toast {
  position: fixed;
  top: calc(var(--g8d6-header-height) + 1rem);
  right: 1rem;
  padding: 1rem 1.5rem;
  border-radius: var(--g8d6-border-radius);
  color: var(--g8d6-text);
  font-size: 1.4rem;
  z-index: 1001;
  opacity: 0;
  transform: translateX(100%);
  transition: var(--g8d6-transition);
  max-width: 30rem;
}

.g8d6-toast--show {
  opacity: 1;
  transform: translateX(0);
}

.g8d6-toast--info {
  background: var(--g8d6-secondary);
}

.g8d6-toast--success {
  background: var(--g8d6-success);
}

.g8d6-toast--warning {
  background: var(--g8d6-warning);
}

.g8d6-toast--error {
  background: var(--g8d6-error);
}

/* Lazy Loading */
.g8d6-lazy {
  opacity: 0;
  transition: opacity 0.3s;
}

.g8d6-lazy.loaded {
  opacity: 1;
}

/* Touch Interactions */
.g8d6-touch-active {
  transform: scale(0.95);
  opacity: 0.8;
}

/* Keyboard Active (Virtual Keyboard) */
.g8d6-keyboard-active .g8d6-bottom-nav {
  display: none;
}

.g8d6-keyboard-active .g8d6-main {
  padding-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .g8d6-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .g8d6-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .g8d6-carousel {
    height: 16rem;
  }
  
  .g8d6-h1 {
    font-size: 2.4rem;
  }
  
  .g8d6-h2 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .g8d6-game-grid {
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    gap: 0.8rem;
  }
  
  .g8d6-game-icon {
    width: 5rem;
    height: 5rem;
  }
  
  .g8d6-carousel {
    height: 14rem;
  }
  
  .g8d6-btn {
    padding: 1rem 2rem;
    font-size: 1.3rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .g8d6-carousel-slide {
    transition: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --g8d6-shadow: rgba(255, 255, 255, 0.5);
    --g8d6-border: #ffffff;
  }
}

/* Print Styles */
@media print {
  .g8d6-header,
  .g8d6-bottom-nav,
  .g8d6-carousel,
  .g8d6-btn {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}