@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Outfit:wght@300;400;500;600&display=swap');

/* -----------------------------
   CATALOG STYLES
   ----------------------------- */
#catalogOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 8, 8, 0.98);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  color: #fff;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-y: auto;
}

#catalogOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

.catalog-header {
  padding: 2.5rem 4rem 1.5rem 4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.catalog-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 400;
  margin: 0;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff 30%, #aaa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.close-catalog-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.close-catalog-btn:hover {
  transform: rotate(90deg) scale(1.05);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Controls: Search and Filters */
.catalog-controls {
  padding: 2rem 4rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.catalog-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 450px;
}

.search-icon {
  position: absolute;
  left: 18px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
}

#catalogSearch {
  width: 100%;
  padding: 12px 20px 12px 48px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
  transition: all 0.3s ease;
}

#catalogSearch:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.05);
}

.catalog-filter-tabs {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.filter-tab {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 25px;
  color: rgba(255, 255, 255, 0.75);
  padding: 10px 20px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-2px);
}

.filter-tab.active {
  background: #fff;
  color: #000;
  border-color: #fff;
  font-weight: 500;
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.15);
}

/* Gallery Grid */
.catalog-gallery {
  padding: 0 4rem 4rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

.catalog-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 5;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.catalog-item:hover {
  transform: translateY(-8px) scale(1.015);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 255, 255, 0.03);
}

.catalog-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1);
}

.catalog-item:hover img {
  transform: scale(1.05);
}

.catalog-item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.catalog-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.catalog-item-number {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
}

.catalog-item-badges {
  display: flex;
  gap: 6px;
}

.catalog-item-badges .badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.85);
}

.catalog-item-title {
  font-size: 1.25rem;
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.catalog-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 6rem 2rem;
  color: rgba(255, 255, 255, 0.4);
}

.catalog-no-results h3 {
  font-weight: 300;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: rgba(255,255,255,0.7);
}

/* Detail View - Immersive Split Layout */
#catalogDetailView {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 1010;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  overflow: hidden;
}

#catalogDetailView.show {
  opacity: 1;
  pointer-events: auto;
}

.detail-close-btn {
  position: absolute;
  top: 2rem;
  right: 4rem;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 1030;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.detail-close-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.45);
  transform: scale(1.05) rotate(90deg);
}

.immersive-background {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background-size: cover;
  background-position: center;
  filter: blur(25px) brightness(0.4);
  z-index: 1011;
  animation: slowPulse 15s infinite alternate ease-in-out;
}

@keyframes slowPulse {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.06) translate(1%, 1%); }
}

.immersive-overlay {
  position: relative;
  z-index: 1020;
  width: 100%;
  height: 100%;
  display: flex;
  background: radial-gradient(circle at center, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.85) 100%);
  padding: 2rem 5%;
  box-sizing: border-box;
}

.detail-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 5rem;
  max-width: 1300px;
  width: 100%;
  margin: auto;
  height: 100%;
  z-index: 1022;
}

.detail-image-sec {
  flex: 1.1;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  max-height: 80vh;
}

.detail-artwork-img {
  max-width: 100%;
  max-height: 75vh;
  border-radius: 16px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  object-fit: contain;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.6s ease;
}

.detail-artwork-img:hover {
  transform: scale(1.02);
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.95), 0 0 40px rgba(255,255,255,0.05);
}

.detail-info-sec {
  flex: 0.9;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  color: #fff;
  text-align: left;
  max-width: 500px;
}

.immersive-theme {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 5px;
  margin-bottom: 1.2rem;
  font-weight: 500;
}

.immersive-title {
  font-family: 'Playfair Display', serif;
  font-size: 3.2rem;
  font-weight: 400;
  margin: 0 0 1.8rem 0;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.immersive-story {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 2.5rem 0;
  max-height: 25vh;
  overflow-y: auto;
  padding-right: 15px;
}

/* Custom Scrollbar for Story Content */
.immersive-story::-webkit-scrollbar {
  width: 4px;
}
.immersive-story::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
}
.immersive-story::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.immersive-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
}

.immersive-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 30px;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  min-width: 120px;
}

.immersive-link:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
}

/* Catalog Trigger Button Placement */
#openCatalogBtn {
  position: fixed;
  top: 30px;
  right: 90px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 99;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  color: #fff;
}

#openCatalogBtn:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive Styles */
@media (max-width: 1100px) {
  .detail-container {
    gap: 3rem;
  }
  .immersive-title {
    font-size: 2.8rem;
  }
}

@media (max-width: 900px) {
  .catalog-header {
    padding: 2rem;
  }
  .catalog-controls {
    padding: 1.5rem 2rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1.2rem;
  }
  .catalog-search-wrapper {
    max-width: none;
  }
  .catalog-gallery {
    padding: 0 2rem 3rem 2rem;
    gap: 1.8rem;
  }
  
  /* Split view mobile collapse */
  .detail-container {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 5rem;
    padding-bottom: 3rem;
    gap: 2rem;
    overflow-y: auto;
  }
  .detail-image-sec {
    flex: none;
    height: auto;
    max-height: 45vh;
    width: 100%;
  }
  .detail-artwork-img {
    max-height: 42vh;
  }
  .detail-info-sec {
    flex: none;
    max-width: 100%;
    width: 100%;
    align-items: center;
    text-align: center;
  }
  .immersive-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
  }
  .immersive-story {
    font-size: 1rem;
    max-height: none;
    overflow-y: visible;
    text-align: center;
    padding-right: 0;
    margin-bottom: 2rem;
  }
  .immersive-links {
    justify-content: center;
  }
  .detail-close-btn {
    top: 1.5rem;
    right: 1.5rem;
    width: 42px;
    height: 42px;
  }
}

@media (max-width: 480px) {
  .catalog-header h2 {
    font-size: 1.6rem;
  }
  .filter-tab {
    padding: 8px 16px;
    font-size: 0.8rem;
  }
  .catalog-gallery {
    grid-template-columns: 1fr;
  }
  .immersive-title {
    font-size: 1.8rem;
  }
  .immersive-link {
    width: 100%;
  }
}
