/* ============================================================
   GALLERY SECTION STYLING
   Enhanced UI for Event Gallery with Animations
   ============================================================ */

/* Section Wrapper */
#gallery {
  padding-top: 100px;
  padding-bottom: 100px;
  background: linear-gradient(135deg, rgba(24, 24, 24, 0.95) 0%, rgba(184, 24, 62, 0.05) 100%);
  position: relative;
  overflow: hidden;
}

/* Background Pattern Animation */
#gallery::before {
  content: '';
  position: absolute;
  top: 50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(250, 250, 210, 0.08) 0%, rgba(184, 24, 62, 0.08) 100%);
  border-radius: 50%;
  animation: float 8s ease-in-out infinite;
  z-index: 0;
}

/* Section Header Styles */
.gallery-section-header {
  position: relative;
  z-index: 1;
  margin-bottom: 60px;
}

.gallery-badge {
  display: inline-block;
  background: rgba(184, 24, 62, 0.1);
  color: #b8183e;
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 1px;
  margin-bottom: 20px;
  animation: fadeInDown 0.6s ease;
}

.gallery-badge i {
  margin-right: 0.5rem;
}

.gallery-title {
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 20px;
  animation: fadeInUp 0.8s ease 0.1s both;
}

.gallery-title.gradient-text {
  background: linear-gradient(135deg, #b8183e 0%, #ff6b8a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gallery-subtitle {
  font-size: 1.1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
  max-width: 650px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease 0.2s both;
}

/* Filter Buttons Container */
.filter-buttons-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-bottom: 50px;
  animation: fadeInUp 0.8s ease 0.3s both;
}

/* Filter Button Styling */
.filter-btn {
  padding: 0.75rem 1.8rem;
  border: 2px solid #e0e0e0;
  background: transparent;
  color: #666;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: capitalize;
}

.filter-btn i {
  font-size: 1rem;
}

.filter-btn:hover {
  border-color: #b8183e;
  color: #b8183e;
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(184, 24, 62, 0.15);
}

.filter-btn.active {
  background: linear-gradient(135deg, #b8183e 0%, #d41f50 100%);
  color: white;
  border-color: #b8183e;
  box-shadow: 0 12px 30px rgba(184, 24, 62, 0.35);
  transform: translateY(-4px);
}

.filter-btn.active i {
  animation: pulse 1s ease infinite;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
  position: relative;
  z-index: 1;
  margin-bottom: 50px;
}

@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Gallery Item */
.gallery-item {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

/* Gallery Card Wrapper */
.gallery-card-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(184, 24, 62, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
  background: linear-gradient(135deg, #f8f9fa 0%, #f0f0f0 100%);
  cursor: pointer;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-card-wrapper:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 50px rgba(184, 24, 62, 0.3);
  border-color: #b8183e;
}

/* Gallery Image */
.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.5s ease;
  display: block;
}

.gallery-card-wrapper:hover .gallery-img {
  transform: scale(1.15) rotate(3deg);
  filter: brightness(1.12) saturate(1.2);
}

/* Gallery Overlay */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(24, 24, 24, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

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

/* Overlay Content */
.overlay-content {
  text-align: center;
  color: white;
  animation: slideInUp 0.5s ease;
}

.overlay-content i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
  animation: bounce 1s ease infinite;
}

.overlay-content h5 {
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.overlay-content p {
  opacity: 0.9;
  font-size: 0.9rem;
}

/* Category Badge on Card */
.gallery-card-wrapper .badge {
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
  text-transform: capitalize;
  font-weight: 600;
  background: linear-gradient(135deg, #b8183e 0%, #ff6b8a 100%);
  border: none;
  z-index: 15;
  animation: slideInLeft 0.5s ease;
}

/* View More Button */
.view-more-btn-container {
  text-align: center;
  margin-top: 60px;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.btn-explore {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  background: linear-gradient(135deg, #b8183e 0%, #d41f50 100%);
  color: white;
  border: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 25px rgba(184, 24, 62, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-explore:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(184, 24, 62, 0.4);
  color: white;
}

.btn-explore:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(184, 24, 62, 0.3);
}

.btn-explore i {
  margin-right: 0.5rem;
}

/* ============================================================
   MODAL STYLING
   ============================================================ */

.imageModal-content {
  background: #1a1a1a;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(184, 24, 62, 0.2);
}

#imageModal .modal-body {
  padding: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
  position: relative;
}

#modalImage {
  max-height: 90vh;
  max-width: 90vw;
  object-fit: contain;
  animation: zoomIn 0.4s ease;
}

/* Modal Info Section */
#imageModal .modal-body-info {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(24, 24, 24, 0.98) 0%, rgba(184, 24, 62, 0.1) 100%);
  border-top: 1px solid rgba(184, 24, 62, 0.2);
}

#modalTitle {
  color: white;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

/* Close Button */
#imageModal .btn-close {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5) !important;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
}

#imageModal .btn-close:hover {
  background: rgba(184, 24, 62, 0.8) !important;
  transform: scale(1.1);
}

/* Navigation Arrows */
.modal-nav-arrow {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-nav-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.15);
}

.modal-nav-arrow:active {
  transform: scale(0.95);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

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

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 992px) {
  .gallery-title {
    font-size: 2.5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .gallery-card-wrapper {
    min-height: 200px;
  }
}

@media (max-width: 768px) {
  #gallery {
    padding-top: 80px;
    padding-bottom: 80px;
  }

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

  .gallery-subtitle {
    font-size: 1rem;
  }

  .filter-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }

  .gallery-grid {
    gap: 15px;
  }

  .overlay-content i {
    font-size: 2rem;
  }

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

@media (max-width: 576px) {
  #gallery {
    padding-top: 60px;
    padding-bottom: 60px;
  }

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

  .gallery-badge {
    font-size: 0.8rem;
  }

  .filter-buttons-container {
    gap: 10px;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }

  .filter-btn i {
    display: none;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-card-wrapper {
    min-height: 250px;
  }

  #imageModal .modal-body {
    min-height: 300px;
  }

  .modal-nav-arrow {
    display: none !important;
  }
}

/* Dark Mode Compatibility */
@media (prefers-color-scheme: dark) {
  #gallery {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.98) 0%, rgba(184, 24, 62, 0.08) 100%);
  }

  .gallery-subtitle {
    color: rgba(255, 255, 255, 0.75);
  }

  .filter-btn {
    border-color: #444;
    color: #aaa;
  }

  .gallery-card-wrapper {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(40, 40, 40, 0.9) 100%);
  }
}

/* Accessibility */
.filter-btn:focus-visible {
  outline: 2px solid #b8183e;
  outline-offset: 2px;
}

.gallery-card-wrapper:focus-visible {
  outline: 2px solid #b8183e;
  outline-offset: 4px;
}
