@import 'design-system.css';

/* 
  Propera India - Homepage Above-the-Fold Architecture
  Lightweight, minimal DOM, optimized for LCP.
*/

:root {
  --card: #f5f5f4;
  --ring: #6366f1;
  --input: #d6d3d1;
  --muted: #e7e5e4;
  --accent: #f3e5f5;
  --border: #d6d3d1;
  --radius: 1.25rem;
  --chart-1: #6366f1;
  --chart-2: #4f46e5;
  --chart-3: #4338ca;
  --chart-4: #3730a3;
  --chart-5: #312e81;
  --popover: #f5f5f4;
  --primary: #6366f1;
  --sidebar: #d6d3d1;
  --font-mono: Roboto Mono, monospace;
  --font-sans: Plus Jakarta Sans, sans-serif;
  --secondary: #d6d3d1;
  --background: #e7e5e4;
  --font-serif: Lora, serif;
  --foreground: #1e293b;
  --destructive: #ef4444;
  --shadow-blur: 10px;
  --shadow-color: hsl(240 4% 60%);
  --sidebar-ring: #6366f1;
  --shadow-spread: 4px;
  --shadow-opacity: 0.18;
  --sidebar-accent: #f3e5f5;
  --sidebar-border: #d6d3d1;
  --card-foreground: #1e293b;
  --shadow-offset-x: 2px;
  --shadow-offset-y: 2px;
  --sidebar-primary: #6366f1;
  --muted-foreground: #6b7280;
  --accent-foreground: #374151;
  --popover-foreground: #1e293b;
  --primary-foreground: #FFFFFF;
  --sidebar-foreground: #1e293b;
  --secondary-foreground: #4b5563;
  --destructive-foreground: #FFFFFF;
  --sidebar-accent-foreground: #374151;
  --sidebar-primary-foreground: #FFFFFF;
}

.dark {
  --card: #2c2825;
  --ring: #818cf8;
  --input: #3a3633;
  --muted: #2c2825;
  --accent: #484441;
  --border: #3a3633;
  --radius: 1.25rem;
  --chart-1: #818cf8;
  --chart-2: #6366f1;
  --chart-3: #4f46e5;
  --chart-4: #4338ca;
  --chart-5: #3730a3;
  --popover: #2c2825;
  --primary: #818cf8;
  --sidebar: #3a3633;
  --secondary: #3a3633;
  --background: #1e1b18;
  --foreground: #e2e8f0;
  --destructive: #ef4444;
  --shadow-color: hsl(0 0% 0%);
  --sidebar-ring: #818cf8;
  --sidebar-accent: #484441;
  --sidebar-border: #3a3633;
  --card-foreground: #e2e8f0;
  --sidebar-primary: #818cf8;
  --muted-foreground: #9ca3af;
  --accent-foreground: #d1d5db;
  --popover-foreground: #e2e8f0;
  --primary-foreground: #1e1b18;
  --sidebar-foreground: #e2e8f0;
  --secondary-foreground: #d1d5db;
  --destructive-foreground: #1e1b18;
  --sidebar-accent-foreground: #d1d5db;
  --sidebar-primary-foreground: #1e1b18;
}

@theme inline {
  --color-card: var(--card);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-muted: var(--muted);
  --color-accent: var(--accent);
  --color-border: var(--border);
  --color-radius: var(--radius);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-popover: var(--popover);
  --color-primary: var(--primary);
  --color-sidebar: var(--sidebar);
  --color-font-mono: var(--font-mono);
  --color-font-sans: var(--font-sans);
  --color-secondary: var(--secondary);
  --color-background: var(--background);
  --color-font-serif: var(--font-serif);
  --color-foreground: var(--foreground);
  --color-destructive: var(--destructive);
  --color-shadow-blur: var(--shadow-blur);
  --color-shadow-color: var(--shadow-color);
  --color-sidebar-ring: var(--sidebar-ring);
  --color-shadow-spread: var(--shadow-spread);
  --color-shadow-opacity: var(--shadow-opacity);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-border: var(--sidebar-border);
  --color-card-foreground: var(--card-foreground);
  --color-shadow-offset-x: var(--shadow-offset-x);
  --color-shadow-offset-y: var(--shadow-offset-y);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent-foreground: var(--accent-foreground);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary-foreground: var(--primary-foreground);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
}

/* ==========================================================================
   HOMEPAGE SPECIFIC STYLES
   ========================================================================== */

/* Navbar Overrides for Home */
.navbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-badge {
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  margin-left: 0.25rem;
  font-weight: 600;
  vertical-align: super;
}

.nav-actions {
  display: none;
  gap: var(--space-sm);
  align-items: center;
}

/* Navbar Dropdown */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.nav-dropdown-content {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--card);
  min-width: 260px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
  display: flex;
  padding: var(--space-md);
}

/* Pointer arrow */
.nav-dropdown-content::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--card);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

.nav-dropdown:hover .nav-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-col {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.nav-dropdown-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-foreground);
  margin-bottom: var(--space-sm);
  font-weight: 600;
  padding: 0 var(--space-sm);
}

.nav-dropdown-col a {
  color: var(--foreground);
  text-decoration: none;
  padding: 10px var(--space-sm);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.nav-dropdown-col a:hover {
  background: var(--background);
  color: var(--primary);
}

@media (min-width: 1024px) {
  .nav-actions { display: flex; }
}

/* Hero Redesign Section */
.hero-redesign {
  display: flex;
  flex-direction: column;
  background: var(--bg-off-white);
  color: var(--text-primary);
  min-height: 80vh;
  position: relative;
  overflow: hidden;
  margin-top: 0;
}
@media (min-width: 768px) {
  .hero-redesign {
    flex-direction: row;
  }
}

.hero-left {
  flex: 0 0 100%;
  padding: var(--space-xl) var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
}
@media (min-width: 768px) {
  .hero-left {
    flex: 0 0 60%;
    padding: 8% 5%;
  }
}

.search-container {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  margin-bottom: var(--space-lg);
  max-width: 800px;
}

.hero-search-tabs {
  display: flex;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border, #e5e5e5);
  overflow-x: auto;
  scrollbar-width: none;
}
.hero-search-tabs::-webkit-scrollbar { display: none; }
.hero-tab {
  padding: 1rem 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}
.hero-tab.active {
  color: var(--color-3, #2B5C8F);
  border-bottom-color: var(--color-3, #2B5C8F);
}

.hero-search-bar {
  display: flex;
  padding: 0.75rem;
  background: white;
  gap: var(--space-sm);
  align-items: center;
}
.search-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
}
.hero-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1rem;
  color: #1e293b;
}
.hero-input:focus { outline: none; }
.hero-search-btn {
  background: var(--color-3, #2B5C8F);
  color: white;
  border: none;
  padding: 0.875rem 2.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.hero-search-btn:hover { opacity: 0.9; }

.hero-localities {
  margin-bottom: var(--space-xl);
}
.locality-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}
.locality-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.locality-tags a {
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border, #e5e5e5);
  text-decoration: none;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: background 0.2s, border-color 0.2s;
}
.locality-tags a:hover {
  background: var(--bg-off-white);
  border-color: var(--color-3, #2B5C8F);
}

.hero-owner-cta {
  display: none;
}
.owner-link {
  display: none;
}
.owner-link:hover { text-decoration: none; }

.hero-right {
  flex: 0 0 100%;
  position: relative;
  min-height: 400px;
}
@media (min-width: 768px) {
  .hero-right {
    flex: 0 0 40%;
    clip-path: polygon(15% 0, 100% 0, 100% 100%, 0% 100%);
  }
}
.hero-image-carousel {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
}
.hero-img-slide {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.hero-img-slide.active { opacity: 1; }

/* Locality Chips */
.locality-section {
  padding: var(--space-lg) 0 var(--space-xl);
  text-align: center;
}

.locality-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}

.locality-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.chips-container {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.chips-container::-webkit-scrollbar { display: none; }

.chip {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.chip:hover {
    background: var(--accent);
    color: var(--accent-foreground);
  }
  /* Chip and search-tab also used as <a> tags for navigation */
  a.chip,
  a.search-tab {
    text-decoration: none;
    cursor: pointer;
  }
  a.chip { display: inline-block; }
  a.search-tab { display: block; }

/* Floating WhatsApp CTA */
.floating-whatsapp {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background-color: #25D366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: 99;
  transition: transform 0.2s ease;
}

.floating-whatsapp:hover {
  transform: scale(1.05);
}

.whatsapp-icon {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

/* ==========================================================================
   PRIORITY PREMIUM PROPERTIES (CAROUSEL)
   ========================================================================== */
.premium-section {
  padding: var(--space-xl) 0;
  max-width: 100vw;
  overflow: hidden;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: var(--space-lg);
}

.premium-title {
  color: var(--foreground);
  margin-bottom: var(--space-xs);
}

.carousel-nav {
  display: none;
  gap: var(--space-sm);
}

@media (min-width: 768px) {
  .carousel-nav { display: flex; }
}

.nav-arrow {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-arrow:hover {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.carousel-track {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Firefox */
  padding-bottom: var(--space-lg); /* space for subtle shadow */
  padding-left: var(--space-md);
  padding-right: var(--space-md);
  margin-left: calc(-1 * var(--space-md));
  margin-right: calc(-1 * var(--space-md));
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  .carousel-track {
    padding-left: 2px;
    padding-right: 2px;
    margin-left: 0;
    margin-right: 0;
  }
}

.carousel-track::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Edge */
}

/* Property Card */
.property-card {
  flex: 0 0 calc(90vw - 2rem);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  scroll-snap-align: center;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .property-card { 
    flex: 0 0 350px; 
    scroll-snap-align: start;
  }
}

.property-card:hover {
  box-shadow: 0 var(--shadow-offset-y) 16px var(--shadow-spread) rgba(0,0,0,var(--shadow-opacity));
  transform: translateY(-4px);
}

.card-image-wrapper {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.property-card:hover .card-image {
  transform: scale(1.05);
}

.card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
}

.badge-premium { background: rgba(212, 175, 55, 0.9); color: #000; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.badge-featured { background: rgba(99, 102, 241, 0.9); color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.badge-verified { background: rgba(37, 211, 102, 0.9); color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.badge-new { background: rgba(239, 68, 68, 0.9); color: #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }

.card-content {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex-grow: 1;
}

.property-meta {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.property-name {
  color: var(--foreground);
  margin: 0;
  line-height: 1.2;
}

.property-location {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: var(--space-xs);
}

.property-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: var(--space-md);
}

.card-actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: auto;
}

.flex-1 { flex: 1; text-align: center; }

.btn-whatsapp-icon {
  background: #25D366;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.btn-whatsapp-icon:hover { transform: scale(1.05); }
.btn-whatsapp-icon svg { width: 20px; height: 20px; }

/* ==========================================================================
   DISCOVERY SECTIONS (Marketplace)
   ========================================================================== */
.discovery-section {
  padding: var(--space-xl) 0;
  max-width: 100vw;
  overflow: hidden;
}

.discovery-section.bg-alt {
  background: var(--background);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.discovery-card {
  flex: 0 0 calc(85vw - 2rem);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-snap-align: center;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

@media (min-width: 640px) {
  .discovery-card { 
    flex: 0 0 320px; /* Increased from 280px to prevent clipping */
    scroll-snap-align: start;
  }
}

.discovery-card:hover {
  box-shadow: 0 var(--shadow-offset-y) 12px var(--shadow-spread) rgba(0,0,0,var(--shadow-opacity));
  transform: translateY(-3px);
}

.discovery-card .card-image-wrapper {
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.discovery-card .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.discovery-card .card-content {
  padding: var(--space-md);
  gap: 6px;
}

.discovery-card .property-name {
  font-size: 1.125rem;
}

.discovery-card .property-price {
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
  margin-top: 4px;
}

.discovery-card .card-actions {
  margin-top: auto;
}

.btn-small {
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
}
/* Modal removed - Book Visit links to property-detail.html */
