/**
 * StreetWarz Idle - Ultra-Minimalist Design System
 * Unity WebGL Player-Centric Experience
 */

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Dark theme with high contrast */
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-overlay: rgba(0, 0, 0, 0.95);
  
  /* Text colors */
  --text-primary: #ffffff;
  --text-secondary: #808080;
  --text-muted: #404040;
  
  /* Accent colors */
  --accent-primary: #ff4500;  /* Orange-red for StreetWarz */
  --accent-hover: #ff6b35;
  --accent-glow: rgba(255, 69, 0, 0.3);
  
  /* UI elements */
  --border-subtle: rgba(255, 255, 255, 0.05);
  --shadow-lg: 0 0 40px rgba(0, 0, 0, 0.8);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms ease;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 100%;
  height: 100%;
  position: relative;
  cursor: default;
  user-select: none;
}

/* ===== FULLSCREEN LAYOUT ===== */
#app {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-primary);
}

/* ===== MINIMAL HEADER ===== */
header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 2rem;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  opacity: 1;
  transition: opacity var(--transition-slow);
}

header.hide-on-play {
  opacity: 0;
  pointer-events: none;
}

header .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1920px;
  margin: 0 auto;
}

header .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

/* ===== GAME CONTAINER ===== */
main {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#gameWrapper {
  width: 100%;
  height: 100%;
  position: relative;
}

/* ===== MINIMAL FOOTER ===== */
footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  z-index: 100;
  opacity: 1;
  transition: opacity var(--transition-slow);
}

footer.hide-on-play {
  opacity: 0;
  pointer-events: none;
}

footer nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  font-size: 0.75rem;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color var(--transition-fast);
  position: relative;
}

footer a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-primary);
  transition: width var(--transition-fast);
}

footer a:hover {
  color: var(--text-secondary);
}

footer a:hover::after {
  width: 100%;
}

/* ===== UNITY WEBGL CONTAINER ===== */
#unityContainer {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#unityContainer.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: default;
}

#gameCanvas canvas {
  width: 100% !important;
  height: 100% !important;
  image-rendering: auto;
}

/* ===== LOADING SCREEN ===== */
#loadingScreen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 2000;
  transition: opacity var(--transition-slow);
}

#loadingScreen.fade-out {
  opacity: 0;
  pointer-events: none;
}

#loadingScreen .loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* ===== MODERN LOADER ===== */
.loader-container {
  position: relative;
  width: 120px;
  height: 120px;
}

.loader-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid var(--border-subtle);
  border-radius: 50%;
}

.loader-ring::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid transparent;
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: rotate 1.5s linear infinite;
}

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

.loading-progress {
  width: 200px;
  height: 2px;
  background: var(--border-subtle);
  border-radius: 1px;
  overflow: hidden;
  position: relative;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
  width: 0;
  transition: width var(--transition-normal);
  box-shadow: 0 0 10px var(--accent-glow);
}

.loading-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-align: center;
}

.loading-percentage {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ===== GAME CONTROLS OVERLAY ===== */
.game-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 200;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

#gameWrapper:hover .game-controls {
  opacity: 1;
}

.control-btn {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}

.control-btn:hover {
  background: rgba(255, 69, 0, 0.1);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.control-btn svg {
  width: 20px;
  height: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  header {
    padding: 1rem;
  }

  header h1 {
    font-size: 1rem;
  }

  .game-controls {
    opacity: 1;
  }

  .control-btn {
    width: 36px;
    height: 36px;
  }

  footer {
    padding: 0.75rem;
  }

  footer nav {
    gap: 1.5rem;
    font-size: 0.7rem;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  header, footer {
    padding: 0.5rem 1rem;
  }

  header h1 {
    font-size: 0.875rem;
  }

  .game-controls {
    top: 0.5rem;
    right: 0.5rem;
  }

  .control-btn {
    width: 32px;
    height: 32px;
  }
}

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn var(--transition-slow) ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.glow {
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
