/* Global styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Root level - catches overscroll on all browsers */
:root {
  background-color: #000000;

  /* QualityNode theme aliases to Codex accent system */
  --qn-primary: var(--codex-accent, #059669);
  --qn-secondary: var(--codex-accent-secondary, #047857);
  --qn-gradient: var(--codex-accent-gradient, linear-gradient(135deg, #059669 0%, #0891B2 100%));
  --qn-glow: rgba(var(--codex-accent-rgb, 5, 150, 105), 0.35);
  --qn-glow-light: rgba(var(--codex-accent-rgb, 5, 150, 105), 0.1);
  --qn-border: var(--codex-accent-border, rgba(5, 150, 105, 0.25));
}

html {
  background-color: #000000;
  /* Prevent white flash on overscroll */
  overscroll-behavior: none;
}

body {
  font-family: 'Akzidenz-GroteskPro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #000000;
  color: #FAFAFA;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  /* Prevent white flash on overscroll */
  overscroll-behavior: none;
}

/* Headings use ITCAvantGardeStd */
h1, h2, h3, h4, h5, h6 {
  font-family: 'ITCAvantGardeStd', 'Akzidenz-GroteskPro', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Loading indicator */
#loading-indicator {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000000;
  z-index: 9999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
}

body.loading #loading-indicator {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(5, 150, 105, 0.2);
  border-top-color: #059669;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

#loading-indicator p {
  color: #A1A1AA;
  font-size: 14px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0A0A0B;
}

::-webkit-scrollbar-thumb {
  background: var(--qn-primary, #059669);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--qn-secondary, #047857);
}

/* Selection */
::selection {
  background: var(--qn-glow, rgba(5, 150, 105, 0.35));
  color: #FAFAFA;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--qn-primary, #059669);
  outline-offset: 2px;
}

/* Link hover states */
a:hover {
  color: var(--qn-secondary, #047857) !important;
}

/* Button hover states */
button:hover {
  opacity: 0.9;
}

/* Card hover states */
.card:hover,
[class*="feature"]:hover {
  border-color: var(--qn-border, rgba(5, 150, 105, 0.25)) !important;
  transform: translateY(-2px);
}

/* Dropdown menu styles */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > a {
  padding: 8px 12px;
  color: #A1A1AA;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-dropdown > a:hover,
.nav-dropdown:hover > a {
  color: #FAFAFA !important;
  background: var(--qn-glow-light, rgba(5, 150, 105, 0.1));
}

.nav-dropdown > a span {
  font-size: 10px;
  opacity: 0.6;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-dropdown:hover > a span {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #12121A;
  border: 1px solid var(--qn-border, rgba(5, 150, 105, 0.25));
  border-radius: 12px;
  padding: 16px;
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--qn-glow-light, rgba(5, 150, 105, 0.1));
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  color: #E4E4E7;
  transition: all 0.15s ease;
}

.nav-dropdown-item:hover {
  background: var(--qn-glow-light, rgba(5, 150, 105, 0.1));
  color: var(--qn-primary, #059669) !important;
}

.nav-dropdown-icon {
  width: 44px;
  height: 44px;
  background: var(--qn-glow-light, rgba(5, 150, 105, 0.1));
  border: 1px solid var(--qn-border, rgba(5, 150, 105, 0.25));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.nav-dropdown-content h4 {
  font-size: 14px;
  font-weight: 600;
  color: #FAFAFA;
  margin: 0 0 4px 0;
}

.nav-dropdown-content p {
  font-size: 12px;
  color: #A1A1AA;
  margin: 0;
  line-height: 1.4;
}

/* Games carousel animation */
@keyframes scroll-games {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.games-carousel-track {
  animation: scroll-games 60s linear infinite;
}

.games-carousel-track:hover {
  animation-play-state: paused;
}

/* Auth page animations */
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.05); }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(2deg); }
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.6; }
}
