/* ═══════════════════════════════════════════════════════════════════ */
/* SERVICE GALLERY MODAL - CSS COMPLETO */
/* Sistema de Galeria Multimedia com Fotos e Vídeos */
/* ═══════════════════════════════════════════════════════════════════ */

/* MODAL CONTAINER */
.service-gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.service-gallery-modal.active {
  display: flex;
  opacity: 1;
  flex-direction: column;
}

.gallery-modal-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #000;
}

/* ─────────────────────────────────────────────────────────────────── */
/* HEADER */
/* ─────────────────────────────────────────────────────────────────── */

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: rgba(0, 0, 0, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 10;
}

.gallery-service-title {
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: capitalize;
}

#galleryServiceName {
  color: var(--orange, #ff6a00);
  font-weight: 900;
}

.gallery-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.gallery-close-btn:hover {
  background: rgba(255, 106, 0, 0.2);
  border-color: rgba(255, 106, 0, 0.5);
  color: var(--orange, #ff6a00);
  transform: scale(1.1);
}

/* ─────────────────────────────────────────────────────────────────── */
/* CAROUSEL WRAPPER */
/* ─────────────────────────────────────────────────────────────────── */

.gallery-carousel-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.gallery-carousel {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─────────────────────────────────────────────────────────────────── */
/* SLIDES CONTAINER */
/* ─────────────────────────────────────────────────────────────────── */

.gallery-slides {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.gallery-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* MEDIA (IMAGENS E VÍDEOS) */
.gallery-media {
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  animation: mediaZoomIn 0.5s ease-out;
}

@keyframes mediaZoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* VÍDEOS - ESPECÍFICO */
.gallery-slide video {
  max-width: 85%;
  max-height: 85%;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.gallery-slide video::-webkit-media-controls-panel {
  background: rgba(0, 0, 0, 0.8);
}

/* ─────────────────────────────────────────────────────────────────── */
/* NAVIGATION BUTTONS */
/* ─────────────────────────────────────────────────────────────────── */

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 8;
  flex-shrink: 0;
}

.gallery-nav-btn:hover {
  background: rgba(255, 106, 0, 0.8);
  border-color: var(--orange, #ff6a00);
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav-btn svg {
  width: 28px;
  height: 28px;
}

.gallery-prev {
  left: 24px;
}

.gallery-next {
  right: 24px;
}

/* ─────────────────────────────────────────────────────────────────── */
/* INDICATORS (DOTS) */
/* ─────────────────────────────────────────────────────────────────── */

.gallery-indicators {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 8;
  justify-content: center;
  flex-wrap: wrap;
}

.gallery-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.gallery-dot:hover {
  background: rgba(255, 255, 255, 0.7);
  transform: scale(1.2);
}

.gallery-dot.active {
  background: var(--orange, #ff6a00);
  border-color: var(--orange, #ff6a00);
  width: 24px;
  border-radius: 5px;
  box-shadow: 0 0 20px rgba(255, 106, 0, 0.6);
}

/* ─────────────────────────────────────────────────────────────────── */
/* COUNTER E STATUS */
/* ─────────────────────────────────────────────────────────────────── */

.gallery-counter {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--orange, #ff6a00);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  z-index: 8;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 106, 0, 0.3);
}

.gallery-autoplay-status {
  position: absolute;
  top: 24px;
  left: 24px;
  background: rgba(0, 0, 0, 0.7);
  color: rgba(255, 255, 255, 0.6);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.gallery-autoplay-status.playing {
  color: var(--orange, #ff6a00);
  border-color: rgba(255, 106, 0, 0.3);
  background: rgba(255, 106, 0, 0.1);
}

.gallery-autoplay-status svg {
  animation: playPulse 1.5s ease-in-out infinite;
  animation-play-state: paused;
}

.gallery-autoplay-status.playing svg {
  animation-play-state: running;
}

@keyframes playPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ─────────────────────────────────────────────────────────────────── */
/* FOOTER */
/* ─────────────────────────────────────────────────────────────────── */

.gallery-footer {
  padding: 20px 40px;
  background: rgba(0, 0, 0, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.gallery-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

#galleryItemInfo {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

.gallery-controls {
  display: flex;
  gap: 12px;
}

.btn-gallery-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 106, 0, 0.2);
  border: 1px solid rgba(255, 106, 0, 0.5);
  color: var(--orange, #ff6a00);
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-gallery-control:hover,
.btn-gallery-control.playing {
  background: rgba(255, 106, 0, 0.3);
  border-color: var(--orange, #ff6a00);
  box-shadow: 0 0 15px rgba(255, 106, 0, 0.3);
}

.btn-gallery-control svg {
  width: 16px;
  height: 16px;
}

/* ─────────────────────────────────────────────────────────────────── */
/* RESPONSIVE DESIGN */
/* ─────────────────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
  .gallery-header,
  .gallery-footer {
    padding: 16px 24px;
  }

  .gallery-nav-btn {
    width: 48px;
    height: 48px;
  }

  .gallery-nav-btn svg {
    width: 24px;
    height: 24px;
  }

  .gallery-prev {
    left: 16px;
  }

  .gallery-next {
    right: 16px;
  }

  .gallery-counter {
    font-size: 12px;
    padding: 6px 12px;
  }
}

@media (max-width: 768px) {
  .gallery-header {
    padding: 12px 16px;
  }

  .gallery-service-title {
    font-size: 18px;
  }

  .gallery-close-btn {
    width: 40px;
    height: 40px;
  }

  .gallery-nav-btn {
    width: 40px;
    height: 40px;
  }

  .gallery-nav-btn svg {
    width: 20px;
    height: 20px;
  }

  .gallery-prev {
    left: 8px;
  }

  .gallery-next {
    right: 8px;
  }

  .gallery-media {
    max-width: 95%;
    max-height: 85%;
  }

  .gallery-media video {
    max-width: 95%;
    max-height: 80%;
  }

  .gallery-indicators {
    bottom: 80px;
    gap: 8px;
  }

  .gallery-dot {
    width: 8px;
    height: 8px;
  }

  .gallery-dot.active {
    width: 20px;
  }

  .gallery-counter {
    top: 16px;
    right: 16px;
    font-size: 11px;
    padding: 4px 10px;
  }

  .gallery-autoplay-status {
    top: 16px;
    left: 16px;
    font-size: 10px;
    padding: 6px 10px;
  }

  .gallery-footer {
    padding: 14px 16px;
  }

  #galleryItemInfo {
    font-size: 12px;
  }

  .gallery-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .gallery-controls {
    width: 100%;
  }

  .btn-gallery-control {
    font-size: 11px;
    padding: 8px 14px;
  }
}

@media (max-width: 480px) {
  .gallery-header {
    padding: 10px 12px;
  }

  .gallery-service-title {
    font-size: 16px;
  }

  .gallery-nav-btn {
    width: 36px;
    height: 36px;
    opacity: 0.7;
  }

  .gallery-nav-btn:hover {
    opacity: 1;
  }

  .gallery-indicators {
    bottom: 70px;
  }

  .gallery-counter {
    font-size: 10px;
    padding: 4px 8px;
  }

  .gallery-footer {
    padding: 12px;
  }

  #galleryItemInfo {
    font-size: 11px;
  }

  .btn-gallery-control {
    font-size: 10px;
    padding: 6px 12px;
  }
}

/* ─────────────────────────────────────────────────────────────────── */
/* ACESSIBILIDADE */
/* ─────────────────────────────────────────────────────────────────── */

.gallery-nav-btn:focus,
.gallery-dot:focus,
.gallery-close-btn:focus,
.btn-gallery-control:focus {
  outline: 2px solid var(--orange, #ff6a00);
  outline-offset: 2px;
}

.gallery-media {
  max-width: 90vw;
  max-height: 90vh;
}

/* Suporte para modo dark/light */
@media (prefers-color-scheme: light) {
  .service-gallery-modal {
    background: #f5f5f5;
  }

  .gallery-carousel-wrapper {
    background: linear-gradient(135deg, #f0f0f0 0%, #e5e5e5 100%);
  }

  .gallery-header,
  .gallery-footer {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.1);
  }

  #galleryItemInfo {
    color: rgba(0, 0, 0, 0.7);
  }

  .gallery-nav-btn,
  .gallery-close-btn,
  .gallery-counter,
  .gallery-autoplay-status {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.2);
    color: #000;
  }

  .gallery-nav-btn:hover,
  .gallery-close-btn:hover {
    background: rgba(255, 106, 0, 0.2);
    border-color: var(--orange, #ff6a00);
    color: var(--orange, #ff6a00);
  }
}

/* Redução de movimento */
@media (prefers-reduced-motion: reduce) {
  .gallery-slide,
  .gallery-nav-btn,
  .gallery-dot,
  .gallery-close-btn,
  .gallery-media {
    transition: none;
  }

  @keyframes mediaZoomIn {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 1; transform: scale(1); }
  }
}
