/* ==========================================================================
   GRAND THEFT AUTO VI - OFFICIAL VICE CITY LOADING SCREEN DESIGN SYSTEM
   --------------------------------------------------------------------------
   Authentic GTA V / GTA VI loading screen visual styling:
   - Fullscreen artwork slideshow with dynamic Ken Burns pan & zoom parallax
   - Official-style Grand Theft Auto VI logo typography & Vice City neon VI badge
   - Authentic GTA segmented circular loading spinner
   - Translucent dark bottom UI bar with gold header line & Rockstar emblem
   - Glassmorphic slide badge & Vice City neon glow effects
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & COLOR PALETTE
   -------------------------------------------------------------------------- */
:root {
  /* Core Palette */
  --gta-black: #05020a;
  --gta-dark: #0d0714;
  --gta-gold: #f5c400;
  --gta-gold-glow: rgba(245, 196, 0, 0.4);
  --gta-pink: #ff007f;
  --gta-pink-glow: rgba(255, 0, 127, 0.5);
  --gta-cyan: #00f0ff;
  --gta-cyan-glow: rgba(0, 240, 255, 0.5);
  --gta-orange: #ff5e00;
  
  /* Typography */
  --font-gta: 'Montserrat', 'Impact', -apple-system, sans-serif;
  --font-serif: 'Cinzel', serif;
  --font-body: 'Outfit', 'Inter', sans-serif;

  /* Glass & Overlay */
  --bar-bg: rgba(7, 3, 12, 0.88);
  --glass-border: rgba(255, 255, 255, 0.15);
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. GLOBAL RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--gta-black);
  font-family: var(--font-body);
  color: #ffffff;
  cursor: default;
}

.viewport-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  perspective: 1000px;
}

.camera-wrapper {
  position: absolute;
  top: -2%;
  left: -2%;
  width: 104%;
  height: 104%;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

/* --------------------------------------------------------------------------
   3. ARTWORK SLIDESHOW CONTAINER & KEN BURNS ANIMATIONS
   -------------------------------------------------------------------------- */
.slideshow-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.4s ease;
  overflow: hidden;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
  will-change: transform;
}

/* Dynamic Ken Burns Pan & Zoom Variations */
.slide.active .ken-burns-1 {
  animation: kenBurnsZoomIn 8.5s ease-out forwards;
}

.slide.active .ken-burns-2 {
  animation: kenBurnsPanRight 8.5s ease-out forwards;
}

.slide.active .ken-burns-3 {
  animation: kenBurnsPanLeft 8.5s ease-out forwards;
}

.slide.active .ken-burns-4 {
  animation: kenBurnsZoomOut 8.5s ease-out forwards;
}

.slide.active .ken-burns-5 {
  animation: kenBurnsPanUp 8.5s ease-out forwards;
}

@keyframes kenBurnsZoomIn {
  0% { transform: scale(1.0); }
  100% { transform: scale(1.12) translate(-10px, -5px); }
}

@keyframes kenBurnsPanRight {
  0% { transform: scale(1.08) translate(-20px, 0); }
  100% { transform: scale(1.14) translate(15px, -10px); }
}

@keyframes kenBurnsPanLeft {
  0% { transform: scale(1.08) translate(20px, -5px); }
  100% { transform: scale(1.14) translate(-15px, 5px); }
}

@keyframes kenBurnsZoomOut {
  0% { transform: scale(1.15) translate(0, 0); }
  100% { transform: scale(1.02) translate(-10px, 10px); }
}

@keyframes kenBurnsPanUp {
  0% { transform: scale(1.05) translate(0, 15px); }
  100% { transform: scale(1.12) translate(-10px, -15px); }
}

/* Atmospheric Vignette Gradient overlay */
.slide-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at center, transparent 40%, rgba(5, 2, 10, 0.65) 85%, rgba(5, 2, 10, 0.95) 100%),
    linear-gradient(180deg, rgba(5, 2, 10, 0.7) 0%, transparent 20%, transparent 75%, rgba(5, 2, 10, 0.85) 100%);
  pointer-events: none;
}

/* Canvas overlay */
#fx-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   4. TOP BRANDING BAR & OFFICIAL GTA VI LOGO
   -------------------------------------------------------------------------- */
.top-branding-bar {
  position: absolute;
  top: 30px;
  left: 40px;
  right: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 10;
  pointer-events: none;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
}

/* Official Grand Theft Auto VI Logo Box */
.gta-logo-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.9));
}

.gta-title-stack {
  display: flex;
  flex-direction: column;
  line-height: 0.82;
  font-family: var(--font-gta);
  font-weight: 900;
  text-transform: lowercase;
  letter-spacing: -1.5px;
}

.gta-word {
  font-size: 2.8rem;
  color: #ffffff;
  -webkit-text-stroke: 2px #000000;
  text-shadow: 
    3px 3px 0 #000000,
    -2px -2px 0 #000000,
    2px -2px 0 #000000,
    -2px 2px 0 #000000,
    0 4px 15px rgba(0, 0, 0, 0.9);
}

/* Neon Vice City "VI" Badge */
.gta-vi-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 18px;
  background: linear-gradient(135deg, #ff007f 0%, #ff5e00 50%, #00f0ff 100%);
  border: 3px solid #ffffff;
  border-radius: 6px;
  box-shadow: 
    0 0 25px var(--gta-pink-glow),
    0 0 10px var(--gta-cyan-glow),
    inset 0 0 12px rgba(255, 255, 255, 0.8);
  transform: rotate(-3deg);
}

.vi-text {
  font-family: var(--font-serif);
  font-size: 3.4rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 0.9;
  letter-spacing: 2px;
  -webkit-text-stroke: 1.5px #000000;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

.vi-shine {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
  pointer-events: none;
}

/* Location Badge */
.location-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(10, 5, 18, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--gta-pink);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ffffff;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.loc-icon {
  font-size: 1rem;
}

/* Audio Toggle Button */
.icon-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(10, 5, 18, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  background: rgba(255, 0, 127, 0.25);
  border-color: var(--gta-pink);
  box-shadow: 0 0 20px var(--gta-pink-glow);
}

/* Audio Waves Animation */
.audio-waves {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 14px;
}

.wave-bar {
  width: 3px;
  height: 100%;
  background-color: var(--gta-pink);
  border-radius: 2px;
  animation: wavePulse 1.2s ease-in-out infinite alternate;
}

.wave-bar:nth-child(2) { animation-delay: 0.2s; }
.wave-bar:nth-child(3) { animation-delay: 0.4s; }

.audio-waves.muted .wave-bar {
  animation: none;
  height: 4px;
  background-color: #666;
}

@keyframes wavePulse {
  0% { height: 4px; }
  100% { height: 14px; }
}

/* --------------------------------------------------------------------------
   5. SLIDE TITLE OVERLAY (MIDDLE LEFT)
   -------------------------------------------------------------------------- */
.slide-info-overlay {
  position: absolute;
  left: 40px;
  bottom: 120px;
  z-index: 8;
  max-width: 500px;
  pointer-events: none;
  animation: slideInfoFadeIn 0.8s ease-out;
}

@keyframes slideInfoFadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--gta-gold);
  color: #000000;
  font-weight: 900;
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 2px;
  margin-bottom: 8px;
}

.slide-title {
  font-family: var(--font-gta);
  font-size: 2.6rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 2px 4px 15px rgba(0, 0, 0, 0.9);
}

.slide-subtitle {
  font-size: 1.05rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
  text-shadow: 1px 2px 10px rgba(0, 0, 0, 0.9);
}

/* --------------------------------------------------------------------------
   6. AUTHENTIC GTA 5 / GTA 6 BOTTOM LOADING BAR
   -------------------------------------------------------------------------- */
.gta-footer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 90px;
  background: var(--bar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 10;
}

/* Gold Accent Header Line */
.footer-gold-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gta-pink) 0%, var(--gta-gold) 50%, var(--gta-cyan) 100%);
  box-shadow: 0 0 15px var(--gta-gold-glow);
}

/* Rockstar Games Emblem & Copyright Watermark */
.rockstar-watermark {
  display: flex;
  align-items: center;
  gap: 14px;
}

.r-star-logo {
  position: relative;
  width: 36px;
  height: 36px;
  background: var(--gta-gold);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--gta-gold-glow);
}

.r-letter {
  font-family: var(--font-gta);
  font-size: 1.4rem;
  font-weight: 900;
  color: #000000;
  margin-right: 4px;
}

.star-symbol {
  position: absolute;
  bottom: 2px;
  right: 2px;
  font-size: 0.9rem;
  color: #000000;
}

.copyright-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--gta-gold);
}

.copy-text {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.5px;
}

/* Center: Game Tips Box */
.gta-tips-box {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 550px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.tip-badge {
  padding: 2px 8px;
  background: var(--gta-pink);
  color: #ffffff;
  font-weight: 900;
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  border-radius: 2px;
}

.tip-content {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.35;
  transition: opacity 0.4s ease;
}

.tip-content.fade-out {
  opacity: 0;
}

/* Right: Loading Status & Spinner */
.gta-loading-status {
  display: flex;
  align-items: center;
  gap: 18px;
}

.loading-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stage-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.5px;
}

.percent-label {
  font-family: var(--font-gta);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--gta-gold);
  line-height: 1;
}

/* Authentic GTA Segmented Circular Loading Spinner */
.gta-spinner {
  position: relative;
  width: 32px;
  height: 32px;
  animation: gtaSpinnerRotate 1.2s steps(8) infinite;
}

@keyframes gtaSpinnerRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner-segment {
  position: absolute;
  top: 0;
  left: 14px;
  width: 4px;
  height: 9px;
  background-color: #ffffff;
  border-radius: 2px;
  transform-origin: 2px 16px;
  opacity: 0.2;
}

.spinner-segment:nth-child(1) { transform: rotate(0deg); opacity: 1.0; }
.spinner-segment:nth-child(2) { transform: rotate(45deg); opacity: 0.875; }
.spinner-segment:nth-child(3) { transform: rotate(90deg); opacity: 0.75; }
.spinner-segment:nth-child(4) { transform: rotate(135deg); opacity: 0.625; }
.spinner-segment:nth-child(5) { transform: rotate(180deg); opacity: 0.5; }
.spinner-segment:nth-child(6) { transform: rotate(225deg); opacity: 0.375; }
.spinner-segment:nth-child(7) { transform: rotate(270deg); opacity: 0.25; }
.spinner-segment:nth-child(8) { transform: rotate(315deg); opacity: 0.125; }

/* Interactive GTA Launch Button */
.gta-launch-btn {
  display: none;
  position: relative;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--gta-gold) 0%, #e6a100 100%);
  border: 2px solid #ffffff;
  border-radius: 4px;
  color: #000000;
  font-family: var(--font-gta);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 25px var(--gta-gold-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: pulseBtn 2s infinite alternate;
}

.gta-launch-btn.ready {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gta-launch-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px rgba(245, 196, 0, 0.8);
}

@keyframes pulseBtn {
  0% { box-shadow: 0 0 20px var(--gta-gold-glow); }
  100% { box-shadow: 0 0 35px rgba(255, 255, 255, 0.6); }
}

/* --------------------------------------------------------------------------
   7. GAME START OVERLAY & WELCOME SCREEN
   -------------------------------------------------------------------------- */
.completion-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 99;
  transition: opacity 0.3s ease-out;
}

.completion-flash.active {
  opacity: 1;
}

.welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--gta-black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-in-out;
}

.welcome-screen.show {
  opacity: 1;
  pointer-events: auto;
}

.gta-logo-box.large {
  transform: scale(1.5);
  margin-bottom: 30px;
}

.welcome-title {
  font-family: var(--font-gta);
  font-size: 3rem;
  font-weight: 900;
  color: var(--gta-gold);
  letter-spacing: 2px;
  text-shadow: 0 0 30px var(--gta-gold-glow);
  margin-top: 20px;
}

.welcome-sub {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 1px;
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   8. RESPONSIVE MEDIA QUERIES
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .top-branding-bar {
    top: 20px;
    left: 20px;
    right: 20px;
  }
  
  .gta-word { font-size: 2.0rem; }
  .vi-text { font-size: 2.4rem; }
  
  .gta-tips-box { display: none; }
  .gta-footer-bar { padding: 0 20px; }
  
  .slide-info-overlay {
    left: 20px;
    bottom: 110px;
  }
  .slide-title { font-size: 2rem; }
}

@media (max-width: 600px) {
  .location-badge { display: none; }
  .gta-word { font-size: 1.6rem; }
  .vi-text { font-size: 2.0rem; }
  .slide-title { font-size: 1.6rem; }
  .slide-subtitle { font-size: 0.9rem; }
}
