/* Gallery Page Styles */

.gallery-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f9f0e7 0%, #ffffff 50%, #f9f0e7 100%);
  padding: 6rem 0 3rem;
}

.gallery-page .container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 3rem;
  max-width: 1600px;
}

/* Sidebar Styles */
.gallery-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 6rem;
  height: fit-content;
}

.sidebar-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 100%);
  padding: 2rem;
  border-radius: 20px;
  color: white;
  text-align: center;
}

.sidebar-header h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.sidebar-header p {
  opacity: 0.9;
  font-size: 0.95rem;
}

/* Model Preview Cards */
.model-preview-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(14, 34, 56, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  border: 2px solid transparent;
}

.model-preview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(14, 34, 56, 0.15);
  border-color: var(--accent);
}

.model-preview-card.active {
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(247, 127, 0, 0.2);
  cursor: default;
}

.model-preview-card.active:hover {
  transform: none;
}

.card-image {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.model-preview-card:not(.active):hover .card-image img {
  transform: scale(1.1);
}

.card-content {
  padding: 1.5rem;
}

.card-content h4 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.card-content p {
  color: var(--neutral);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.card-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8f1a 100%);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  transition: gap 0.3s ease;
}

.model-preview-card:hover .card-link {
  gap: 0.75rem;
}

/* Sidebar CTA */
.sidebar-cta {
  background: linear-gradient(135deg, rgba(14, 34, 56, 0.05) 0%, rgba(247, 127, 0, 0.05) 100%);
  padding: 2rem;
  border-radius: 16px;
  text-align: center;
  border: 1px solid rgba(247, 127, 0, 0.2);
}

.sidebar-cta h4 {
  color: var(--primary-dark);
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.sidebar-cta p {
  color: var(--neutral);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Main Gallery Area */
.gallery-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.gallery-title h1 {
  font-size: 2.5rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gallery-title p {
  color: var(--neutral);
  font-size: 1.1rem;
}

.gallery-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid var(--accent);
  background: white;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: var(--accent);
  color: white;
  transform: scale(1.05);
}

/* Featured Image Container */
.featured-image-container {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(14, 34, 56, 0.12);
}

.featured-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #f0f0f0;
  overflow: hidden;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 50%;
  color: var(--primary-dark);
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.nav-arrow:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

.nav-arrow.prev {
  left: 2rem;
}

.nav-arrow.next {
  right: 2rem;
}

.image-caption {
  padding: 2rem;
  background: linear-gradient(to bottom, white 0%, #f9f9f9 100%);
  border-top: 1px solid rgba(14, 34, 56, 0.1);
}

.image-caption h3 {
  font-size: 1.5rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.image-caption p {
  color: var(--neutral);
  font-size: 1rem;
  line-height: 1.6;
}

/* Thumbnails Container */
.thumbnails-container {
  background: white;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(14, 34, 56, 0.08);
}

.thumbnails-container h4 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(247, 127, 0, 0.2);
}

.thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.thumbnail {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
}

.thumbnail:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.thumbnail.active {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(247, 127, 0, 0.3);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.thumbnail:hover img {
  transform: scale(1.1);
}

.thumbnail-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(14, 34, 56, 0.9) 0%, transparent 100%);
  padding: 1rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.thumbnail:hover .thumbnail-overlay,
.thumbnail.active .thumbnail-overlay {
  transform: translateY(0);
}

.thumbnail-overlay span {
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  display: block;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .gallery-page .container {
    grid-template-columns: 280px 1fr;
    gap: 2rem;
  }
  
  .thumbnails-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 968px) {
  .gallery-page {
    padding: 5rem 0 2rem;
  }
  
  .gallery-page .container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .gallery-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
  }
  
  .sidebar-header {
    grid-column: 1 / -1;
  }
  
  .sidebar-cta {
    grid-column: 1 / -1;
  }
  
  .gallery-title h1 {
    font-size: 2rem;
  }
  
  .gallery-header {
    flex-direction: column;
  }
  
  .gallery-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .nav-arrow {
    width: 48px;
    height: 48px;
  }
  
  .nav-arrow.prev {
    left: 1rem;
  }
  
  .nav-arrow.next {
    right: 1rem;
  }
}

@media (max-width: 640px) {
  .gallery-page {
    padding: 4.5rem 0 1.5rem;
  }
  
  .gallery-sidebar {
    grid-template-columns: 1fr;
  }
  
  .card-image {
    height: 200px;
  }
  
  .gallery-title h1 {
    font-size: 1.8rem;
  }
  
  .featured-image {
    aspect-ratio: 1/1;
  }
  
  .image-caption {
    padding: 1.5rem;
  }
  
  .thumbnails-container {
    padding: 1.5rem;
  }
  
  .thumbnails-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
  }
  
  .nav-arrow {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  
  .nav-arrow.prev {
    left: 0.5rem;
  }
  
  .nav-arrow.next {
    right: 0.5rem;
  }
}

/* Fullscreen Mode */
.gallery-page.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: black;
  padding: 0;
}

.gallery-page.fullscreen .gallery-sidebar,
.gallery-page.fullscreen .gallery-header,
.gallery-page.fullscreen .thumbnails-container {
  display: none;
}

.gallery-page.fullscreen .featured-image-container {
  height: 100vh;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: black;
}

.gallery-page.fullscreen .featured-image {
  max-width: 100vw;
  max-height: 100vh;
  aspect-ratio: auto;
}

.gallery-page.fullscreen .image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  color: white;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-page.fullscreen .featured-image-container:hover .image-caption {
  transform: translateY(0);
}

.gallery-page.fullscreen .image-caption h3,
.gallery-page.fullscreen .image-caption p {
  color: white;
}
