/* Smooth scrolling for the entire page */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #ec4899, #a855f7);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #db2777, #9333ea);
}

/* Ensure proper touch targets on mobile */
@media (max-width: 768px) {
  button, a {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Optimize text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Prevent horizontal scroll on mobile */
body {
  overflow-x: hidden;
}

/* Enhanced focus states for accessibility */
button:focus-visible,
a:focus-visible {
  outline: 2px solid #ec4899;
  outline-offset: 2px;
}

/* Header background transition */
.header-scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Slideshow container styles */
#slideshow-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

/* Slide styles */
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.slide.active {
  opacity: 1;
  z-index: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  transition: transform 8s ease-out;
}

.slide.active img {
  transform: scale(1);
}

.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(236, 72, 153, 0.8), rgba(168, 85, 247, 0.8));
  z-index: 2;
}

/* Slideshow transitions */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.slide-enter {
  animation: fadeIn 1.5s forwards;
}

.slide-exit {
  animation: fadeOut 1.5s forwards;
}

/* Gallery hover effects with click functionality */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  aspect-ratio: 1;
  background-color: #e5e7eb;
  transition: all 0.3s ease;
  cursor: pointer;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
}

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

.gallery-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

/* Gallery click overlay */
.gallery-click-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 1rem;
  pointer-events: none;
}

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

/* Gallery click animation */
.gallery-item:active {
  transform: scale(0.98);
}

/* Mobile gallery adjustments */
@media (max-width: 768px) {
  .gallery-item {
    border-radius: 1rem;
  }
  
  .gallery-click-overlay {
    padding: 0.75rem;
  }
  
  .gallery-click-overlay .text-white {
    font-size: 0.875rem;
  }
  
  #gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

/* Single column gallery for very small screens */
@media (max-width: 480px) {
  #gallery-grid {
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
  }
  
  .gallery-item {
    padding-bottom: 100%;
  }
}

/* Heart animations */
@keyframes heartPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes heartBeat {
  0%, 20%, 53%, 80%, 100% {
    transform: scale(1);
  }
  40%, 43% {
    transform: scale(1.1);
  }
  70% {
    transform: scale(1.05);
  }
  90% {
    transform: scale(1.02);
  }
}

.floating-heart {
  animation: heartFloat 4s ease-in-out infinite;
}

@keyframes heartFloat {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-250px) rotate(180deg);
    opacity: 0.5;
  }
  100% {
    transform: translateY(-500px) rotate(360deg);
    opacity: 0;
  }
}

/* Enhanced heart pulse for hero section */
.animate-pulse {
  animation: heartBeat 2s ease-in-out infinite;
}

/* Animation classes */
@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    transform: translate3d(0,-30px,0);
  }
  70% {
    transform: translate3d(0,-15px,0);
  }
  90% {
    transform: translate3d(0,-4px,0);
  }
}

.animate-bounce {
  animation: bounce 1s infinite;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(to right, #db2777, #9333ea);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Mobile menu transition */
.mobile-menu-enter {
  opacity: 0;
  transform: translateY(-10px);
}

.mobile-menu-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu-exit {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu-exit-active {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Heart hover effects for interactive elements */
button:hover [data-lucide="heart"],
a:hover [data-lucide="heart"] {
  animation: heartPulse 0.6s ease-in-out;
  color: #f472b6;
}

/* Gallery item click feedback */
.gallery-item:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* Improved gallery responsiveness */
@media (max-width: 640px) {
  .gallery-item {
    border-radius: 0.5rem;
  }
}

/* Gallery loading state */
.gallery-item img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* Fixed contact buttons with LINE text styling */
.fixed-contact-button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
}

.fixed-contact-button .contact-text {
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  margin-top: 0.125rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.025em;
}

/* Responsive text sizing for fixed buttons */
@media (min-width: 768px) {
  .fixed-contact-button .contact-text {
    font-size: 0.75rem;
  }
}

/* Enhanced hover effects for fixed contact buttons */
.fixed-contact-button:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.fixed-contact-button:hover .contact-text {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Line GIF specific styling */
.line-gif-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
}

/* Ensure proper spacing for contact buttons */
.contact-button-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

/* Bottom Navigation Styles */
.bottom-nav-item {
  transition: all 0.3s ease;
  border-radius: 0.5rem;
  padding: 0.5rem;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.bottom-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2); /* Add a subtle shadow instead of transform */
}

.bottom-nav-item:active {
  transform: translateY(0);
  background-color: rgba(255, 255, 255, 0.2);
}

.bottom-nav-item .icon {
  transition: transform 0.3s ease;
}

.bottom-nav-item:hover .icon {
  transform: scale(1.1);
}

.bottom-nav-item .text-xs {
  font-size: 0.75rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Bottom navigation responsive adjustments */
@media (max-width: 375px) {
  .bottom-nav-item .text-xs {
    font-size: 0.625rem;
  }
  
  .bottom-nav-item .icon i {
    width: 1rem !important;
    height: 1rem !important;
  }
}

/* Ensure bottom navigation doesn't interfere with content */
@media (max-width: 768px) {
  body {
    padding-bottom: 4rem;
  }
}

/* Error handling styles */
.error-fallback {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* Loading states */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 0.5rem;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .gallery-item {
    border: 2px solid #000;
  }
  
  .gallery-click-overlay {
    background: rgba(0, 0, 0, 0.9);
  }
  
  .bottom-nav-item {
    border: 1px solid #fff;
  }
}

/* Print styles */
@media print {
  .fixed-contact-button,
  .gallery-click-overlay,
  .floating-heart,
  .bottom-navigation {
    display: none !important;
  }
}

/* Slideshow animation and controls */
#slideshow-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  z-index: 1;
}

.slide.active {
  opacity: 1;
  z-index: 2;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  transition: transform 8s ease-out;
}

.slide.active img {
  transform: scale(1);
}

.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(236, 72, 153, 0.8), rgba(168, 85, 247, 0.8));
  z-index: 2;
}

/* Slideshow indicators */
.slideshow-indicators {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 10;
}

.slideshow-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.slideshow-indicator.active {
  background: white;
  transform: scale(1.2);
}

/* Slideshow navigation buttons */
.slideshow-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

.slideshow-nav:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.slideshow-nav.prev {
  left: 20px;
}

.slideshow-nav.next {
  right: 20px;
}

/* Auto-advance slideshow */
@keyframes slideshow {
  0%, 20% { opacity: 1; }
  25%, 95% { opacity: 0; }
  100% { opacity: 0; }
}

.auto-slideshow .slide {
  animation: slideshow 15s infinite;
}

.auto-slideshow .slide:nth-child(1) { animation-delay: 0s; }
.auto-slideshow .slide:nth-child(2) { animation-delay: 3s; }
.auto-slideshow .slide:nth-child(3) { animation-delay: 6s; }
.auto-slideshow .slide:nth-child(4) { animation-delay: 9s; }
.auto-slideshow .slide:nth-child(5) { animation-delay: 12s; }

/* Hero section with slideshow */
.hero-with-slideshow {
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 10;
}

/* Enhance text readability over slideshow */
.hero-with-slideshow h2,
.hero-with-slideshow p {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments for slideshow */
@media (max-width: 768px) {
  .slideshow-nav {
    width: 32px;
    height: 32px;
  }
  
  .slideshow-indicator {
    width: 8px;
    height: 8px;
  }
}