/* ===== CLEAN GALLERY FADE-IN UPWARD ANIMATION ===== */

/* Gallery Section Title Animation */
.gallery-section-title {
  margin-bottom: 3rem;
  position: relative;
}

.gallery-section-title h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 0.5rem;
}

.gallery-section-title h2 a {
  color: inherit;
  text-decoration: none;
}

.gallery-section-title h2 a:hover {
  color: #007bff;
  transition: color 0.3s ease;
}

/* Gallery Subtitle Styling - Same as Facilities */
.gallery-subtitle {
  color: #007bff !important;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  position: relative;
  display: inline-block;
}

.gallery-subtitle::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #007bff, #0056b3);
  border-radius: 2px;
}

/* Gallery Container Animation */
.gallery-container {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-container.gallery-fade-loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Gallery Card Animation */
.gallery-card {
  opacity: 0;
  transform: translateY(25px);
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-card.gallery-fade-loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Gallery Fade Up Class */
.gallery-fade-up {
  opacity: 0;
  transform: translateY(25px);
  transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-fade-up.gallery-fade-loaded {
  opacity: 1;
  transform: translateY(0);
}

/* Basic Gallery Styling */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 2rem;
}

.gallery-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transition: all 0.25s ease;
}

/* Gallery Image Container */
.gallery-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.25s ease;
  display: block;
}

.gallery-card:hover .gallery-image {
  transform: scale(1.05);
}

/* Gallery Overlay */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.4), rgba(0,0,0,0.7));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 20px;
  text-align: center;
}

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

.gallery-overlay-title {
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.gallery-actions {
  display: flex;
  gap: 10px;
}

.gallery-btn-preview {
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #333;
}

.gallery-btn-preview:hover {
  background: white;
  transform: scale(1.1);
  color: #007bff;
  transition: all 0.2s ease;
}

/* Gallery Meta */
.gallery-meta {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0;
  line-height: 1.4;
}

.gallery-badge {
  display: inline-block;
  background: #e3f2fd;
  color: #1976d2;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  align-self: flex-start;
}

/* Responsive Design */
@media (max-width: 768px) {
  .gallery-section-title h2 {
    font-size: 2rem;
  }
  
  .gallery-subtitle {
    font-size: 0.9rem;
    letter-spacing: 0.3px;
  }
  
  .gallery-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .gallery-image-container {
    aspect-ratio: 16/9;
  }
  
  .gallery-meta {
    padding: 12px;
  }
  
  .gallery-overlay-title {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .gallery-section-title h2 {
    font-size: 1.75rem;
  }
  
  .gallery-subtitle {
    font-size: 0.85rem;
  }
  
  .gallery-container {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 1.5rem;
  }
  
  .gallery-image-container {
    aspect-ratio: 3/2;
  }
  
  .gallery-meta {
    padding: 10px;
  }
  
  .gallery-title {
    font-size: 0.9rem;
  }
  
  .gallery-badge {
    font-size: 0.7rem;
    padding: 3px 6px;
  }
}


/* Gallery Expand/Collapse Functionality */
.gallery-extra-item {
  opacity: 0;
  transform: translateY(25px) scale(0.95);
  transition: all 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  pointer-events: none;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.gallery-expanded .gallery-extra-item {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Enhanced animation keyframes */
@keyframes galleryItemFadeIn {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes galleryItemFadeOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 0.3;
    transform: translateY(10px) scale(0.98);
  }
  100% {
    opacity: 0;
    transform: translateY(25px) scale(0.95);
  }
}

/* Smooth container transition */
.gallery-container {
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: auto;
}

.gallery-container.gallery-expanded {
  transform: translateY(0);
}

.gallery-expand-btn {
  background: linear-gradient(135deg, #007bff, #0056b3);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,123,255,0.3);
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.gallery-expand-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.gallery-expand-btn:hover::before {
  left: 100%;
}

.gallery-expand-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0,123,255,0.5);
  background: linear-gradient(135deg, #0056b3, #004085);
}

.gallery-expand-btn:active {
  transform: translateY(-1px) scale(0.98);
  transition: all 0.1s ease;
}

.gallery-expand-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}

.gallery-expand-btn .expand-icon {
  transition: transform 0.3s ease;
  margin-left: 8px;
}

.gallery-expanded .gallery-expand-btn .expand-icon {
  transform: rotate(180deg);
}

.beranda-gallery-expand-section {
  margin-top: 2rem;
  padding: 1rem 0;
  text-align: center;
}

/* Smooth animation for gallery container */
.gallery-container {
  transition: all 0.3s ease;
}

/* Gallery "Lihat Semua" button animation */
#gallery-see-all-container {
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-top: 1.5rem;
  will-change: transform, opacity;
}

#gallery-see-all-container.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Loading state animation */
@keyframes buttonPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.gallery-expand-btn.loading {
  animation: buttonPulse 1s ease-in-out infinite;
  pointer-events: none;
}

#gallery-see-all-btn {
  background: linear-gradient(135deg, #28a745, #20c997);
  border: none;
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
  box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

#gallery-see-all-btn:hover {
  background: linear-gradient(135deg, #20c997, #17a2b8);
  color: white;
  text-decoration: none;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.5);
}

#gallery-see-all-btn:active {
  transform: translateY(-1px) scale(0.98);
  transition: all 0.1s ease;
}

/* Responsive adjustments for expand button */
@media (max-width: 768px) {
  .gallery-expand-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
  
  .beranda-gallery-expand-section {
    margin-top: 1.5rem;
  }
}

@media (max-width: 480px) {
  .gallery-expand-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  
  .beranda-gallery-expand-section {
    margin-top: 1rem;
  }
}

/* News Section Button Styling */
#news-see-all-container {
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  margin-top: 1rem;
  will-change: transform, opacity;
}

#news-see-all-container.show {
  opacity: 1;
  transform: translateY(0);
}

#news-see-all-btn {
  background: linear-gradient(135deg, #17a2b8, #138496);
  border: none;
  color: white;
  padding: 8px 20px;
  border-radius: 18px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: inline-block;
  box-shadow: 0 3px 8px rgba(23, 162, 184, 0.3);
  position: relative;
  overflow: hidden;
}

#news-see-all-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.4s ease;
}

#news-see-all-btn:hover::before {
  left: 100%;
}

#news-see-all-btn:hover {
  background: linear-gradient(135deg, #138496, #117a8b);
  color: white;
  text-decoration: none;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 5px 15px rgba(23, 162, 184, 0.4);
}

#news-see-all-btn:active {
  transform: translateY(-1px) scale(0.98);
  transition: all 0.1s ease;
}

/* Load More Button Enhanced Styling */
.beranda-load-more-btn {
  background: linear-gradient(135deg, #6c757d, #5a6268);
  border: none;
  color: white;
  padding: 10px 24px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: inline-block;
  box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3);
  position: relative;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.beranda-load-more-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.4s ease;
}

.beranda-load-more-btn:hover::before {
  left: 100%;
}

.beranda-load-more-btn:hover {
  background: linear-gradient(135deg, #5a6268, #495057);
  color: white;
  text-decoration: none;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
}

.beranda-load-more-btn:active {
  transform: translateY(-1px) scale(0.98);
  transition: all 0.1s ease;
}

/* Button Container Spacing */
.beranda-load-more {
  margin-bottom: 0.5rem;
}

/* Responsive adjustments for news buttons */
@media (max-width: 768px) {
  #news-see-all-btn {
    padding: 7px 18px;
    font-size: 0.8rem;
  }
  
  .beranda-load-more-btn {
    padding: 9px 20px;
    font-size: 0.85rem;
  }
  
  #news-see-all-container {
    margin-top: 0.75rem;
  }
}

@media (max-width: 480px) {
  #news-see-all-btn {
    padding: 6px 16px;
    font-size: 0.75rem;
  }
  
  .beranda-load-more-btn {
    padding: 8px 18px;
    font-size: 0.8rem;
  }
  
  #news-see-all-container {
    margin-top: 0.5rem;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .gallery-section-title,
  .gallery-container,
  .gallery-card,
  .gallery-fade-up,
  .gallery-extra-item,
  #news-see-all-container,
  #news-see-all-btn,
  .beranda-load-more-btn {
    transition: opacity 0.3s ease !important;
    transform: none !important;
  }
  
  .gallery-section-title.gallery-fade-loaded,
  .gallery-container.gallery-fade-loaded,
  .gallery-card.gallery-fade-loaded,
  .gallery-fade-up.gallery-fade-loaded,
  .gallery-expanded .gallery-extra-item,
  #news-see-all-container.show {
    opacity: 1 !important;
    transform: none !important;
  }
  
  .gallery-expand-btn .expand-icon,
  #news-see-all-btn::before,
  .beranda-load-more-btn::before {
    animation: none !important;
    transform: none !important;
  }
}
