/* ========================================
   DISEÑO PREMIUM DE GALERÍA - VERSIÓN MEJORADA
   ======================================== */

/* Badge de contador de fotos mejorado */
.fv-album-badge {
  position: absolute;
  right: 14px;
  top: 14px;
  background: linear-gradient(135deg, rgba(0,91,154,.95) 0%, rgba(59,181,74,.95) 100%);
  color: #fff;
  border-radius: 100px;
  padding: 0.45rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  border: 2px solid rgba(255,255,255,.2);
  z-index: 2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fv-gallery-card:hover .fv-album-badge {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
}

/* Contenedor de thumbnail mejorado */
.fv-gallery-thumb {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.fv-gallery-thumb::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.4) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

.fv-gallery-card:hover .fv-gallery-thumb::before {
  opacity: 1;
}

.fv-gallery-thumb img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.fv-gallery-card:hover .fv-gallery-thumb img {
  transform: scale(1.08);
}

/* Card principal con diseño premium */
.fv-gallery-card {
  width: 100%;
  border: none;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  padding: 0;
  text-align: left;
  box-shadow: 
    0 8px 30px rgba(0,0,0,.08),
    0 2px 8px rgba(0,0,0,.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 1px solid rgba(0,91,154,.06);
  animation: fadeInUp 0.5s ease-out backwards;
}

.fv-gallery-card:nth-child(1) { animation-delay: 0.05s; }
.fv-gallery-card:nth-child(2) { animation-delay: 0.1s; }
.fv-gallery-card:nth-child(3) { animation-delay: 0.15s; }
.fv-gallery-card:nth-child(4) { animation-delay: 0.2s; }
.fv-gallery-card:nth-child(5) { animation-delay: 0.25s; }
.fv-gallery-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fv-gallery-card:hover {
  transform: translateY(-8px);
  box-shadow: 
    0 20px 50px rgba(0,0,0,.12),
    0 8px 20px rgba(0,91,154,.1);
  border-color: rgba(0,91,154,.12);
}

.fv-gallery-card:active {
  transform: translateY(-4px);
}

/* Meta información mejorada */
.fv-gallery-meta {
  padding: 1.25rem 1.5rem 1.5rem;
  background: #fff;
  position: relative;
  transition: background 0.3s ease;
}

.fv-gallery-card:hover .fv-gallery-meta {
  background: #fafbfc;
}

.fv-gallery-meta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 1.5rem;
  right: 1.5rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,91,154,.1), transparent);
}

.fv-gallery-cap {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: #1f2937;
  letter-spacing: -0.2px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.fv-gallery-card:hover .fv-gallery-cap {
  color: var(--color-azul, #005B9A);
}

.fv-gallery-date {
  font-size: 0.85rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.fv-gallery-date::before {
  content: '\f073';
  font-family: 'Font Awesome 6 Free';
  font-weight: 400;
  color: var(--color-verde, #3BB54A);
  transition: transform 0.2s ease;
}

.fv-gallery-card:hover .fv-gallery-date::before {
  transform: scale(1.1);
}

/* Header de sección mejorado */
#fvGalleryViewLabel {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--color-verde, #3BB54A);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}

#fvGalleryViewTitle {
  font-size: 2rem;
  font-weight: 900;
  color: #1f2937;
  letter-spacing: -0.5px;
  margin-bottom: 0;
  transition: color 0.3s ease;
}

/* Botón de volver mejorado */
#fvGalleryBack {
  border: 2px solid rgba(0,91,154,.2);
  color: var(--color-azul, #005B9A);
  font-weight: 700;
  padding: 0.65rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  border-radius: 50px;
  position: relative;
  overflow: hidden;
}

#fvGalleryBack::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
  z-index: 0;
}

#fvGalleryBack:hover::before {
  width: 300px;
  height: 300px;
}

#fvGalleryBack:hover {
  background: var(--color-azul, #005B9A);
  border-color: var(--color-azul, #005B9A);
  color: white;
  transform: translateX(-4px);
}

#fvGalleryBack i {
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

#fvGalleryBack:hover i {
  transform: translateX(-3px);
}

/* Loader mejorado */
#fvGalleryLoader {
  padding: 5rem 0;
  animation: pulseLoader 2s infinite;
}

@keyframes pulseLoader {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

#fvGalleryLoader .spinner-border {
  width: 4rem;
  height: 4rem;
  border-width: 0.4rem;
  border-color: var(--color-verde, #3BB54A) transparent transparent transparent;
}

/* Estado vacío mejorado */
#fvGalleryEmpty {
  padding: 5rem 2rem;
  background: white;
  border-radius: 24px;
  border: 2px dashed rgba(0,91,154,.15);
  transition: all 0.3s ease;
}

#fvGalleryEmpty:hover {
  border-color: rgba(0,91,154,.3);
  background: #f8f9fa;
}

#fvGalleryEmpty i {
  color: rgba(0,91,154,.15);
  transition: color 0.3s ease, transform 0.3s ease;
}

#fvGalleryEmpty:hover i {
  color: rgba(0,91,154,.3);
  transform: scale(1.05);
}

/* Grid con mejor espaciado */
#fvGalleryGrid {
  row-gap: 2rem;
  column-gap: 1.5rem;
}

/* Modal mejorado */
.modal-content {
  border-radius: 24px;
  border: none;
  box-shadow: 0 25px 80px rgba(0,0,0,.25);
  overflow: hidden;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  background: linear-gradient(180deg, rgba(0,91,154,.04) 0%, transparent 100%);
  border-bottom: 1px solid rgba(0,0,0,.06);
  padding: 1.75rem 2rem;
}

.modal-title {
  font-weight: 700;
  font-size: 1.25rem;
  color: #1f2937;
}

.modal-body {
  padding: 0;
  background: #000;
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body img {
  border-radius: 0;
  max-height: 80vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
  cursor: zoom-in;
}

.modal-body img:hover {
  opacity: 0.9;
}

/* Botones de navegación del modal (lightbox) */
.fv-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  border: 2px solid rgba(255,255,255,.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.fv-nav-btn:hover {
  background: linear-gradient(135deg, var(--color-azul, #005B9A), var(--color-verde, #3BB54A));
  border-color: rgba(255,255,255,.4);
  transform: translateY(-50%) scale(1.1);
}

.fv-nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.fv-nav-prev {
  left: 15px;
}

.fv-nav-next {
  right: 15px;
}

/* Responsive */
@media (max-width: 991px) {
  #fvGalleryViewTitle {
    font-size: 1.75rem;
  }
  
  .fv-gallery-thumb img {
    height: 240px;
  }
}

@media (max-width: 575px) {
  .fv-gallery-thumb img {
    height: 220px;
  }
  
  .fv-gallery-card {
    border-radius: 18px;
  }
  
  #fvGalleryViewTitle {
    font-size: 1.5rem;
  }
  
  .fv-album-badge {
    padding: 0.35rem 0.65rem;
    font-size: 0.7rem;
  }
  
  .fv-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .fv-nav-prev { left: 10px; }
  .fv-nav-next { right: 10px; }
}

/* Espaciado de letras para subtítulos */
.letter-spacing-2 {
  letter-spacing: 2px;
}

/* Animación suave para el texto de carga */
.animate-pulse {
  animation: pulseText 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulseText {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* Mejora del contenedor principal */
.gallery-section {
  padding-top: 1.5rem;
}

/* Estilos para el contenedor de header */
.gallery-section > .d-flex {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  border: 1px solid rgba(0,91,154,.08);
  margin-bottom: 2.5rem;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.gallery-section > .d-flex:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,.08);
  border-color: rgba(0,91,154,.15);
}

/* Hover effect para imágenes en modal */
.modal-body img {
  transition: transform 0.3s ease;
  cursor: zoom-in;
}

/* Indicador de carga en imágenes */
.fv-gallery-thumb::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: var(--color-verde, #3BB54A);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.fv-gallery-thumb.loading::after {
  opacity: 1;
}

/* Badge con efecto de pulso en hover (ya incluido arriba) */

/* Mejora del contador visual */
.fv-album-badge i {
  margin-right: 0.35rem;
  transition: transform 0.2s ease;
}

.fv-gallery-card:hover .fv-album-badge i {
  transform: rotate(5deg);
}