/* SEEDE Heritage Runner - Branded Styles */

/* CSS Variables for SEEDE Brand Colors */
:root {
  --seede-purple: #663399;
  --seede-orange: #FF6B35;
  --seede-purple-dark: #4d2570;
  --seede-purple-light: #8a4fb8;
  --seede-orange-light: #ff8555;
  --seede-gray: #f8f9fa;
  --seede-dark: #2c2c2c;
}

/* Base Styles */
body {
  padding: 0;
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--seede-purple) 0%, var(--seede-purple-dark) 100%);
  min-height: 100vh;
}

.dark-theme {
  background: linear-gradient(135deg, #1a1a1a 0%, var(--seede-purple-dark) 100%);
  color: #fff;
}

.light-theme {
  background: linear-gradient(135deg, var(--seede-gray) 0%, #ffffff 100%);
  color: var(--seede-dark);
}

/* SEEDE Branded Header */
#game-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: var(--seede-purple);
  padding: 1.5rem 0;
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(102, 51, 153, 0.15);
  border-bottom: 3px solid var(--seede-orange);
}

.brand-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.seede-logo {
  height: 50px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(102, 51, 153, 0.2));
}

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

.game-title {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--seede-purple);
  letter-spacing: -0.5px;
}

.game-subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 0.9rem;
  color: var(--seede-orange);
  font-weight: 500;
}

.controls-hint {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--seede-purple);
}

.control-mobile,
.control-desktop {
  padding: 0.5rem 1rem;
  background: rgba(102, 51, 153, 0.1);
  border-radius: 20px;
  border: 1px solid var(--seede-purple);
}

/* Game Section Container */
.game-section {
  min-height: 70vh; /* Reserve space for the game */
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 2rem 0;
}

/* Unity Container Adjustments */
#unity-container {
  position: relative; /* Changed from absolute */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.unity-desktop {
  /* Remove absolute positioning conflicts */
  position: relative;
}

.unity-mobile {
  width: 100%;
  max-width: 100vw;
  position: relative;
}

#unity-canvas[data-pixel-art="true"] {
  image-rendering: pixelated;
  background: var(--seede-dark);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(102, 51, 153, 0.3);
}

#unity-canvas[data-pixel-art="false"] {
  background: var(--seede-dark);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(102, 51, 153, 0.3);
}

/* Enhanced Loader */
#unity-loader-container {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(102, 51, 153, 0.2);
  border: 2px solid var(--seede-orange);
}

.loader-icon {
  border: 4px solid rgba(102, 51, 153, 0.2);
  border-top: 4px solid var(--seede-orange);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

#loader-text {
  color: var(--seede-purple);
  text-align: center;
  font-family: 'Courier New', monospace;
  font-style: normal;
  font-weight: bold;
  font-size: 1.2rem;
  margin-top: 1rem;
}

.loading-message {
  color: var(--seede-orange);
  font-size: 0.9rem;
  margin: 0.5rem 0 0 0;
  font-weight: 500;
}

.custom-border {
  border-style: outset;
  border-width: medium;
  border-color: var(--seede-orange);
  border-radius: 8px;
}

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

/* Unity Footer Controls - Single Fullscreen Button */
#unity-footer[hide-footer="false"] {
  margin-top: 5px;
  position: relative;
  display: flex;
  justify-content: center;
  width: auto; /* Changed from fixed width */
}

#unity-footer[hide-footer="true"] {
  display: none;
}

/* Enhanced Fullscreen Button with Icon + Text - Blue/White Theme */
#unity-fullscreen-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  color: #1EAED3;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#unity-fullscreen-button:hover {
  background: rgba(255, 255, 255, 1);
  color: #0d7a91;
  opacity: 0.8;
}

#unity-fullscreen-button:active {
  background: rgba(230, 230, 230, 0.9);
}

.fullscreen-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.fullscreen-text {
  font-size: 0.9rem;
  white-space: nowrap;
}

#unity-warning {
  position: absolute;
  left: 50%;
  top: 5%;
  transform: translate(-50%);
  background: var(--seede-orange);
  color: white;
  padding: 15px 20px;
  display: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
  font-weight: 500;
}

/* SEEDE Branded Footer */
#game-footer {
  background: linear-gradient(135deg, var(--seede-purple) 0%, var(--seede-purple-dark) 100%);
  color: white;
  padding: 3rem 0 1rem 0;
  position: relative;
  /* Removed margin-top that was causing overlap */
}

#game-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--seede-orange), var(--seede-orange-light), var(--seede-orange));
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-section h3 {
  color: var(--seede-orange);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.footer-section p {
  margin: 0.5rem 0;
  line-height: 1.6;
  opacity: 0.9;
}

.footer-logo {
  height: 40px;
  width: auto;
  margin: 1rem 0;
  filter: brightness(0) invert(1);
}

.seede-tagline {
  font-style: italic;
  color: var(--seede-orange);
  font-weight: 500;
  margin: 0.5rem 0 1rem 0 !important;
}

.controls-grid {
  display: grid;
  gap: 0.75rem;
}

.control-item {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border-left: 4px solid var(--seede-orange);
}

.control-item strong {
  color: var(--seede-orange);
}

.social-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.social-link {
  color: white;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--seede-orange);
  border-radius: 25px;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.9rem;
}

.social-link:hover {
  background: var(--seede-orange);
  color: var(--seede-purple);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.footer-bottom {
  text-align: center;
  padding: 1.5rem 1rem 0;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.version-info {
  color: var(--seede-orange);
  font-weight: 500;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
  #game-header {
    padding: 1rem 0;
  }

  .brand-container {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .brand-logo-section {
    flex-direction: column;
    gap: 0.5rem;
  }

  .game-title {
    font-size: 1.5rem;
  }

  .game-subtitle {
    font-size: 0.8rem;
  }

  .controls-hint {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }

  .control-mobile {
    display: block;
  }

  .control-desktop {
    display: none;
  }

  .game-section {
    min-height: 60vh;
    padding: 1rem 0;
  }

  #unity-canvas {
    max-width: 95vw;
    height: auto;
  }

  /* Mobile Fullscreen Button */
  #unity-fullscreen-button {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
    margin-top: 0.5rem;
  }

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

  .fullscreen-text {
    font-size: 0.8rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .social-links {
    justify-content: center;
  }

  .controls-grid {
    max-width: 300px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .seede-logo {
    height: 40px;
  }

  .game-title {
    font-size: 1.3rem;
  }

  #unity-loader-container {
    padding: 1.5rem;
    margin: 0 1rem;
  }

  #game-footer {
    padding: 2rem 0 1rem 0;
    margin-top: 2rem;
  }

  /* Extra small mobile adjustments */
  #unity-fullscreen-button {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }

  .fullscreen-text {
    font-size: 0.75rem;
  }
}

/* Light Theme Overrides */
.light-theme #game-header {
  background: rgba(248, 249, 250, 0.95);
  color: var(--seede-purple);
}

.light-theme #game-footer {
  background: linear-gradient(135deg, var(--seede-purple) 0%, var(--seede-purple-dark) 100%);
}

.light-theme .footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.2);
}

/* Desktop-specific styles */
@media (min-width: 769px) {
  .control-mobile {
    display: none;
  }

  .control-desktop {
    display: block;
  }

  .brand-logo-section {
    gap: 1.5rem;
  }

  .seede-logo {
    height: 60px;
  }

  #game-footer {
    margin-top: 2rem; /* Only add margin on desktop */
  }
}
