/* ===== Global Resets & Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 9pt;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: #0F2A24;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1a4a3f;
}

/* Green scrollbar for founder message */
.founder-scroll::-webkit-scrollbar {
  width: 6px;
}

.founder-scroll::-webkit-scrollbar-track {
  background: #ecf3f1;
  border-radius: 3px;
}

.founder-scroll::-webkit-scrollbar-thumb {
  background: #0F2A24;
  border-radius: 3px;
}

.founder-scroll::-webkit-scrollbar-thumb:hover {
  background: #143c33;
}

.founder-scroll {
  scrollbar-color: #0F2A24 #ecf3f1;
  scrollbar-width: thin;
}

/* Green-tinted icons */
.icon-green {
  filter: brightness(0) saturate(100%) invert(13%) sepia(25%) saturate(1200%) hue-rotate(120deg) brightness(95%);
}

/* ===== Line Clamp ===== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== Prose Styles ===== */
.prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1c1917;
  margin: 2rem 0 1rem 0;
}

.prose p {
  margin: 1rem 0;
  line-height: 1.75;
}

.prose ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.prose li {
  margin: 0.5rem 0;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-100px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-down {
  animation: slideDown 0.6s ease-out forwards;
}

@keyframes scaleX {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.animate-scale-x {
  animation: scaleX 1s ease-out 1.2s forwards;
  transform: scaleX(0);
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(10px);
  }
}

.animate-bounce-slow {
  animation: bounce 1.5s ease-in-out infinite;
}

/* Stagger animation delays */
.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

.delay-400 {
  animation-delay: 0.4s;
}

.delay-500 {
  animation-delay: 0.5s;
}

.delay-600 {
  animation-delay: 0.6s;
}

.delay-700 {
  animation-delay: 0.7s;
}

.delay-800 {
  animation-delay: 0.8s;
}

.delay-900 {
  animation-delay: 0.9s;
}

.delay-1000 {
  animation-delay: 1.0s;
}

.delay-1200 {
  animation-delay: 1.2s;
}

.delay-1500 {
  animation-delay: 1.5s;
}

.delay-1700 {
  animation-delay: 1.7s;
}

.delay-1850 {
  animation-delay: 1.85s;
}

.delay-2000 {
  animation-delay: 2.0s;
}

/* Scroll reveal animation */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.scroll-reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ===== Focus States ===== */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #0F2A24;
  outline-offset: 2px;
}

/* ===== Loading States ===== */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  max-width: 100vw;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

/* ===== Responsive image handling ===== */
img {
  max-width: 100vw;
  height: auto;
}

/* ===== Print ===== */
@media print {
  .no-print {
    display: none !important;
  }
}

/* ===== Scrollbar hide for horizontal scroll ===== */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ===== Font family utilities ===== */
.font-display {
  font-family: 'Marcellus', serif;
}

/* ===== Hero Section Specific ===== */
.hero-image-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Nav Logo White Filter (transparent navbar) ===== */
#nav-logo {
  transition: filter 0.3s ease, opacity 0.3s ease;
}

#nav-logo.logo-white {
  filter: brightness(0) invert(1);
}

/* ===== Mega Menu ===== */
.mega-menu-wrapper {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 40;
  justify-content: center;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .mega-menu-wrapper {
    top: 80px;
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .mega-menu-wrapper {
    padding: 0 2rem;
  }
}

.mega-menu-wrapper.active {
  display: flex;
}

/* ===== Villa Card Hover ===== */
.villa-card-overlay {
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.7s ease-out;
}

.villa-card:hover .villa-card-overlay {
  transform: translateY(0);
  opacity: 1;
}

.villa-card:hover .villa-card-name {
  opacity: 0;
}

/* ===== Blog Slider ===== */
.blog-slider-track {
  transition: transform 0.5s ease-out;
}

/* ===== CTA Button Hover Fix - ensure always visible ===== */
/* Hero CTA */
#hero-section a[href="#villas-section"] {
  background-color: #0F2A24 !important;
  color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
}
#hero-section a[href="#villas-section"]:hover {
  background-color: #1a4a3f !important;
  color: #ffffff !important;
  opacity: 1 !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(15, 42, 36, 0.4);
}

/* Navbar Enquire Now button */
nav a[href="contact.php#name"] {
  color: #F4EFEA !important;
  opacity: 1 !important;
  visibility: visible !important;
}
nav a[href="contact.php#name"]:hover {
  background-color: #0F2A24 !important;
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Loyalty CTA - Book Now */
a[href="contact.php"].inline-block {
  color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
}
a[href="contact.php"].inline-block:hover {
  color: #ffffff !important;
  opacity: 1 !important;
  transform: scale(1.05);
}

/* CTA Section 2 - Explore Our Villas */
section.bg-\[\#0F2A24\] a[href="#villas-section"] {
  background-color: #F4EFEA !important;
  color: #0F2A24 !important;
  opacity: 1 !important;
  visibility: visible !important;
}
section.bg-\[\#0F2A24\] a[href="#villas-section"]:hover {
  background-color: #e8dfd6 !important;
  color: #0F2A24 !important;
  opacity: 1 !important;
  transform: translateY(-2px);
}

/* Villa card Explore buttons */
.villa-card a {
  color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.villa-card a:hover {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* General CTA button visibility guarantee */
a.bg-gradient-to-r,
a.bg-amber-600,
a.bg-amber-500,
button[type="submit"] {
  opacity: 1 !important;
  visibility: visible !important;
}
a.bg-gradient-to-r:hover,
a.bg-amber-600:hover,
a.bg-amber-500:hover,
button[type="submit"]:hover {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ===== Mobile Performance Optimizations ===== */
@media (max-width: 768px) {
  /* Reduce animation complexity on mobile */
  .villa-card-overlay {
    transition: opacity 0.3s ease-out !important;
    transform: none !important;
  }
  .villa-card:hover .villa-card-overlay {
    transform: none !important;
  }

  /* Use simpler transitions on mobile */
  .scroll-reveal {
    transition: opacity 0.5s ease-out !important;
    transform: none !important;
  }
  .scroll-reveal.visible {
    transform: none !important;
  }
  .scroll-reveal-left,
  .scroll-reveal-right {
    transition: opacity 0.5s ease-out !important;
    transform: none !important;
  }
  .scroll-reveal-left.visible,
  .scroll-reveal-right.visible {
    transform: none !important;
  }

  /* Reduce hover transform effects on mobile (touch devices) */
  .group:hover .group-hover\:scale-110 {
    transform: none !important;
  }

  /* Below-the-fold sections - content-visibility for paint efficiency */
  section:not(#hero-section):not(#villas-section) {
    content-visibility: auto;
    contain-intrinsic-size: auto 500px;
  }
}

/* Respect prefers-reduced-motion */
@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;
  }
  .scroll-reveal,
  .scroll-reveal-left,
  .scroll-reveal-right {
    opacity: 1 !important;
    transform: none !important;
  }
}