/* ============================================
   QUEUE & DEQUE MASTERS: THE FIFO CHRONICLES
   Main Stylesheet
   ============================================ */

/* CSS Variables - Neon Arcade Theme */
:root {
  /* Primary Colors */
  --bg-dark: #0f0f1a;
  --bg-darker: #080810;
  --bg-gradient: linear-gradient(135deg, #0f0f1a 0%, #1a1025 50%, #0f0f1a 100%);

  /* Accent Colors */
  --primary: #00d4ff;
  --primary-glow: #00f0ff;
  --secondary: #10b981;
  --accent-gold: #fbbf24;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-orange: #f97316;
  --accent-cyan: #06b6d4;
  --accent-green: #22c55e;

  /* Queue Colors */
  --queue-front: #00d4ff;
  --queue-back: #a855f7;
  --queue-item: linear-gradient(135deg, #00d4ff 0%, #0ea5e9 100%);

  /* Deque Colors */
  --deque-front: #ec4899;
  --deque-back: #8b5cf6;

  /* Text Colors */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* UI */
  --border-color: rgba(0, 212, 255, 0.3);
  --card-bg: rgba(15, 15, 30, 0.9);
  --glass-bg: rgba(255, 255, 255, 0.05);

  /* Fonts */
  --font-display: 'Bebas Neue', sans-serif;
  --font-ui: 'Rajdhani', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Sizing */
  --queue-item-height: 60px;
  --queue-item-width: 100px;
}

/* Reset & Base */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100vh;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================
   ANIMATED BACKGROUND
   ============================================ */
.animated-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.queue-conveyor {
  position: absolute;
  bottom: 50px;
  left: 0;
  width: 100%;
  height: 80px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 212, 255, 0.1),
    transparent
  );
}

.conveyor-item {
  position: absolute;
  font-size: 2rem;
  animation: conveyorMove 15s linear infinite;
  animation-delay: var(--delay);
  opacity: 0.3;
}

@keyframes conveyorMove {
  0% {
    left: -50px;
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    left: 100%;
    opacity: 0;
  }
}

.floating-code {
  position: absolute;
  width: 100%;
  height: 100%;
}

.floating-code span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-family: var(--font-mono);
  font-size: 1rem;
  color: rgba(0, 212, 255, 0.15);
  animation: floatCode var(--duration) ease-in-out infinite;
}

@keyframes floatCode {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) rotate(5deg);
  }
}

/* ============================================
   SCREEN MANAGEMENT
   ============================================ */
.screen {
  position: relative;
  min-height: 100vh;
  display: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.screen.active {
  display: block;
  opacity: 1;
}

/* ============================================
   LOADING SCREEN
   ============================================ */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-gradient);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#loading-screen.active {
  display: flex;
}

.loading-content {
  text-align: center;
}

.queue-animation {
  margin-bottom: 40px;
}

.queue-track {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
}

.queue-ball {
  width: 40px;
  height: 40px;
  background: var(--queue-item);
  border-radius: 10px;
  animation: queuePulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.queue-ball:nth-child(1) {
  animation-delay: 0s;
}
.queue-ball:nth-child(2) {
  animation-delay: 0.2s;
}
.queue-ball:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes queuePulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.arrow-flow {
  display: flex;
  justify-content: center;
  gap: 30px;
  font-size: 1.5rem;
  color: var(--primary);
}

.arrow-flow span {
  animation: arrowMove 1s ease-in-out infinite;
}

.arrow-flow span:nth-child(1) {
  animation-delay: 0s;
}
.arrow-flow span:nth-child(2) {
  animation-delay: 0.2s;
}
.arrow-flow span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes arrowMove {
  0%,
  100% {
    opacity: 0.3;
    transform: translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateX(10px);
  }
}

.loading-title {
  font-family: var(--font-display);
  font-size: 4.5rem;
  letter-spacing: 0.15em;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--accent-purple) 50%,
    var(--accent-pink) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px rgba(0, 212, 255, 0.5);
}

.loading-subtitle {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--text-secondary);
  letter-spacing: 0.4em;
  margin-top: 10px;
}

.loading-bar {
  width: 350px;
  height: 6px;
  background: var(--glass-bg);
  border-radius: 3px;
  margin: 40px auto 20px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.loading-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--primary) 0%,
    var(--accent-purple) 100%
  );
  border-radius: 3px;
  animation: loadProgress 2s ease-out forwards;
  box-shadow: 0 0 20px var(--primary);
}

@keyframes loadProgress {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

.loading-text {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* ============================================
   MAIN HUB
   ============================================ */
#main-hub {
  padding: 0;
  background: var(--bg-gradient);
}

.hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 50px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-icon {
  width: 70px;
  height: 70px;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--accent-purple) 100%
  );
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.4);
}

.q-visual {
  display: flex;
  align-items: center;
  gap: 5px;
}

.q-item {
  font-family: var(--font-display);
  font-size: 2rem;
  color: white;
}

.q-visual .arrow {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  animation: arrowBounce 1s ease-in-out infinite;
}

@keyframes arrowBounce {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(5px);
  }
}

.logo-text h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: 0.1em;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--accent-purple) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text p {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.3em;
}

.progress-summary {
  display: flex;
  gap: 40px;
}

.progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 25px;
  background: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.progress-item .icon {
  font-size: 1.5rem;
}

.progress-item .value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.progress-item .label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============================================
   HUB CONTENT
   ============================================ */
.hub-content {
  padding: 50px;
  max-width: 1600px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 40px;
  text-align: center;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.deque-section {
  margin-top: 80px;
}

.deque-section h2 {
  background: linear-gradient(
    135deg,
    var(--accent-purple) 0%,
    var(--accent-pink) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   GAME CARDS
   ============================================ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.game-card {
  background: var(--card-bg);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 30px;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
  cursor: pointer;
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--card-color);
  box-shadow: 0 0 20px var(--card-glow);
}

.game-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--card-glow) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.game-card:hover {
  transform: translateY(-10px);
  border-color: var(--card-color);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 40px var(--card-glow);
}

.game-card:hover::after {
  opacity: 0.1;
}

.card-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: var(--card-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--bg-dark);
  box-shadow: 0 0 15px var(--card-glow);
}

.card-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 15px var(--card-glow));
}

.game-card h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.05em;
  color: var(--card-color);
  margin-bottom: 5px;
}

.card-subtitle {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.card-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.card-tags span {
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.game-card:hover .card-tags span {
  border-color: var(--card-color);
  color: var(--card-color);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stars {
  font-size: 1.3rem;
  color: var(--accent-gold);
  letter-spacing: 5px;
}

.play-btn {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--card-color);
  transition: all 0.3s ease;
}

.game-card:hover .play-btn {
  transform: translateX(5px);
}

/* ============================================
   FOOTER
   ============================================ */
.hub-footer {
  text-align: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid var(--border-color);
}

.hub-footer p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.hub-footer .version {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  opacity: 0.5;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .hub-header {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
  }

  .hub-content {
    padding: 30px 20px;
  }

  .games-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .loading-title {
    font-size: 2.5rem;
  }

  .logo-text h1 {
    font-size: 1.8rem;
  }

  .progress-summary {
    flex-wrap: wrap;
    justify-content: center;
  }

  .section-header h2 {
    font-size: 1.8rem;
  }

  .game-card {
    padding: 20px;
  }

  .card-icon {
    font-size: 2.5rem;
  }

  .game-card h3 {
    font-size: 1.4rem;
  }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
