/* Photo Album Optimized Styles - Modern Design */

/* CSS Custom Properties for consistent theming */
:root {
  --primary-color: #007bff;
  --primary-dark: #0056b3;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --border-radius: 15px;
  --box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  --box-shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.2);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --gradient-primary: linear-gradient(135deg, #FFE5E5 0%, #FFF0F5 50%, #E5F3FF 100%);
  --gradient-dark: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* Remove default margins and padding from body and html */
html,
body {
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Remove any top margin from the first element */
.row:first-child {
  margin-top: 100px !important;
}

/* Ensure hero section starts at the very top */
.hero-video-container {
  margin-top: 0 !important;
  padding-top: 100px !important;
}

.photo-album-hero {
  background: linear-gradient(135deg, #FFF9E6 0%, #FFE5F0 25%, #E6F3FF 50%, #E6FFE6 75%, #FFF9E6 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  position: relative;
  overflow: hidden;
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.hero-decoration {
  position: relative;
  margin-top: 1rem;
}

.decoration-circle {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
  animation: float 3s ease-in-out infinite;
}

.decoration-circle:nth-child(1) {
  left: 20%;
  animation-delay: 0s;
}

.decoration-circle:nth-child(2) {
  left: 50%;
  animation-delay: 1s;
}

.decoration-circle:nth-child(3) {
  left: 80%;
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Gallery Controls */
.gallery-controls {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 1rem;
  margin-top: -2rem;
  padding: 1.5rem;
}

.search-container .input-group {
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-container .input-group-text {
  background: var(--primary-color);
  border: none;
  color: white;
  border-radius: 25px 0 0 25px;
}

.search-container .form-control {
  border: none;
  border-radius: 0 25px 25px 0;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

.search-container .form-control:focus {
  box-shadow: none;
  border-color: transparent;
}

.gallery-stats {
  font-weight: 500;
  font-size: 1.1rem;
}

.gallery-filters {
  margin-bottom: 3rem;
}

.filter-btn {
  border-radius: 25px;
  padding: 0.5rem 1.5rem;
  transition: var(--transition);
  border: 2px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color);
  position: relative;
  overflow: hidden;
}

.filter-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;
}

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

.filter-btn:hover,
.filter-btn.active {
  background: linear-gradient(135deg, #FF6B9D, #FFB3D9, #FFD6E8);
  color: white;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 25px rgba(255, 107, 157, 0.5);
  border-color: #FFD700;
}

.filter-count {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  margin-left: 0.5rem;
  min-width: 1.5rem;
  display: inline-block;
  text-align: center;
}

.filter-btn.active .filter-count {
  background: rgba(255, 255, 255, 0.3);
}

.gallery-card {
  background: white;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(255, 107, 157, 0.2);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  height: 350px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
  position: relative;
  border: 4px solid transparent;
  background: linear-gradient(white, white) padding-box,
              linear-gradient(135deg, #FF6B9D, #FFD700, #87CEEB, #98FB98, #FF6B9D) border-box;
}

.gallery-card.featured {
  border: 2px solid var(--warning-color);
  box-shadow: 0 5px 20px rgba(255, 193, 7, 0.3);
}

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

.gallery-card:hover {
  transform: translateY(-15px) rotate(2deg) scale(1.03);
  box-shadow: 0 20px 40px rgba(255, 107, 157, 0.4);
  border-width: 5px;
}

.featured-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--warning-color);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(255, 193, 7, 0.3);
}

.featured-badge i {
  margin-right: 0.3rem;
}

.gallery-image-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
  opacity: 0;
  background: #f8f9fa;
}

.gallery-image.loaded {
  opacity: 1;
}

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

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
  backdrop-filter: blur(2px);
}

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

.gallery-overlay-content {
  text-align: center;
  color: white;
  padding: 1.5rem;
  max-width: 90%;
}

.category-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  opacity: 0.8;
}

.gallery-overlay-content h5 {
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 1.2rem;
}

.gallery-overlay-content p {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.4;
}

.gallery-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.gallery-actions .btn {
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.gallery-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.gallery-card-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 1rem;
  color: white;
  transform: translateY(100%);
  transition: var(--transition);
}

.gallery-card:hover .gallery-card-footer {
  transform: translateY(0);
}

.gallery-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: white;
}

.gallery-category {
  font-size: 0.8rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Enhanced Lightbox Styles */
.lightbox-image-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.lightbox-img {
  max-height: 80vh;
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: opacity 0.3s ease-in-out;
  opacity: 1;
}

.lightbox-image-container {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lightbox-controls .btn {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-controls .btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.lightbox-navigation-hint {
  font-size: 0.8rem;
  opacity: 0.7;
}

.modal-content.bg-dark {
  background: var(--gradient-dark) !important;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.cta-section {
  background: linear-gradient(135deg, #FF6B9D 0%, #FFB3D9 50%, #FFD6E8 100%);
}

.btn-outline-light:hover {
  background: white;
  color: #007bff;
}

/* Loading spinner */
#loading-spinner {
  display: none;
}

#loading-spinner.show {
  display: block;
}

/* Pagination styles */
.pagination {
  margin-top: 2rem;
}

.page-link {
  border-radius: 50%;
  margin: 0 2px;
  border: 3px solid #FF6B9D;
  color: #FF6B9D;
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  font-weight: 600;
}

.page-link:hover,
.page-link.active {
  background: linear-gradient(135deg, #FF6B9D, #FFB3D9);
  color: white;
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
  border-color: #FFD700;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .photo-album-hero {
    min-height: 50vh;
    padding: 2rem 0;
  }

  .gallery-controls {
    padding: 1rem;
  }

  .gallery-controls .row {
    flex-direction: column;
    gap: 1rem;
  }

  .search-container .input-group {
    width: 100%;
  }

  .gallery-card {
    height: 280px;
  }

  .filter-btn {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .gallery-overlay-content {
    padding: 1rem;
  }

  .gallery-overlay-content h5 {
    font-size: 1rem;
  }

  .gallery-overlay-content p {
    font-size: 0.8rem;
  }

  .gallery-actions {
    flex-direction: column;
    gap: 0.3rem;
  }

  .gallery-actions .btn {
    width: 100%;
    font-size: 0.8rem;
  }

  .lightbox-img {
    max-height: 60vh;
  }

  .lightbox-controls .btn {
    width: 35px;
    height: 35px;
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .gallery-card {
    height: 250px;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
  }

  .gallery-overlay-content {
    padding: 0.8rem;
  }

  .category-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .gallery-card-footer {
    padding: 0.8rem;
  }

  .gallery-title {
    font-size: 0.9rem;
  }

  .gallery-category {
    font-size: 0.7rem;
  }
}

/* Animation for gallery items */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Filter animation */
.gallery-item.hidden {
  display: none;
}

.gallery-item.visible {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Image placeholder */
.gallery-image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.gallery-image.loaded::before {
  display: none;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Performance optimizations */
.gallery-item {
  will-change: transform, opacity;
}

.gallery-image {
  will-change: transform, opacity;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .gallery-card,
  .gallery-image,
  .decoration-circle {
    animation: none;
    transition: none;
  }
  
  .gallery-card:hover {
    transform: none;
  }
  
  .gallery-card:hover .gallery-image {
    transform: none;
  }
}
