/* Animations */

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

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

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px currentColor;
  }
  50% {
    box-shadow: 0 0 20px currentColor;
  }
}

@keyframes starTwinkle {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

@keyframes warpScroll {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateY(-100vh) scale(2);
    opacity: 0;
  }
}

@keyframes priceUp {
  0%, 100% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(68, 255, 136, 0.3);
  }
}

@keyframes priceDown {
  0%, 100% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(255, 68, 68, 0.3);
  }
}

@keyframes scanLine {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Apply animations */

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

.slide-down {
  animation: slideDown 0.3s ease-out;
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

.glow {
  animation: glow 2s ease-in-out infinite;
}

.shake {
  animation: shake 0.3s ease-in-out;
}

.modal-overlay {
  animation: fadeIn 0.2s ease-out;
}

.modal {
  animation: slideUp 0.3s ease-out;
}

.toast {
  animation: slideUp 0.3s ease-out;
}

/* Warp effect */
.warp-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  overflow: hidden;
  z-index: 1;
}

.warp-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  animation: warpScroll 3s linear infinite;
}

.warp-star:nth-child(2n) {
  width: 1px;
  height: 1px;
  animation-duration: 2.5s;
}

.warp-star:nth-child(3n) {
  width: 3px;
  height: 3px;
  animation-duration: 3.5s;
}

/* Planet orbital view */
.planet-view {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 20px auto;
}

.planet-orb {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #6a8aff, #2a4a8a);
  box-shadow: 0 0 30px rgba(100, 150, 255, 0.5),
              inset -10px -10px 30px rgba(0, 0, 0, 0.5);
  animation: pulse 4s ease-in-out infinite;
  margin: 40px auto;
}

.planet-orb.federation {
  background: radial-gradient(circle at 30% 30%, #6a8aff, #2a4a8a);
}

.planet-orb.frontier {
  background: radial-gradient(circle at 30% 30%, #ff8a6a, #8a4a2a);
}

.planet-orb.outlaw {
  background: radial-gradient(circle at 30% 30%, #8a6aff, #4a2a8a);
}

/* Price trend animations */
.price-trend-up {
  animation: priceUp 0.5s ease-out;
}

.price-trend-down {
  animation: priceDown 0.5s ease-out;
}

/* Travel animation */
.travel-container {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ship-icon {
  font-size: 48px;
  animation: pulse 2s ease-in-out infinite;
  z-index: 10;
  position: relative;
}

.progress-bar-container {
  width: 80%;
  max-width: 300px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 20px 0;
  border: 1px solid rgba(100, 200, 255, 0.3);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #64c8ff 0%, #44ff88 100%);
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(100, 200, 255, 0.5);
}

/* Character select */
.character-select-container {
  padding: 20px;
}

.character-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(100, 200, 255, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.character-card:hover {
  border-color: #64c8ff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(100, 200, 255, 0.3);
}

.character-card.selected {
  border-color: #44ff88;
  background: rgba(68, 255, 136, 0.1);
  box-shadow: 0 0 20px rgba(68, 255, 136, 0.3);
}

.character-portrait {
  font-size: 64px;
  text-align: center;
  margin-bottom: 12px;
}

.character-name {
  font-size: 18px;
  font-weight: bold;
  color: #64c8ff;
  text-align: center;
  margin-bottom: 8px;
}

.character-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin-bottom: 12px;
}

.character-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trait-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  background: rgba(100, 200, 255, 0.2);
  border: 1px solid rgba(100, 200, 255, 0.3);
  color: #64c8ff;
}

/* Combat modal */
.combat-container {
  text-align: center;
}

.enemy-portrait {
  font-size: 72px;
  margin: 20px 0;
  animation: shake 0.5s ease-in-out infinite;
}

.win-chance {
  font-size: 24px;
  font-weight: bold;
  margin: 16px 0;
}

.win-chance.high {
  color: #44ff88;
}

.win-chance.medium {
  color: #ffaa44;
}

.win-chance.low {
  color: #ff4444;
}

.combat-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

/* Game over screen */
.game-over-container {
  text-align: center;
  padding: 40px 20px;
}

.game-over-title {
  font-size: 36px;
  color: #ff4444;
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
}

.game-over-reason {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 30px;
}

.game-over-stats {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(100, 200, 255, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 30px;
  text-align: left;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  color: rgba(255, 255, 255, 0.6);
}

.stat-value {
  font-weight: bold;
  color: #64c8ff;
}
