/* ================================================
   MODERN UI ENHANCEMENTS
   Smooth animations, lazy loading, and UX improvements
   ================================================ */

/* ===== SMOOTH SCROLL ===== */
html {
  scroll-behavior: smooth;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #8B0000, #B22222);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 15px rgba(139, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(100px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: linear-gradient(135deg, #A00000, #C22222);
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(139, 0, 0, 0.4);
}

.back-to-top:active {
  transform: translateY(-2px);
}

/* ===== IMAGE LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  animation: zoomIn 0.3s ease;
}

.lightbox-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 36px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.lightbox-close:hover {
  transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(139, 0, 0, 0.8);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(139, 0, 0, 1);
  transform: translateY(-50%) scale(1.1);
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== SCROLL ANIMATIONS ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* ===== ENHANCED HOVER EFFECTS ===== */
.card,
.event-card,
.golden-frame-enhanced {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover,
.event-card:hover {
  transform: translateY(-8px) scale(1.02);
}

.golden-frame-enhanced:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(255, 215, 0, 0.3);
}

/* Gallery image zoom effect */
.gallery-image-item {
  overflow: hidden;
  cursor: pointer;
}

.gallery-image-item img {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-image-item:hover img {
  transform: scale(1.15);
}

/* ===== LOADING ANIMATIONS ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.skeleton-card {
  height: 300px;
  margin-bottom: 20px;
}

.skeleton-text {
  height: 20px;
  margin-bottom: 10px;
}

/* ===== IMPROVED TRANSITIONS ===== */
* {
  -webkit-tap-highlight-color: transparent;
}

a,
button {
  transition: all 0.3s ease;
}

/* Exclude slider images from opacity transitions */
.slide img {
  transition: none !important;
  opacity: 1 !important;
}

/* Apply transitions to other images */
img:not(.slide img) {
  transition: opacity 0.3s ease;
}

img[loading="lazy"]:not(.slide img) {
  opacity: 0;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #8B0000;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  z-index: 10000;
  transition: top 0.3s ease;
}

.skip-to-content:focus {
  top: 0;
}

*:focus-visible {
  outline: 3px solid #FFD700;
  outline-offset: 2px;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
  .back-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
    font-size: 20px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-content {
    max-width: 95%;
    max-height: 85%:
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}