/* ============================================================
   GameNova Frontend — layout.css
   Navbar, Footer, Page Structure
   RULE: No max-width anywhere — 100% fluid on all screens
   ============================================================ */

/* ══════════════════════════════════════════
   NAVBAR
══════════════════════════════════════════ */
.navbar {
  position:         fixed;
  top:              0;
  left:             0;
  width:            100%;
  height:           var(--navbar-height);
  background:       var(--bg-navbar);
  backdrop-filter:  blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom:    1px solid var(--border-color);
  z-index:          var(--z-navbar);
  transition:       background var(--transition-base),
                    border-color var(--transition-base);
}

/* Scrolled state — JS adds this class */
.navbar.scrolled {
  background:    rgba(7, 7, 15, 0.98);
  border-bottom: 1px solid rgba(124, 58, 237, 0.25);
  box-shadow:    0 4px 24px rgba(0, 0, 0, 0.5);
}

.navbar-inner {
  width:           100%;
  height:          100%;
  padding:         0 var(--page-pad);
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             1.5rem;
}

/* Logo */
.navbar-logo {
  display:     flex;
  align-items: center;
  gap:         0.5rem;
  flex-shrink: 0;
  text-decoration: none;
}

.navbar-logo .logo-text {
  font-family:    var(--font-display);
  font-size:      1.7rem;
  font-weight:    700;
  color:          var(--text-white);
  letter-spacing: 0.02em;
  line-height:    1;
}

.navbar-logo .logo-text span {
  color: var(--neon-purple-bright);
}

/* Search bar in navbar */
.navbar-search {
  flex:         1;
  position:     relative;
  max-width:    none; /* fluid */
}

.navbar-search input {
  width:            100%;
  height:           40px;
  padding:          0 1rem 0 2.75rem;
  background:       var(--bg-input);
  border:           1px solid var(--border-color);
  border-radius:    var(--border-radius-full);
  color:            var(--text-primary);
  font-size:        var(--font-size-sm);
  transition:       border-color var(--transition-fast),
                    background var(--transition-fast),
                    box-shadow var(--transition-fast);
  outline:          none;
}

.navbar-search input::placeholder {
  color: var(--text-muted);
}

.navbar-search input:focus {
  background:    var(--bg-input-focus);
  border-color:  var(--neon-purple);
  box-shadow:    0 0 0 3px var(--neon-purple-soft);
}

.navbar-search .search-icon {
  position:   absolute;
  left:       0.85rem;
  top:        50%;
  transform:  translateY(-50%);
  color:      var(--text-muted);
  font-size:  1rem;
  pointer-events: none;
}

/* Search suggestions dropdown */
.search-suggestions {
  position:         absolute;
  top:              calc(100% + 8px);
  left:             0;
  width:            100%;
  background:       var(--bg-card);
  border:           1px solid var(--border-color);
  border-radius:    var(--border-radius);
  box-shadow:       var(--shadow-lg);
  overflow:         hidden;
  z-index:          var(--z-dropdown);
  display:          none;
}

.search-suggestions.active {
  display: block;
}

.suggestion-item {
  display:         flex;
  align-items:     center;
  gap:             0.75rem;
  padding:         0.6rem 1rem;
  cursor:          pointer;
  transition:      background var(--transition-fast);
}

.suggestion-item:hover,
.suggestion-item.active {
  background: var(--neon-purple-soft);
}

.suggestion-item img {
  width:         36px;
  height:        36px;
  object-fit:    cover;
  border-radius: var(--border-radius-sm);
  flex-shrink:   0;
}

.suggestion-item span {
  font-size:     var(--font-size-sm);
  color:         var(--text-primary);
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
}

.suggestion-empty {
  padding:    1rem;
  text-align: center;
  color:      var(--text-muted);
  font-size:  var(--font-size-sm);
}

/* Navbar Links */
.navbar-links {
  display:      flex;
  align-items:  center;
  gap:          0.25rem;
  flex-shrink:  0;
}

.navbar-links a {
  display:         flex;
  align-items:     center;
  gap:             0.35rem;
  padding:         0.45rem 0.85rem;
  border-radius:   var(--border-radius-full);
  color:           var(--text-secondary);
  font-size:       var(--font-size-sm);
  font-weight:     500;
  transition:      color var(--transition-fast),
                   background var(--transition-fast);
  white-space:     nowrap;
}

.navbar-links a:hover {
  color:       var(--text-white);
  background:  var(--bg-glass);
}

.navbar-links a.active {
  color:       var(--neon-purple-bright);
  background:  var(--neon-purple-soft);
}

/* Hamburger (mobile) */
.navbar-hamburger {
  display:        none;
  flex-direction: column;
  gap:            5px;
  padding:        0.5rem;
  cursor:         pointer;
  flex-shrink:    0;
}

.navbar-hamburger span {
  display:          block;
  width:            22px;
  height:           2px;
  background:       var(--text-secondary);
  border-radius:    2px;
  transition:       transform var(--transition-base),
                    opacity var(--transition-base);
}

/* Mobile Menu Overlay */
.mobile-menu {
  display:     none;
  position:    fixed;
  top:         var(--navbar-height);
  left:        0;
  width:       100%;
  background:  rgba(7, 7, 15, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding:     1rem var(--page-pad);
  z-index:     calc(var(--z-navbar) - 1);
  flex-direction: column;
  gap:         0.25rem;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu a {
  padding:       0.75rem 1rem;
  border-radius: var(--border-radius);
  color:         var(--text-secondary);
  font-size:     var(--font-size-md);
  font-weight:   500;
  border:        1px solid transparent;
  transition:    all var(--transition-fast);
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color:            var(--text-white);
  background:       var(--neon-purple-soft);
  border-color:     rgba(124, 58, 237, 0.3);
}

/* ══════════════════════════════════════════
   MAIN LAYOUT / PAGE WRAPPER
══════════════════════════════════════════ */
.page-wrapper {
  padding-top: var(--navbar-height);
  min-height:  100vh;
  width:       100%;
}

/* ── Page Section ── */
.page-section {
  width:   100%;
  padding: var(--section-gap) var(--page-pad);
}

.page-section--tight {
  padding-top:    1.5rem;
  padding-bottom: 1.5rem;
}

.page-section--flush {
  padding-left:  0;
  padding-right: 0;
}

/* ── Section Header ── */
.section-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   1.5rem;
  gap:             1rem;
}

.section-title {
  font-family:    var(--font-display);
  font-size:      var(--font-size-2xl);
  font-weight:    700;
  color:          var(--text-white);
  letter-spacing: 0.01em;
  display:        flex;
  align-items:    center;
  gap:            0.6rem;
}

.section-title .title-icon {
  font-size: 1.2em;
}

.section-see-all {
  font-size:   var(--font-size-sm);
  font-weight: 500;
  color:       var(--neon-purple-bright);
  white-space: nowrap;
  padding:     0.35rem 0.85rem;
  border:      1px solid rgba(124, 58, 237, 0.35);
  border-radius: var(--border-radius-full);
  transition:  all var(--transition-fast);
}

.section-see-all:hover {
  background:    var(--neon-purple-soft);
  border-color:  var(--neon-purple);
  color:         var(--text-white);
}

/* ══════════════════════════════════════════
   HERO SECTION
══════════════════════════════════════════ */
.hero {
  position:   relative;
  width:      100%;
  min-height: clamp(300px, 45vw, 600px);
  overflow:   hidden;
  display:    flex;
  align-items: flex-end;
}

.hero-bg {
  position:   absolute;
  inset:      0;
  width:      100%;
  height:     100%;
  object-fit: cover;
  z-index:    0;
}

.hero-overlay {
  position:   absolute;
  inset:      0;
  background: linear-gradient(
    to top,
    rgba(7, 7, 15, 1) 0%,
    rgba(7, 7, 15, 0.7) 40%,
    rgba(7, 7, 15, 0.2) 100%
  );
  z-index:    1;
}

.hero-content {
  position:  relative;
  z-index:   2;
  width:     100%;
  padding:   2.5rem var(--page-pad);
}

.hero-tag {
  display:         inline-flex;
  align-items:     center;
  gap:             0.4rem;
  padding:         0.3rem 0.9rem;
  background:      var(--neon-pink-soft);
  border:          1px solid rgba(255, 45, 120, 0.35);
  border-radius:   var(--border-radius-full);
  color:           var(--neon-pink);
  font-size:       var(--font-size-xs);
  font-weight:     600;
  letter-spacing:  0.06em;
  text-transform:  uppercase;
  margin-bottom:   0.85rem;
}

.hero-title {
  font-family:    var(--font-display);
  font-size:      clamp(2rem, 4vw, 3.5rem);
  font-weight:    700;
  color:          var(--text-white);
  margin-bottom:  0.6rem;
  line-height:    var(--line-height-display);
  max-width:      700px;
}

.hero-desc {
  font-size:     clamp(0.875rem, 1.2vw, 1rem);
  color:         var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width:     500px;
  line-height:   1.6;
}

.hero-actions {
  display:    flex;
  gap:        0.75rem;
  flex-wrap:  wrap;
  align-items: center;
}

/* ══════════════════════════════════════════
   CATEGORY FILTER BAR
══════════════════════════════════════════ */
.category-bar {
  width:        100%;
  padding:      0 var(--page-pad);
  border-bottom: 1px solid var(--border-color);
  background:   var(--bg-secondary);
}

.category-bar-inner {
  display:    flex;
  gap:        0.4rem;
  overflow-x: auto;
  padding:    0.75rem 0;
  scrollbar-width: none;
}

.category-bar-inner::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  display:         flex;
  align-items:     center;
  gap:             0.4rem;
  padding:         0.4rem 1rem;
  border-radius:   var(--border-radius-full);
  border:          1px solid var(--border-color);
  background:      transparent;
  color:           var(--text-secondary);
  font-size:       var(--font-size-sm);
  font-weight:     500;
  white-space:     nowrap;
  cursor:          pointer;
  transition:      all var(--transition-fast);
  flex-shrink:     0;
}

.cat-chip:hover {
  border-color: var(--neon-purple);
  color:        var(--neon-purple-bright);
  background:   var(--neon-purple-soft);
}

.cat-chip.active {
  background:   var(--neon-purple);
  border-color: var(--neon-purple);
  color:        var(--text-white);
  box-shadow:   var(--glow-purple);
}

.cat-chip .chip-icon {
  font-size: 1rem;
}

/* ══════════════════════════════════════════
   GAME EMBED PAGE LAYOUT
══════════════════════════════════════════ */
.game-page-layout {
  width:   100%;
  padding: 1.5rem var(--page-pad);
  display: flex;
  flex-direction: column;
  gap:     2rem;
}

.game-embed-wrapper {
  position:      relative;
  width:         100%;
  background:    #000;
  border-radius: var(--border-radius-lg);
  overflow:      hidden;
  border:        1px solid var(--border-color);
  box-shadow:    var(--glow-purple);
}

.game-embed-frame {
  width:  100%;
  height: clamp(400px, 60vw, 800px);
  border: none;
  display: block;
}

/* Fullscreen & loading overlay on embed */
.game-embed-overlay {
  position:        absolute;
  inset:           0;
  display:         flex;
  align-items:     center;
  justify-content: center;
  background:      var(--bg-page);
  z-index:         5;
  transition:      opacity var(--transition-slow);
}

.game-embed-overlay.hidden {
  opacity:         0;
  pointer-events:  none;
}

.game-controls {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         0.75rem 1rem;
  background:      var(--bg-secondary);
  border-top:      1px solid var(--border-color);
}

.game-info-bar {
  display:     flex;
  align-items: center;
  gap:         1rem;
  flex-wrap:   wrap;
}

.game-title-display {
  font-family:  var(--font-display);
  font-size:    var(--font-size-xl);
  font-weight:  700;
  color:        var(--text-white);
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
.site-footer {
  width:            100%;
  background:       var(--bg-footer);
  border-top:       1px solid var(--border-color);
  padding:          2.5rem var(--page-pad) 1.5rem;
  margin-top:       auto;
}

.footer-inner {
  width:   100%;
  display: flex;
  gap:     3rem;
  flex-wrap: wrap;
  align-items: flex-start;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.footer-brand {
  flex: 1;
  min-width: 200px;
}

.footer-brand .logo-text {
  font-family:  var(--font-display);
  font-size:    1.6rem;
  font-weight:  700;
  color:        var(--text-white);
  display:      block;
  margin-bottom: 0.6rem;
}

.footer-brand .logo-text span {
  color: var(--neon-purple-bright);
}

.footer-brand p {
  font-size:   var(--font-size-sm);
  color:       var(--text-muted);
  line-height: 1.6;
}

.footer-links-group {
  min-width: 140px;
}

.footer-links-group h4 {
  font-size:      var(--font-size-sm);
  font-weight:    600;
  color:          var(--text-primary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom:  0.85rem;
}

.footer-links-group ul {
  display:       flex;
  flex-direction: column;
  gap:           0.5rem;
}

.footer-links-group a {
  font-size:  var(--font-size-sm);
  color:      var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-links-group a:hover {
  color: var(--text-white);
}

.footer-bottom {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  gap:             1rem;
  flex-wrap:       wrap;
}

.footer-copy {
  font-size: var(--font-size-sm);
  color:     var(--text-muted);
}

.footer-copy span {
  color: var(--neon-purple-bright);
}

/* ══════════════════════════════════════════
   PAGE HEADER (Category / All Games / Search)
══════════════════════════════════════════ */
.page-header {
  width:          100%;
  padding:        2rem var(--page-pad) 1.5rem;
  background:     linear-gradient(
    to bottom,
    var(--bg-secondary) 0%,
    transparent 100%
  );
  border-bottom:  1px solid var(--border-color);
}

.page-header-title {
  font-family:    var(--font-display);
  font-size:      var(--font-size-3xl);
  font-weight:    700;
  color:          var(--text-white);
  margin-bottom:  0.4rem;
  display:        flex;
  align-items:    center;
  gap:            0.6rem;
}

.page-header-sub {
  font-size:  var(--font-size-sm);
  color:      var(--text-muted);
}

/* ══════════════════════════════════════════
   RESPONSIVE — Navbar / Layout
══════════════════════════════════════════ */

/* Tablet — 768px */
@media (max-width: 768px) {
  .navbar-links {
    display: none;
  }

  .navbar-hamburger {
    display: flex;
  }

  .navbar-search {
    max-width: none;
  }

  .hero-title {
    font-size: clamp(1.5rem, 6vw, 2.5rem);
  }

  .footer-inner {
    gap: 2rem;
  }
}

/* Mobile — 480px */
@media (max-width: 480px) {
  :root {
    --navbar-height: 56px;
    --section-gap:   2rem;
  }

  .navbar-inner {
    gap: 0.75rem;
  }

  .hero {
    min-height: 260px;
  }

  .hero-content {
    padding: 1.5rem var(--page-pad);
  }

  .page-header-title {
    font-size: var(--font-size-2xl);
  }
}
