/* Estilos para Showreel Interactivo + Behind the Scenes */

/* ===== SECCIÓN PRINCIPAL: NUESTROS TRABAJOS AUDIOVISUALES ===== */
.showreel-main {
  padding: 80px 0;
  background: linear-gradient(135deg, rgba(255, 212, 0, 0.03) 0%, rgba(255, 212, 0, 0.01) 100%);
  border-top: 2px solid var(--accent);
}

/* Contenedor para alinear h2 y enlace horizontalmente */
.showreel-header-flex {
  display: flex;
  align-items: baseline;
  margin-bottom: 3rem;
  gap: 1rem;
}

/* Nuevo estilo para el título PROYECTOS similar a servicios */
.projects-title,
#showreel-title,
.showreel-main #showreel-title {
  font-family: var(--font-heading) !important;
  font-size: clamp(2.5rem, 5vw, 3rem) !important;
  font-weight: 900 !important;
  color: var(--accent) !important;
  margin-bottom: 0 !important;
  line-height: var(--lh-heading) !important;
  letter-spacing: var(--tracking-heading) !important;
  text-transform: uppercase !important;
  margin-top: 0 !important;
  padding: 0 !important;
  text-shadow: none !important;
  display: block !important;
  text-align: left !important;
}

/* Remover el pseudo-elemento ::after del h2 global */
.showreel-main #showreel-title::after {
  display: none !important;
}

.projects-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 0;
  margin-top: 0;
  transition: color 0.3s ease;
  white-space: nowrap;
  align-self: flex-end;
}

.projects-link:hover {
  color: var(--accent);
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .showreel-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .showreel-main #showreel-title {
    text-align: center !important;
  }
  
  .projects-link {
    align-self: center;
  }
}

.showreel-header {
  text-align: center;
  margin-bottom: 48px;
}

.showreel-header h2 {
  font-size: clamp(28px, 3.5vw + 12px, 42px);
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(255, 212, 0, 0.25);
}

.showreel-subtitle {
  font-size: clamp(16px, 1.2vw + 8px, 20px);
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.showreel-grid {
  margin-bottom: 40px;
}

/* Masonry Gallery Innovador */
.masonry-gallery {
  position: relative;
  margin: 0;
  padding: 0;
}

/* Media Controls - Controles de vista y ordenamiento */
.showreel-main .media-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

/* Responsive media controls */
@media (max-width: 768px) {
  .showreel-main .media-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 16px;
    margin-bottom: 20px;
  }
  
  .showreel-main .view-options {
    justify-content: center;
  }
  
  .showreel-main .sort-select {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .showreel-main .media-controls {
    margin-bottom: 16px;
    border-radius: 8px;
    padding: 10px;
  }
}

.showreel-main .view-options {
  display: flex;
  gap: 8px;
}

.showreel-main .view-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.showreel-main .view-btn:hover {
  background: var(--accent-alpha);
  border-color: var(--accent);
}

.showreel-main .view-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.showreel-main .view-btn svg {
  width: 16px;
  height: 16px;
}

.showreel-main .sort-select {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

/* Controles de filtro modernos */
.masonry-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.filter-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 212, 0, 0.2), transparent);
  transition: left 0.5s;
}

.filter-btn:hover::before {
  left: 100%;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--accent);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 212, 0, 0.3);
}

/* Container masonry con CSS Grid */
.masonry-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  padding: 0 12px;
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

/* Responsive grid adjustments */
@media (max-width: 1200px) {
  .masonry-container {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
  }
}

@media (max-width: 900px) {
  .masonry-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .masonry-container {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 8px;
  }
}

/* Vista en lista */
.masonry-container.list-view {
  grid-template-columns: 1fr;
  gap: 16px;
}

.masonry-container.list-view .masonry-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.masonry-container.list-view .masonry-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

.masonry-container.list-view .masonry-item img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 16px;
  flex-shrink: 0;
}

.masonry-container.list-view .masonry-overlay {
  position: static;
  background: transparent;
  color: var(--text);
  padding: 0;
  transform: none;
  flex: 1;
}

.masonry-container.list-view .masonry-title {
  color: var(--fg);
  font-size: 16px;
  margin-bottom: 4px;
}

.masonry-container.list-view .masonry-category {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.masonry-container.list-view .masonry-play-btn {
  margin-left: auto;
  flex-shrink: 0;
}

/* Responsive list view */
@media (max-width: 768px) {
  .masonry-container.list-view .masonry-item {
    height: 100px;
  }
  
  .masonry-container.list-view .masonry-item img {
    width: 160px;
  }
  
  .masonry-container.list-view .masonry-overlay {
    padding: 12px;
  }
}

@media (max-width: 480px) {
  .masonry-container.list-view .masonry-item {
    flex-direction: column;
    height: auto;
    aspect-ratio: 16/12;
  }
  
  .masonry-container.list-view .masonry-item img {
    width: 100%;
    height: 60%;
  }
  
  .masonry-container.list-view .masonry-overlay {
    height: 40%;
    padding: 8px;
  }
}

/* Enhanced lightbox responsiveness */
@media (max-width: 768px) {
  .youtube-modal-container .youtube-player-wrapper {
    width: 95vw !important;
    aspect-ratio: 16/9;
  }
  
  .youtube-modal-info h3 {
    font-size: 1.1em !important;
  }
  
  .video-modal-container video {
    max-width: 95vw !important;
    max-height: 70vh !important;
  }
}

@media (max-width: 480px) {
  .youtube-modal-container .youtube-player-wrapper {
    width: 98vw !important;
    border-radius: 8px !important;
  }
  
  .youtube-modal-info h3 {
    font-size: 1em !important;
    margin-bottom: 4px !important;
  }
  
  .youtube-modal-info a {
    font-size: 0.8em !important;
  }
  
  .video-modal-container video {
    max-width: 98vw !important;
    max-height: 60vh !important;
    border-radius: 8px !important;
  }
}

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

/* Items del masonry con efectos avanzados */
.masonry-item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform-origin: center;
  aspect-ratio: 16/9;
}

/* Responsive adjustments for masonry items */
@media (max-width: 768px) {
  .masonry-item {
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}

@media (max-width: 480px) {
  .masonry-item {
    border-radius: 12px;
    aspect-ratio: 16/10; /* Slightly taller on mobile */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }
}

.masonry-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 212, 0, 0.1), transparent 50%, rgba(255, 212, 0, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.masonry-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), 0 0 0 3px var(--accent);
}

.masonry-item:hover::before {
  opacity: 1;
}

/* Overlay con información */
.masonry-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
  color: white;
  padding: 24px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.masonry-item:hover .masonry-overlay {
  transform: translateY(0);
}

.masonry-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent);
}

.masonry-category {
  font-size: 14px;
  color: #ccc;
  margin-bottom: 12px;
}

.masonry-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.masonry-play-btn:hover {
  background: #fff;
  transform: scale(1.05);
}

/* Botón "Ver Más Trabajos" con efectos modernos */
.load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--accent) 0%, #ffed4a 100%);
  color: #000;
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(255, 212, 0, 0.3);
}

.btn-load-more::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
}

.btn-load-more:hover::before {
  left: 100%;
}

.btn-load-more:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 35px rgba(255, 212, 0, 0.4);
}

.btn-load-more:active {
  transform: translateY(-1px) scale(1.02);
}

/* Spinner de carga */
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top: 2px solid #000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}

.btn-load-more.loading .loading-spinner {
  display: block;
}

.btn-load-more.loading span {
  opacity: 0.7;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Efectos de filtrado */
.masonry-item.filtering {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
}

.masonry-item.show {
  opacity: 1;
  transform: scale(1);
}

/* Dots mejorados (mantenidos para compatibilidad) */
.showreel-main .carousel-dots {
  margin-top: 24px;
}

.showreel-main .carousel-dots button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  transition: all 0.3s ease;
}

.showreel-main .carousel-dots button.active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.2);
}

/* CTA prominente */
.showreel-cta {
  text-align: center;
  margin-top: 32px;
}

.showreel-cta .btn {
  padding: 18px 36px;
  font-size: 18px;
  font-weight: 700;
  border-radius: 25px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(255, 212, 0, 0.3);
}

.showreel-cta .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 212, 0, 0.4);
}

.showreel-cta .btn svg {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.showreel-cta .btn:hover svg {
  transform: translateX(4px);
}



/* ===== RESPONSIVE DESIGN ===== */
@media (min-width: 640px) {
  .behind-masonry {
    column-count: 3;
    column-gap: 16px;
  }
  
  .behind-masonry img {
    margin-bottom: 16px;
  }
}

@media (min-width: 900px) {
  .behind-masonry {
    column-count: 4;
  }
}

@media (max-width: 768px) {
  .showreel-main {
    padding: 60px 0;
  }

  /* Masonry responsive */
  .masonry-container {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 8px;
  }
  
  .masonry-controls {
    gap: 8px;
    margin-bottom: 30px;
  }
  
  .filter-btn {
    padding: 10px 18px;
    font-size: 13px;
  }
  
  .masonry-item {
    border-radius: 16px;
  }
  
  .masonry-overlay {
    padding: 20px;
  }
  
  .masonry-title {
    font-size: 16px;
  }
  
  .btn-load-more {
    padding: 14px 28px;
    font-size: 15px;
  }
  
  .load-more-container {
    margin-top: 35px;
  }

  .showreel-cta .btn {
    padding: 14px 28px;
    font-size: 15px;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  /* Tablets */
  .masonry-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }
  
  .filter-btn {
    padding: 11px 20px;
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  .behind-scenes {
    padding: 36px 0;
  }

  .showreel-header {
    margin-bottom: 32px;
  }
  
  /* Masonry en móviles pequeños */
  .masonry-controls {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  .filter-btn {
    min-width: 120px;
    text-align: center;
  }
  
  .masonry-overlay {
    padding: 16px;
  }
  
  .masonry-title {
    font-size: 15px;
    margin-bottom: 6px;
  }
  
  .masonry-category {
    font-size: 13px;
    margin-bottom: 10px;
  }
  
  .masonry-play-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .showreel-main .carousel-prev,
  .showreel-main .carousel-next {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .behind-masonry {
    column-count: 1;
  }
  
  .showreel-header {
    margin-bottom: 32px;
  }
  
  .behind-header {
    margin-bottom: 24px;
  }
}

/* ===== ANIMACIONES Y EFECTOS ===== */
@media (prefers-reduced-motion: no-preference) {
  .showreel-main {
    animation: fadeInUp 0.8s ease-out;
  }
  
  .behind-scenes {
    animation: fadeInUp 0.8s ease-out 0.2s both;
  }
  
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
  .showreel-main .carousel-track > *,
  .behind-masonry img,
  .showreel-cta .btn {
    transition: none;
  }
  
  .showreel-main .carousel-track > *:hover,
  .behind-masonry img:hover,
  .showreel-cta .btn:hover {
    transform: none;
  }
}

/* Focus states para accesibilidad */
.showreel-main .carousel-prev:focus-visible,
.showreel-main .carousel-next:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.behind-masonry img:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.showreel-cta .btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}