/* Dynamic Gallery Styles - 1st Choice Home Improvement */

.dynamic-gallery-wrapper {
  padding: 60px 20px 80px;
  max-width: 1300px;
  margin: 0 auto;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.gallery-header-block {
  text-align: center;
  margin-bottom: 40px;
}

.gallery-main-title {
  font-size: 36px;
  font-weight: 800;
  color: #1a202c;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  text-transform: uppercase;
}

.gallery-subtitle {
  font-size: 18px;
  color: #4a5568;
  max-width: 650px;
  margin: 0 auto 20px;
  line-height: 1.6;
}

/* Category Filter Tabs */
.gallery-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.gallery-tab-btn {
  background: #ffffff;
  color: #2d3748;
  border: 2px solid #e2e8f0;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.gallery-tab-btn:hover {
  border-color: #01a6f2;
  color: #01a6f2;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(1, 166, 242, 0.15);
}

.gallery-tab-btn.active {
  background: #01a6f2;
  color: #ffffff;
  border-color: #01a6f2;
  box-shadow: 0 4px 12px rgba(1, 166, 242, 0.35);
}

.gallery-tab-count {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.gallery-tab-btn.active .gallery-tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Photo Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  background: #ffffff;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img {
  transform: scale(1.06);
}

/* Card Overlay */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-album {
  align-self: flex-start;
  background: #f98702;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.gallery-item-title {
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Lightbox Modal */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.94);
  backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.gallery-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content-box {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  margin-top: 15px;
  color: #ffffff;
  text-align: center;
}

.lightbox-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.lightbox-subtitle {
  font-size: 14px;
  color: #a0aec0;
}

/* Lightbox Controls */
.lightbox-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 24px;
  transition: all 0.2s ease;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.lightbox-close {
  top: -60px;
  right: 0;
}

.lightbox-prev {
  left: -70px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: -70px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev:hover {
  transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
  transform: translateY(-50%) scale(1.1);
}

/* Status / Loading */
.gallery-status-msg {
  text-align: center;
  padding: 60px 20px;
  color: #718096;
  font-size: 16px;
  grid-column: 1 / -1;
}

.gallery-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #01a6f2;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .gallery-main-title { font-size: 28px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-close { top: 10px; right: 10px; }
  .lightbox-btn { width: 42px; height: 42px; font-size: 20px; }
}
