/* === CONTENEDOR PRINCIPAL === */
.weapon-list-container {
  padding: 1rem;
  margin: 0 auto;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* === FILTROS === */
.filters-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
}

.filter-dropdown {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background-color: white;
  color: black;
  min-width: 120px;
}

.filter-reset {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.2s;
}

.filter-reset:hover {
  background-color: var(--color-bg-tertiary);
}

/* === LAYOUT PRINCIPAL (RESPONSIVO) === */
.weapon-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1rem;
  overflow: hidden;
  position: relative;
}

/* === GRID DE ARMAS === */
.weapon-grid-section {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.weapon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 1rem;
  justify-content: center;
}

/* === DETALLE (RESPONSIVO) === */
.weapon-detail-section {
  flex-shrink: 0;
  height: 300px;           /* altura fija para móvil */
  overflow-y: auto;
  padding: 1rem;
  background-color: var(--color-bg-secondary);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  resize: none; /* Deshabilitar resize por defecto */
}

/* === CONTENEDOR DEL DETALLE CON SCROLL === */
.weapon-detail-content {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* === SEPARADOR HORIZONTAL PARA MÓVIL === */
.resize-handle-horizontal {
  position: absolute;
  top: -5px;
  left: 0;
  right: 0;
  height: 10px;
  cursor: row-resize;
  background: transparent;
  z-index: 10;
  display: none;
}

.resize-handle-horizontal::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: var(--color-border);
  border-radius: 2px;
  opacity: 0.7;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.resize-handle-horizontal:hover::after {
  opacity: 1;
  background-color: var(--color-text-secondary);
}

/* === SEPARADOR VERTICAL PARA DESKTOP === */
.resize-handle-vertical {
  position: absolute;
  left: -5px;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  background: transparent;
  z-index: 10;
  display: none;
}

.resize-handle-vertical::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 60px;
  background-color: var(--color-border);
  border-radius: 1px;
  opacity: 0.7;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.resize-handle-vertical:hover::after {
  opacity: 1;
  background-color: var(--color-text-secondary);
}

/* === MEDIA QUERY PARA PANTALLAS GRANDES (≥768px) === */
@media (min-width: 768px) {
  .weapon-layout {
    flex-direction: row;
  }

  .weapon-grid-section {
    flex: 1;
    min-width: 0;
  }

  .weapon-detail-section {
    width: 400px;
    min-width: 300px;
    max-width: 600px;
    height: 100% !important;
    border-left: 1px solid var(--color-border);
  }

  /* Mostrar separador vertical en desktop */
  .resize-handle-vertical {
    display: block;
  }

  /* Ocultar separador horizontal en desktop */
  .resize-handle-horizontal {
    display: none;
  }
}

/* === MEDIA QUERY PARA MÓVIL (≤767px) === */
@media (max-width: 767px) {
  /* Mostrar separador horizontal en móvil */
  .resize-handle-horizontal {
    display: block;
  }

  /* Ocultar separador vertical en móvil */
  .resize-handle-vertical {
    display: none;
  }
}

/* === TARJETAS === */
.weapon-card {
  background-color: var(--color-bg-secondary);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  width: 128px;
}

/* === IMAGEN GRID === */
.weapon-image-container {
  width: 128px;
  height: 128px;
  background-color: var(--color-bg-tertiary);
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

[data-rarity="3"] .weapon-image-container {
  background-image: url('https://wnmhzxxplthtguolkaqp.supabase.co/storage/v1/object/public/assets/bg/3.webp');
}
[data-rarity="4"] .weapon-image-container {
  background-image: url('https://wnmhzxxplthtguolkaqp.supabase.co/storage/v1/object/public/assets/bg/4.webp');
}
[data-rarity="5"] .weapon-image-container {
  background-image: url('https://wnmhzxxplthtguolkaqp.supabase.co/storage/v1/object/public/assets/bg/5.webp');
}

.weapon-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* === DETALLES === */
.weapon-details {
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.weapon-type {
  display: none;
}

.weapon-name {
  font-size: 0.6rem;
  color: var(--color-text-primary);
}

.weapon-stat {
  font-size: 0.6rem;
  color: var(--color-text-secondary);
}

.weapon-rarity {
  margin-top: 0.4rem;
  font-size: 0.8rem;
}

.weapon-passive-container {
  display: block;
}

.weapon-passive {
  background-color: var(--color-bg-tertiary);
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.refinement-select {
  margin: 0.25rem 0;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-primary);
  color: var(--color-text);
}

/* === CARD DETALLE === */
.weapon-card--detail {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--color-bg-tertiary);
  border-radius: 10px;
  overflow: hidden;
}

/* === IMAGEN DEL DETALLE === */
.weapon-card--detail .weapon-image-container {
  width: 100%;
  height: 100px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
}

.weapon-card--detail .weapon-image {
  height: 100px;
  width: auto;
  object-fit: contain;
  object-position: center;
}

/* === PLACEHOLDER === */
.placeholder-text {
  color: var(--color-text-secondary);
  text-align: center;
  padding: 1rem;
}

/* === SCROLL === */
.weapon-grid-section::-webkit-scrollbar,
.weapon-detail-section::-webkit-scrollbar {
  width: 8px;
}
.weapon-grid-section::-webkit-scrollbar-thumb,
.weapon-detail-section::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.3);
  border-radius: 4px;
}
.weapon-grid-section::-webkit-scrollbar-thumb:hover,
.weapon-detail-section::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255,255,255,0.5);
}

/* === TEXTO EN NEGRITA === */
strong {
  color: #fffc4fea;
  font-weight: bold;
}

/* Jerarquía estándar */
.weapon-name {
    font-size: 1rem;
    font-weight: bold;
}

.weapon-stat {
    font-size:1rem;
}

.weapon-passive {
    font-size: 0.8rem;
    line-height: 1.4;
}

/* === MEJORAS PARA EL DETALLE EN DESKTOP === */
@media (min-width: 768px) {
  .weapon-card--detail .weapon-image-container {
    height: 150px;
  }

  .weapon-card--detail .weapon-image {
    height: 150px;
  }
  
  .weapon-detail-section {
    padding: 1.5rem;
  }
}

/* === MEJORAS PARA LOS SEPARADORES === */
.resize-handle-vertical,
.resize-handle-horizontal {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Feedback visual durante el redimensionamiento */
.weapon-detail-section.resizing {
    opacity: 0.9;
}

/* Asegurar que los separadores estén siempre encima */
.resize-handle-vertical {
    z-index: 100;
}

.resize-handle-horizontal {
    z-index: 100;
}

/* Mejorar la área de agarre */
.resize-handle-horizontal {
    top: -8px;
    height: 16px;
}

.resize-handle-vertical {
    left: -8px;
    width: 16px;
}

.resize-handle-horizontal::after {
    top: 6px;
}

.resize-handle-vertical::after {
    left: 6px;
}