/**
 * Fraxtanoid - Character Builder Styles
 * Estilos dark mode glassmorphism para selector de personaje
 */

/* Overlay principal */
.character-builder-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(5, 6, 14, 0.95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.character-builder-overlay.hiding {
  opacity: 0;
  pointer-events: none;
}

/* Panel principal */
.character-builder-panel {
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  border-radius: 24px;
  background: 
    radial-gradient(800px 300px at 20% -80px, rgba(123, 92, 255, 0.15), transparent),
    radial-gradient(800px 300px at 80% -80px, rgba(0, 200, 255, 0.12), transparent),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Títulos */
.builder-title {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fdf8ff;
  text-shadow: 0 8px 24px rgba(90, 115, 255, 0.4);
  margin: 0 0 0.5rem 0;
  text-align: center;
}

.builder-subtitle {
  color: rgba(207, 216, 255, 0.7);
  text-align: center;
  font-size: 1rem;
  margin: 0 0 2rem 0;
}

/* Secciones */
.builder-section {
  margin-bottom: 2rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: #f1f5ff;
  margin-bottom: 1rem;
}

.section-icon {
  font-size: 1.5rem;
}

.limb-count {
  font-size: 0.9rem;
  color: rgba(207, 216, 255, 0.6);
  font-weight: 400;
}

/* Opciones de cuerpo */
.body-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.body-option {
  padding: 1.5rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.body-option:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(127, 67, 255, 0.4);
  transform: translateY(-2px);
}

.body-option.selected {
  background: rgba(127, 67, 255, 0.15);
  border-color: rgba(127, 67, 255, 0.8);
  box-shadow: 0 0 20px rgba(127, 67, 255, 0.3);
}

.body-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.body-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem 0;
}

.body-description {
  font-size: 0.85rem;
  color: rgba(207, 216, 255, 0.7);
  margin: 0 0 1rem 0;
  min-height: 2.4em;
}

/* Stats */
.body-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: rgba(207, 216, 255, 0.8);
  text-align: left;
}

.stat-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, #7c4dff, #d500f9);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Slots de miembros */
.limb-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.limb-slot {
  position: relative;
  padding: 1.25rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  text-align: center;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.limb-slot.empty {
  cursor: help;
}

.limb-slot.filled {
  background: rgba(76, 175, 80, 0.1);
  border: 2px solid rgba(76, 175, 80, 0.4);
}

.slot-empty {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.3);
}

.limb-icon {
  font-size: 2rem;
}

.limb-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.remove-limb {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(244, 67, 54, 0.8);
  border: none;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.remove-limb:hover {
  background: rgba(244, 67, 54, 1);
  transform: scale(1.1);
}

/* Tipos de miembro */
.limb-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.limb-type {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.limb-type:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(33, 150, 243, 0.5);
  transform: translateX(4px);
}

.limb-type:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.limb-type-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.limb-type-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.limb-type-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.limb-type-desc {
  font-size: 0.75rem;
  color: rgba(207, 216, 255, 0.7);
  line-height: 1.3;
}

.limb-type-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.25rem;
}

.limb-stat {
  font-size: 0.75rem;
  color: rgba(207, 216, 255, 0.8);
}

/* Preview */
.builder-preview {
  margin: 2rem 0;
  padding: 2rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.preview-title {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(207, 216, 255, 0.8);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.preview-ship {
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-body {
  font-size: 4rem;
  animation: float 3s ease-in-out infinite;
}

.preview-limb {
  position: absolute;
  font-size: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
}

.preview-empty {
  color: rgba(207, 216, 255, 0.4);
  font-size: 0.9rem;
  font-style: italic;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Botón confirmar */
.btn-start-game {
  width: 100%;
  padding: 1.2rem 2rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.3), rgba(213, 0, 249, 0.3));
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.btn-start-game.ready {
  background: linear-gradient(135deg, #7c4dff, #d500f9);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(127, 67, 255, 0.4);
}

.btn-start-game.ready:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(127, 67, 255, 0.5);
}

.btn-start-game.ready:active {
  transform: translateY(0);
}

/* Hint */
.builder-hint {
  text-align: center;
  color: rgba(207, 216, 255, 0.5);
  font-size: 0.85rem;
  margin-top: 1rem;
  font-style: italic;
}

/* Notificaciones */
.builder-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 1rem 2rem;
  border-radius: 12px;
  background: rgba(33, 150, 243, 0.95);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.builder-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.builder-notification.warning {
  background: rgba(255, 152, 0, 0.95);
}

.builder-notification.error {
  background: rgba(244, 67, 54, 0.95);
}

/* Responsive */
@media (max-width: 768px) {
  .character-builder-panel {
    padding: 1.5rem;
    max-height: 95vh;
  }
  
  .builder-title {
    font-size: 1.8rem;
  }
  
  .body-options {
    grid-template-columns: 1fr;
  }
  
  .limb-slots {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .limb-types {
    grid-template-columns: 1fr;
  }
  
  .preview-body {
    font-size: 3rem;
  }
}

/* Scrollbar personalizado */
.character-builder-panel::-webkit-scrollbar {
  width: 8px;
}

.character-builder-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.character-builder-panel::-webkit-scrollbar-thumb {
  background: rgba(127, 67, 255, 0.5);
  border-radius: 4px;
}

.character-builder-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(127, 67, 255, 0.7);
}
