/* Ship Selection Screen - Enhanced Design System */
/* SPACEJAY-148 Phase 2: Ship Selection - Ornate stone borders & rich textures */

/* ═══════════════════════════════════════════════════════════════
   SHIP SELECTION OVERLAY - Enhanced starfield with nebulae
   ═══════════════════════════════════════════════════════════════ */

#ship-selection-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 40px;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(139, 0, 0, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(75, 0, 130, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 100, 150, 0.15) 0%, transparent 60%),
    linear-gradient(135deg, #05070A 0%, #0a0a0a 50%, #05070A 100%);
  background-size: cover;
  background-position: center;
  z-index: 1000;
  font-family: 'Press Start 2P', monospace;
  color: white;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* DENSE starfield - matching main menu */
#ship-selection-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(1px 1px at 10% 20%, white, transparent),
    radial-gradient(1px 1px at 15% 35%, white, transparent),
    radial-gradient(1px 1px at 20% 50%, white, transparent),
    radial-gradient(1px 1px at 25% 65%, white, transparent),
    radial-gradient(1px 1px at 30% 80%, white, transparent),
    radial-gradient(1px 1px at 35% 15%, white, transparent),
    radial-gradient(1px 1px at 40% 30%, white, transparent),
    radial-gradient(1px 1px at 45% 45%, white, transparent),
    radial-gradient(1px 1px at 50% 60%, white, transparent),
    radial-gradient(1px 1px at 55% 75%, white, transparent),
    radial-gradient(1px 1px at 60% 10%, white, transparent),
    radial-gradient(1px 1px at 65% 25%, white, transparent),
    radial-gradient(1px 1px at 70% 40%, white, transparent),
    radial-gradient(1px 1px at 75% 55%, white, transparent),
    radial-gradient(1px 1px at 80% 70%, white, transparent),
    radial-gradient(1px 1px at 85% 85%, white, transparent),
    radial-gradient(1px 1px at 90% 5%, white, transparent),
    radial-gradient(1px 1px at 95% 95%, white, transparent),
    radial-gradient(2px 2px at 12% 42%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 38% 68%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 62% 22%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 88% 78%, rgba(255,255,255,0.8), transparent);
  background-size: 
    200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%,
    200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%,
    200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%,
    200% 200%, 200% 200%, 200% 200%, 250% 250%, 250% 250%,
    250% 250%, 250% 250%;
  animation: stars-drift 180s linear infinite;
  opacity: 0.6;
  pointer-events: none;
}

@keyframes stars-drift {
  from { background-position: 0% 0%; }
  to { background-position: 100% 100%; }
}

/* Ensure content is above starfield */
#ship-selection-overlay > * {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════
   TITLE
   ═══════════════════════════════════════════════════════════════ */

.ship-selection-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #C0C5CC;
  text-shadow: 
    0 0 30px rgba(0, 212, 255, 0.6),
    0 0 60px rgba(0, 212, 255, 0.3),
    0 0 90px rgba(0, 212, 255, 0.15),
    0 4px 0 #1A1C20,
    0 8px 0 #05070A,
    2px 2px 4px rgba(0, 0, 0, 0.9);
  text-align: center;
  margin-bottom: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   SHIPS CONTAINER
   ═══════════════════════════════════════════════════════════════ */

#ships-container {
  display: flex;
  gap: 30px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(1400px, 95vw);
}

/* ═══════════════════════════════════════════════════════════════
   SHIP CARD - Ornate Panel Design
   ═══════════════════════════════════════════════════════════════ */

.ship-card {
  position: relative;
  width: min(280px, 85vw);
  padding: 70px 40px 60px 40px;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
}

/* Panel frame background */
.ship-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../../assets/menus/panel-frame2-clean.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  image-rendering: auto;
  z-index: -1;
  transition: filter 0.3s ease;
  background-color: transparent;
}

/* Ensure content is above the frame */
.ship-card > * {
  position: relative;
  z-index: 1;
  background: transparent;
}

/* Default state - no glow */
.ship-card {
  box-shadow: none;
  background: transparent;
}

/* Hover state - enhanced glow (works for all cards including selected) */
.ship-card:hover::before {
  filter: brightness(1.1);
}

.ship-card:hover {
  transform: translateY(-5px);
  box-shadow: none;
}

/* Selected state - no external glow, just brightness */
.ship-card.selected {
  box-shadow: none;
}

/* Selected + Hover state - combine both effects */
.ship-card.selected:hover {
  transform: translateY(-5px);
  box-shadow: none;
}

.ship-card.selected::before {
  filter: brightness(1.15);
}

/* Selected + Hover - even brighter */
.ship-card.selected:hover::before {
  filter: brightness(1.2);
}

/* ═══════════════════════════════════════════════════════════════
   SHIP CARD CONTENT
   ═══════════════════════════════════════════════════════════════ */

.ship-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  height: 80px;
}

.ship-icon {
  width: 60px;
  height: 60px;
  image-rendering: pixelated;
  transition: filter 0.3s ease;
}

.ship-card:hover .ship-icon {
  filter: drop-shadow(0 0 15px currentColor) drop-shadow(0 0 30px currentColor);
}

.ship-card.selected .ship-icon {
  filter: drop-shadow(0 0 20px currentColor) drop-shadow(0 0 40px currentColor);
}

.ship-name {
  font-size: 16px;
  margin-bottom: 15px;
  letter-spacing: 1px;
  text-align: center;
  transition: all 0.3s ease;
  text-shadow: 
    0 0 10px rgba(0, 0, 0, 0.8),
    2px 2px 4px #000;
}

.ship-card:hover .ship-name,
.ship-card.selected .ship-name {
  text-shadow: 
    0 0 15px currentColor,
    0 0 30px currentColor,
    2px 2px 4px #000;
}

.ship-description {
  font-size: 9px;
  margin-bottom: 20px;
  line-height: 1.6;
  color: #8A8F96;
  text-shadow: 2px 2px 4px #000;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   SHIP STATS
   ═══════════════════════════════════════════════════════════════ */

.ship-stats {
  font-size: 9px;
  line-height: 2;
  width: 100%;
}

.stat-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.stat-label {
  color: #8A8F96;
  letter-spacing: 1px;
  min-width: 40px;
  text-shadow: 1px 1px 2px #000;
}

.stat-bar-container {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.stat-bar-fill {
  height: 100%;
  transition: width 0.3s ease;
  box-shadow: 0 0 8px currentColor;
  opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════════
   CONFIRM BUTTON - Unified Button System
   ═══════════════════════════════════════════════════════════════ */

.ship-confirm-button {
  position: relative;
  padding: 16px 50px;
  font-size: 0.9rem;
  font-weight: bold;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  min-width: 300px;
  min-height: 70px;
  image-rendering: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #8A8F96;
  text-shadow: 
    0 0 8px rgba(138, 143, 150, 0.4),
    2px 2px 4px rgba(0, 0, 0, 0.8);
  font-family: 'Press Start 2P', monospace;
}

/* Default state - Neutral button background */
.ship-confirm-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../../assets/menus/button-neutral-clean.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: -1;
  width: 100%;
  height: 100%;
  transition: opacity 0.3s ease;
}

/* Cyan button overlay (hidden by default) */
.ship-confirm-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../../assets/menus/button-cyan-clean.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Hover state - Show cyan button and change text color */
.ship-confirm-button:hover {
  color: #00D4FF;
  text-shadow: 
    0 0 15px rgba(0, 212, 255, 1),
    0 0 30px rgba(0, 212, 255, 0.6),
    2px 2px 4px rgba(0, 0, 0, 0.8);
  transform: translateY(-2px);
}

.ship-confirm-button:hover::after {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  #ships-container {
    gap: 20px;
  }
  
  .ship-card {
    width: min(240px, 80vw);
    padding: 60px 35px 55px 35px;
  }
}

@media (max-width: 768px) {
  .ship-selection-title {
    font-size: 1.2rem;
  }
  
  #ships-container {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  .ship-card {
    width: min(280px, 85vw);
  }
  
  .ship-confirm-button {
    min-width: 250px;
    min-height: 60px;
  }
  
  #ship-selection-overlay {
    padding: 30px 20px;
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .ship-selection-title {
    font-size: 1rem;
    letter-spacing: 3px;
  }
  
  .ship-card {
    width: 90vw;
    padding: 60px 30px 50px 30px;
  }
  
  .ship-confirm-button {
    min-width: 200px;
    font-size: 0.8rem;
  }
}

@media (max-height: 700px) {
  #ship-selection-overlay {
    padding: 20px;
    gap: 15px;
  }
  
  .ship-card {
    padding: 60px 35px 50px 35px;
  }
  
  .ship-icon-container {
    height: 60px;
    margin-bottom: 15px;
  }
  
  .ship-icon {
    width: 50px;
    height: 50px;
  }
  
  .ship-confirm-button {
    min-height: 60px;
  }
}
