/* ============================================================
   Salsa Models — Custom Styles
   Complements Tailwind utility classes with animations,
   transitions, and behaviours that need CSS-level control.
   ============================================================ */

/* ---- Smooth scroll ---- */
html {
  scroll-behavior: smooth;
}

/* ---- Selection colour ---- */
::selection {
  background-color: #C9A96E;
  color: #0A1628;
}

/* ---- Hero fade-in-up animation ---- */
.fade-in-up {
  animation: fadeInUp 1.2s ease-out forwards;
}

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

/* ---- Scroll-reveal elements ---- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Staggered reveal children ---- */
.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.3s; }

/* ---- Header shadow on scroll ---- */
#site-header.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
}

/* ---- Mobile menu hamburger → X animation ---- */
#menu-toggle.active .menu-bar:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

#menu-toggle.active .menu-bar:nth-child(2) {
  opacity: 0;
}

#menu-toggle.active .menu-bar:nth-child(3) {
  width: 1.5rem;
  transform: translateY(-4px) rotate(-45deg);
}

/* ---- Mobile drawer open state ---- */
#mobile-menu.open {
  transform: translateX(0);
}

/* ---- Model card image wrapper ---- */
.group:hover img {
  /* Handled by Tailwind group-hover, but ensuring smooth feel */
  will-change: transform;
}

/* ---- Gold underline animation for links ---- */
.gold-underline {
  position: relative;
  display: inline-block;
}

.gold-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #C9A96E;
  transition: width 0.3s ease;
}

.gold-underline:hover::after {
  width: 100%;
}

/* ---- Prevent body scroll when mobile menu is open ---- */
body.menu-open {
  overflow: hidden;
}

/* ---- Subtle loading placeholder for images ---- */
img {
  background-color: #1B2D4A;
}

/* ---- Focus styles for accessibility ---- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #C9A96E;
  outline-offset: 2px;
}

/* ============================================================
   Models Page — Filter, Cards, Lightbox
   ============================================================ */

/* ---- Filter buttons ---- */
.filter-btn {
  background-color: transparent;
  color: #6B7280;
  border: 1px solid #e5e7eb;
  cursor: pointer;
}

.filter-btn:hover {
  color: #0A1628;
  border-color: #C9A96E;
}

.filter-btn.active {
  background-color: #C9A96E;
  color: #0A1628;
  border-color: #C9A96E;
}

/* ---- Model card show/hide transitions ---- */
.model-card {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.model-card.card-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.model-card.card-hidden {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
}

/* ---- Lightbox overlay ---- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(10, 22, 40, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s;
  z-index: 101;
}

.lightbox-close:hover {
  color: #C9A96E;
  border-color: #C9A96E;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 85vh;
  animation: lightboxFadeIn 0.4s ease forwards;
}

.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
  text-align: center;
  padding: 1.25rem 0 0;
}

@keyframes lightboxFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Prevent body scroll when lightbox is open */
body.lightbox-open {
  overflow: hidden;
}

@media (min-width: 768px) {
  .lightbox-image {
    max-height: 75vh;
  }
  .lightbox-content {
    max-width: 60vw;
  }
}

/* ============================================================
   Model Profile — Gallery & Measurements
   ============================================================ */

/* ---- Gallery container ---- */
.gallery-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 2px;
}

.gallery-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: grab;
  will-change: transform;
}

.gallery-slide {
  min-width: 100%;
  flex-shrink: 0;
}

.gallery-slide img {
  width: 100%;
  height: 70vh;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

@media (max-width: 768px) {
  .gallery-slide img {
    height: 50vh;
  }
}

/* ---- Gallery arrow buttons ---- */
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(10, 22, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.gallery-arrow:hover {
  background-color: rgba(10, 22, 40, 0.85);
  border-color: #C9A96E;
  color: #C9A96E;
}

.gallery-prev {
  left: 1rem;
}

.gallery-next {
  right: 1rem;
}

@media (max-width: 640px) {
  .gallery-arrow {
    width: 2.5rem;
    height: 2.5rem;
  }
  .gallery-prev {
    left: 0.5rem;
  }
  .gallery-next {
    right: 0.5rem;
  }
}

/* ---- Gallery dot indicators ---- */
.gallery-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 0;
}

.gallery-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #C9A96E;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s;
  padding: 0;
}

.gallery-dot:hover {
  background-color: rgba(201, 169, 110, 0.4);
}

.gallery-dot.active {
  background-color: #C9A96E;
  transform: scale(1.2);
}

/* ---- Measurements bar ---- */
.measurements-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 2rem;
  padding: 1.5rem 0;
}

.measurement-item {
  text-align: center;
}

.measurement-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #C9A96E;
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.measurement-value {
  display: block;
  font-size: 0.9rem;
  color: #1A1A2E;
  font-weight: 500;
}

@media (min-width: 768px) {
  .measurements-bar {
    gap: 0;
  }
  .measurement-item {
    padding: 0 1.5rem;
    border-right: 1px solid #e5e7eb;
  }
  .measurement-item:last-child {
    border-right: none;
  }
}
