@import url('https://fonts.googleapis.com/css2?family=Mukta+Malar:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary-green: #0f766e;
  --primary-dark-green: #064e3b;
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --accent-saffron: #ea580c;
  --accent-gold: #f59e0b;
  --accent-amber: #d97706;
  --bg-cream: #fbf9f5;
  --bg-sand: #fefcf9;
  --text-dark: #0f172a;
  --text-muted: #475569;
  --border-light: rgba(15, 118, 110, 0.12);
  --shadow-sm: 0 2px 8px -1px rgba(0, 0, 0, 0.05), 0 1px 3px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 25px -3px rgba(15, 118, 110, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 35px -5px rgba(6, 78, 59, 0.12), 0 8px 16px -6px rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Mukta Malar', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  scroll-behavior: smooth;
}

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

body {
  background-color: var(--bg-cream);
  color: var(--text-dark);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Tamil Typography Enhancement */
.tamil-font,
[lang="ta"],
[lang="ta"] * {
  font-family: 'Mukta Malar', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Prevent iOS input auto zoom */
input[type="text"],
input[type="tel"],
input[type="email"],
input[type="date"],
select,
textarea {
  font-size: 16px !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #0f766e;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #064e3b;
}

/* ===================================================
   1. SCROLL REVEAL ANIMATIONS ENGINE
   =================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-fade {
  opacity: 0;
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity;
}

.reveal-fade.revealed {
  opacity: 1;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
.delay-75 { transition-delay: 75ms; }
.delay-100 { transition-delay: 100ms; }
.delay-150 { transition-delay: 150ms; }
.delay-200 { transition-delay: 200ms; }
.delay-250 { transition-delay: 250ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* ===================================================
   2. HERO ENTRANCE KEYFRAMES
   =================================================== */
@keyframes heroFadeUp {
  0% {
    opacity: 0;
    transform: translateY(22px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroFadeScale {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(16px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.hero-anim-1 { animation: heroFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-anim-2 { animation: heroFadeUp 0.7s 0.12s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-anim-3 { animation: heroFadeUp 0.7s 0.24s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-anim-4 { animation: heroFadeUp 0.7s 0.36s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-anim-5 { animation: heroFadeUp 0.7s 0.48s cubic-bezier(0.16, 1, 0.3, 1) both; }
.hero-anim-card { animation: heroFadeScale 0.85s 0.2s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Badge floating pulse */
@keyframes badgeFloatPulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(15, 118, 110, 0.25);
  }
  50% {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.3);
  }
}

.badge-floating {
  animation: badgeFloatPulse 3.8s ease-in-out infinite;
}

/* Advanced Logo Animations & Glow */
@keyframes peacockGlow {
  0%, 100% {
    filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.25)) drop-shadow(0 0 25px rgba(245, 158, 11, 0.2));
    transform: translateY(0px) scale(1);
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(16, 185, 129, 0.45)) drop-shadow(0 0 35px rgba(234, 88, 12, 0.35));
    transform: translateY(-3px) scale(1.01);
  }
}

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

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

.logo-animated {
  animation: peacockGlow 5s ease-in-out infinite;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-animated:hover {
  transform: scale(1.03) rotate(0.5deg);
  filter: drop-shadow(0 0 30px rgba(16, 185, 129, 0.55)) drop-shadow(0 0 40px rgba(234, 88, 12, 0.35));
}

.emblem-pulse {
  animation: gentleFloat 4s ease-in-out infinite;
}

/* Shimmer highlight text */
.text-shimmer {
  background: linear-gradient(90deg, #065f46 0%, #ea580c 50%, #065f46 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 6s linear infinite;
}

/* Glassmorphism Classes */
.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(15, 118, 110, 0.12);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 30px -8px rgba(6, 78, 59, 0.12), 0 6px 12px -6px rgba(0, 0, 0, 0.05);
  border-color: rgba(16, 185, 129, 0.35);
}

/* Top Announcement Bar */
.announcement-bar {
  background: linear-gradient(90deg, #064e3b 0%, #0f766e 45%, #c2410c 100%);
}

/* Hero Section Gradients */
.hero-gradient {
  background: radial-gradient(circle at 80% 20%, rgba(234, 88, 12, 0.09) 0%, transparent 40%),
              radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.12) 0%, transparent 45%),
              linear-gradient(180deg, #ffffff 0%, #fbf9f5 100%);
}

/* Golden Ribbon for Tagline */
.tagline-ribbon {
  background: linear-gradient(135deg, #15803d 0%, #166534 50%, #ea580c 100%);
  color: #ffffff;
  padding: 6px 18px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(22, 101, 52, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Status Badges */
.badge-available {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.badge-fast {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

/* Feature Icon Circles */
.icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
}

.icon-box-green {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
.icon-box-orange {
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
}
.icon-box-gold {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.glass-card:hover .icon-box-green {
  background: #059669;
  color: #ffffff;
  transform: rotate(6deg) scale(1.06);
}
.glass-card:hover .icon-box-orange {
  background: #ea580c;
  color: #ffffff;
  transform: rotate(6deg) scale(1.06);
}
.glass-card:hover .icon-box-gold {
  background: #d97706;
  color: #ffffff;
  transform: rotate(6deg) scale(1.06);
}

/* Custom Calculator Sliders with Touch Target */
input[type="range"] {
  accent-color: #059669;
  cursor: pointer;
  height: 8px;
  border-radius: 8px;
  background: #e2e8f0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #059669;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: grab;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.25);
  cursor: grabbing;
  background: #047857;
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #059669;
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: grab;
}

/* ===================================================
   3. MOBILE ALIGNMENT & RESPONSIVE POLISH
   =================================================== */

/* Horizontal pill scroll for mobile category tabs */
.mobile-pill-scroll {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0.5rem;
  padding: 4px 4px 8px 4px;
  max-width: 100%;
}
.mobile-pill-scroll::-webkit-scrollbar {
  display: none;
}

@media (min-width: 640px) {
  .mobile-pill-scroll {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    padding-bottom: 0;
  }
}

/* Floating Action Bottom Bar for Mobile */
.mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(15, 118, 110, 0.16);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 999;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  animation: slideUpBottom 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUpBottom {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .mobile-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }
  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

/* Modal Transitions */
.modal-overlay {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  transform: scale(0.92) translateY(20px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Gallery image zoom hover */
.gallery-card {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-card img {
  transition: transform 0.5s ease;
}

.gallery-card:hover img {
  transform: scale(1.08);
}

/* Responsive aspect helpers */
.aspect-card {
  aspect-ratio: 16 / 10;
}

@media (max-width: 640px) {
  .aspect-card {
    aspect-ratio: 16 / 11;
  }
}

/* Animated Counters */
.counter-box {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.counter-box::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: shine 4s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  20% { left: 100%; }
  100% { left: 100%; }
}

/* Pulsing Call Button */
.btn-pulse-green {
  animation: btnGlow 2.5s infinite;
}

@keyframes btnGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Property Card Animation & Hover */
.property-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease;
}

.property-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 22px 35px -10px rgba(6, 78, 59, 0.15), 0 10px 15px -5px rgba(0, 0, 0, 0.04);
  border-color: rgba(16, 185, 129, 0.4);
}

.property-card:active {
  transform: translateY(-2px);
}

/* Card Filter Animation */
@keyframes filterFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.card-filter-anim {
  animation: filterFadeIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* FAQ Smooth Grid Accordion */
.faq-accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-accordion-body.open {
  grid-template-rows: 1fr;
}

.faq-accordion-content {
  overflow: hidden;
}

/* Back-to-Top Floating Button */
.back-to-top {
  position: fixed;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  background: rgba(6, 78, 59, 0.92);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: #047857;
  transform: translateY(-3px) scale(1.05);
}

@media (min-width: 769px) {
  .back-to-top {
    bottom: 28px;
    right: 28px;
    width: 48px;
    height: 48px;
  }
}

/* Mobile Alignment Polish for Narrow Viewports (< 480px) */
@media (max-width: 480px) {
  .mobile-compact-text {
    font-size: 0.72rem !important;
  }
  .mobile-touch-btn {
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
  }
}
