/* Jollibee 777 CSS Design System - Mobile First */
/* All classes use prefix "uied-" for namespace isolation */

/* CSS Variables - Jollibee Color Palette */
:root {
  /* Primary Colors */
  --uied-primary: #9966CC;      /* Purple - Main brand color */
  --uied-secondary: #FFC0CB;    /* Pink - Accent color */
  --uied-accent: #808080;       /* Gray - Neutral color */
  --uied-dark: #262626;         /* Dark - Background color */

  /* Extended Color Palette */
  --uied-bg-primary: #1a1a1a;
  --uied-bg-secondary: #2d2d2d;
  --uied-text-primary: #ffffff;
  --uied-text-secondary: #cccccc;
  --uied-text-muted: #999999;
  --uied-border: #404040;
  --uied-hover: #b388ff;
  --uied-success: #4caf50;
  --uied-warning: #ff9800;
  --uied-error: #f44336;

  /* Typography */
  --uied-font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --uied-font-size-xs: 1rem;    /* 10px */
  --uied-font-size-sm: 1.2rem;  /* 12px */
  --uied-font-size-base: 1.4rem; /* 14px */
  --uied-font-size-lg: 1.6rem;  /* 16px */
  --uied-font-size-xl: 1.8rem;  /* 18px */
  --uied-font-size-2xl: 2rem;   /* 20px */
  --uied-font-size-3xl: 2.4rem; /* 24px */

  /* Spacing */
  --uied-space-xs: 0.4rem;      /* 4px */
  --uied-space-sm: 0.8rem;      /* 8px */
  --uied-space-md: 1.2rem;      /* 12px */
  --uied-space-lg: 1.6rem;      /* 16px */
  --uied-space-xl: 2rem;        /* 20px */
  --uied-space-2xl: 2.4rem;     /* 24px */
  --uied-space-3xl: 3.2rem;     /* 32px */

  /* Layout */
  --uied-container-max: 430px;
  --uied-header-height: 60px;
  --uied-bottom-nav-height: 64px;
  --uied-border-radius: 0.8rem;
  --uied-border-radius-lg: 1.2rem;
  --uied-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --uied-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);

  /* Transitions */
  --uied-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --uied-transition-fast: all 0.15s 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(--uied-font-primary);
  font-size: var(--uied-font-size-base);
  line-height: 1.5;
  color: var(--uied-text-primary);
  background-color: var(--uied-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.uied-container {
  max-width: var(--uied-container-max);
  margin: 0 auto;
  padding: 0 var(--uied-space-md);
}

.uied-wrapper {
  min-height: 100vh;
  padding-bottom: var(--uied-bottom-nav-height);
}

@media (min-width: 769px) {
  .uied-wrapper {
    padding-bottom: 0;
  }
}

.uied-grid {
  display: grid;
  gap: var(--uied-space-md);
}

.uied-flex {
  display: flex;
  align-items: center;
}

.uied-flex-col {
  display: flex;
  flex-direction: column;
}

.uied-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.uied-text-center {
  text-align: center;
}

.uied-text-primary {
  color: var(--uied-primary);
}

.uied-text-secondary {
  color: var(--uied-secondary);
}

.uied-text-muted {
  color: var(--uied-text-muted);
}

/* Header */
.uied-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--uied-header-height);
  background: linear-gradient(135deg, var(--uied-bg-primary) 0%, var(--uied-bg-secondary) 100%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--uied-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.uied-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 var(--uied-space-md);
}

.uied-logo {
  display: flex;
  align-items: center;
  gap: var(--uied-space-sm);
  text-decoration: none;
  color: var(--uied-text-primary);
  font-weight: 700;
  font-size: var(--uied-font-size-lg);
}

.uied-logo img {
  width: 28px;
  height: 28px;
  border-radius: var(--uied-border-radius);
}

.uied-header-actions {
  display: flex;
  align-items: center;
  gap: var(--uied-space-sm);
}

.uied-btn {
  padding: var(--uied-space-sm) var(--uied-space-md);
  border: none;
  border-radius: var(--uied-border-radius);
  font-size: var(--uied-font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--uied-transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px; /* Touch-friendly */
  white-space: nowrap;
}

.uied-btn-primary {
  background: linear-gradient(135deg, var(--uied-primary) 0%, var(--uied-hover) 100%);
  color: white;
  box-shadow: var(--uied-shadow);
}

.uied-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--uied-shadow-lg);
}

.uied-btn-outline {
  background: transparent;
  color: var(--uied-secondary);
  border: 2px solid var(--uied-secondary);
}

.uied-btn-outline:hover {
  background: var(--uied-secondary);
  color: var(--uied-dark);
}

.uied-menu-toggle {
  background: none;
  border: none;
  color: var(--uied-text-primary);
  font-size: 24px;
  cursor: pointer;
  padding: var(--uied-space-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

/* Mobile Menu */
.uied-mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: var(--uied-bg-primary);
  z-index: 9999;
  transition: right 0.3s ease;
  overflow-y: auto;
  border-left: 1px solid var(--uied-border);
}

.uied-mobile-menu.active {
  right: 0;
}

.uied-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: var(--uied-transition);
}

.uied-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.uied-menu-header {
  padding: var(--uied-space-lg);
  border-bottom: 1px solid var(--uied-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.uied-menu-close {
  background: none;
  border: none;
  color: var(--uied-text-primary);
  font-size: 24px;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uied-menu-nav {
  padding: var(--uied-space-md);
}

.uied-menu-item {
  display: block;
  padding: var(--uied-space-md);
  color: var(--uied-text-primary);
  text-decoration: none;
  border-radius: var(--uied-border-radius);
  transition: var(--uied-transition);
  margin-bottom: var(--uied-space-xs);
}

.uied-menu-item:hover {
  background: var(--uied-bg-secondary);
  color: var(--uied-primary);
}

/* Main Content */
.uied-main {
  margin-top: var(--uied-header-height);
  min-height: calc(100vh - var(--uied-header-height) - var(--uied-bottom-nav-height));
}

@media (min-width: 769px) {
  .uied-main {
    min-height: calc(100vh - var(--uied-header-height));
  }
}

/* Hero Carousel */
.uied-carousel {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: var(--uied-border-radius-lg);
  margin-bottom: var(--uied-space-xl);
}

.uied-carousel-inner {
  position: relative;
  width: 100%;
  height: 100%;
}

.uied-carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  cursor: pointer;
}

.uied-carousel-slide.active {
  opacity: 1;
}

.uied-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.uied-carousel-indicators {
  position: absolute;
  bottom: var(--uied-space-sm);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--uied-space-xs);
}

.uied-carousel-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: var(--uied-transition-fast);
}

.uied-carousel-indicator.active {
  background: var(--uied-primary);
  transform: scale(1.2);
}

/* Game Grid */
.uied-game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--uied-space-sm);
  margin-bottom: var(--uied-space-xl);
}

.uied-game-card {
  background: var(--uied-bg-secondary);
  border-radius: var(--uied-border-radius);
  overflow: hidden;
  transition: var(--uied-transition);
  cursor: pointer;
  border: 1px solid var(--uied-border);
}

.uied-game-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--uied-shadow);
  border-color: var(--uied-primary);
}

.uied-game-image {
  width: 100%;
  height: 60px;
  object-fit: cover;
  background: var(--uied-accent);
}

.uied-game-name {
  font-size: var(--uied-font-size-xs);
  text-align: center;
  padding: var(--uied-space-xs);
  color: var(--uied-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Content Sections */
.uied-section {
  margin-bottom: var(--uied-space-2xl);
}

.uied-section-title {
  font-size: var(--uied-font-size-xl);
  font-weight: 700;
  color: var(--uied-text-primary);
  margin-bottom: var(--uied-space-lg);
  text-align: center;
}

.uied-section-content {
  background: var(--uied-bg-secondary);
  border-radius: var(--uied-border-radius-lg);
  padding: var(--uied-space-lg);
  border: 1px solid var(--uied-border);
}

.uied-text-content {
  line-height: 1.6;
  color: var(--uied-text-secondary);
  margin-bottom: var(--uied-space-md);
}

.uied-text-content p {
  margin-bottom: var(--uied-space-md);
}

.uied-text-content a {
  color: var(--uied-primary);
  text-decoration: none;
  font-weight: 600;
}

.uied-text-content a:hover {
  color: var(--uied-hover);
  text-decoration: underline;
}

/* Buttons */
.uied-btn-large {
  padding: var(--uied-space-md) var(--uied-space-xl);
  font-size: var(--uied-font-size-base);
  min-height: 48px;
}

.uied-btn-block {
  width: 100%;
  display: block;
}

/* Footer */
.uied-footer {
  background: var(--uied-bg-primary);
  border-top: 1px solid var(--uied-border);
  padding: var(--uied-space-xl) 0 var(--uied-space-md);
  margin-top: var(--uied-space-3xl);
}

.uied-footer-content {
  text-align: center;
}

.uied-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--uied-space-md);
  margin-bottom: var(--uied-space-lg);
}

.uied-footer-link {
  color: var(--uied-text-muted);
  text-decoration: none;
  font-size: var(--uied-font-size-sm);
  transition: var(--uied-transition);
}

.uied-footer-link:hover {
  color: var(--uied-primary);
}

.uied-partners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--uied-space-md);
  margin: var(--uied-space-lg) 0;
}

.uied-partner-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  opacity: 0.7;
  transition: var(--uied-transition);
}

.uied-partner-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

.uied-copyright {
  color: var(--uied-text-muted);
  font-size: var(--uied-font-size-xs);
  margin-top: var(--uied-space-lg);
}

/* Bottom Navigation */
.uied-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--uied-bottom-nav-height);
  background: linear-gradient(135deg, var(--uied-bg-primary) 0%, var(--uied-bg-secondary) 100%);
  border-top: 1px solid var(--uied-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: var(--uied-space-xs) 0;
}

@media (min-width: 769px) {
  .uied-bottom-nav {
    display: none;
  }
}

.uied-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  min-height: 60px;
  padding: var(--uied-space-xs);
  text-decoration: none;
  color: var(--uied-text-muted);
  transition: var(--uied-transition);
  border-radius: var(--uied-border-radius);
}

.uied-bottom-nav-item:hover,
.uied-bottom-nav-item.active {
  color: var(--uied-primary);
  background: rgba(153, 102, 204, 0.1);
  transform: translateY(-2px);
}

.uied-bottom-nav-icon {
  font-size: 24px;
  margin-bottom: var(--uied-space-xs);
  transition: var(--uied-transition);
}

.uied-bottom-nav-item:hover .uied-bottom-nav-icon,
.uied-bottom-nav-item.active .uied-bottom-nav-icon {
  color: var(--uied-primary);
  transform: scale(1.1);
}

.uied-bottom-nav-label {
  font-size: var(--uied-font-size-xs);
  font-weight: 500;
  text-align: center;
  line-height: 1;
}

/* Scroll to Top Button */
.uied-scroll-top {
  position: fixed;
  bottom: calc(var(--uied-bottom-nav-height) + var(--uied-space-md));
  right: var(--uied-space-md);
  width: 48px;
  height: 48px;
  background: var(--uied-primary);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--uied-shadow-lg);
  transition: var(--uied-transition);
  opacity: 0;
  visibility: hidden;
  z-index: 999;
}

.uied-scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.uied-scroll-top:hover {
  transform: translateY(-2px);
  background: var(--uied-hover);
}

/* Responsive Design */
@media (max-width: 768px) {
  .uied-main {
    padding-bottom: var(--uied-bottom-nav-height);
  }

  .uied-game-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--uied-space-xs);
  }

  .uied-carousel {
    height: 160px;
  }

  .uied-section-content {
    padding: var(--uied-space-md);
  }

  .uied-footer-links {
    gap: var(--uied-space-sm);
  }

  .uied-partners {
    gap: var(--uied-space-sm);
  }
}

@media (max-width: 480px) {
  .uied-game-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .uied-carousel {
    height: 140px;
  }

  .uied-header-actions {
    gap: var(--uied-space-xs);
  }

  .uied-btn {
    padding: var(--uied-space-xs) var(--uied-space-sm);
    font-size: var(--uied-font-size-xs);
    min-height: 40px;
  }
}

/* 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 */
.uied-btn:focus,
.uied-menu-item:focus,
.uied-bottom-nav-item:focus {
  outline: 2px solid var(--uied-primary);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --uied-border: #ffffff;
    --uied-text-muted: #ffffff;
  }
}

/* Print styles */
@media print {
  .uied-header,
  .uied-bottom-nav,
  .uied-scroll-top {
    display: none !important;
  }

  .uied-wrapper {
    padding-bottom: 0 !important;
  }
}