/*
 * EstatePulse Theme Core Stylesheet
 * Native Mobile App-Like Architecture & Multi-Device Responsive Design System
 */

:root {
  --brand-950: #061e1b;
  --brand-900: #0c3833;
  --brand-800: #104842;
  --brand-700: #145a52;
  --brand-600: #1b7369;
  --brand-500: #228b80;
  --brand-100: #d1fae5;
  --brand-50: #f0fdf4;
  --gold-accent: #d4af37;
  --gold-500: #eab308;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --dock-height: 64px;
}

/* Reset & Box Model */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  color: var(--slate-800);
  background-color: #f8fafc;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-bottom: 0;
}

@media (max-width: 768px) {
  body {
    /* Safe padding for fixed mobile app bottom navigation */
    padding-bottom: calc(var(--dock-height) + 16px + env(safe-area-inset-bottom, 0px));
  }
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font-family: inherit;
  /* 16px font-size prevents iOS Safari from automatically zooming into form fields */
  font-size: 16px;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

/* Grid & Layout Utilities */
.grid { display: grid; }
.flex { display: flex; }
.hidden { display: none !important; }
.block { display: block; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* Responsive Display Utilities */
@media (min-width: 640px) {
  .sm\:inline-flex { display: inline-flex !important; }
  .sm\:flex { display: flex !important; }
}

@media (min-width: 768px) {
  .md\:flex { display: flex !important; }
  .md\:block { display: block !important; }
  .md\:hidden { display: none !important; }
}

/* ==========================================================================
   Header & Mobile App Bar
   ========================================================================== */

.site-topbar {
  background: var(--brand-950);
  color: var(--slate-400);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-header {
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--slate-200);
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

@media (min-width: 768px) {
  .header-inner { height: 68px; }
}

/* Hamburger Drawer Button */
.mobile-drawer-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid var(--slate-200);
  color: var(--brand-900);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-drawer-toggle:active {
  transform: scale(0.92);
  background: #e2e8f0;
}

/* Brand Logo */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-950) 0%, var(--brand-700) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-accent);
  font-size: 15px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.brand-title {
  font-size: 17px;
  font-weight: 900;
  color: var(--slate-900);
  line-height: 1.1;
  display: block;
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 9px;
  font-weight: 800;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Desktop Nav Links */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 12px;
}

.nav-link {
  padding: 0.4rem 0.65rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-600);
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--brand-900);
  background: var(--brand-50);
}

/* User Profile Badge & Dropdown */
.btn-user-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  background: #f8fafc;
  border: 1px solid var(--slate-200);
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--slate-800);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-user-badge:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-900);
  color: var(--gold-accent);
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-profile-menu-wrap:hover .user-profile-dropdown {
  display: block;
}

.user-profile-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 210px;
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
  margin-top: 8px;
  overflow: hidden;
  z-index: 100;
  animation: dropdownPop 0.15s ease-out;
}

.user-profile-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-700);
  transition: background 0.15s;
}

.user-profile-dropdown a:hover {
  background: #f8fafc;
}

@keyframes dropdownPop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Mobile Off-Canvas Navigation Drawer
   ========================================================================== */

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-drawer-backdrop.active {
  display: block;
  opacity: 1;
}

.mobile-drawer-content {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 82%;
  max-width: 320px;
  background: #ffffff;
  z-index: 1000;
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-drawer-backdrop.active .mobile-drawer-content {
  transform: translateX(0);
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-700);
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.drawer-item i {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.drawer-item:active, .drawer-item:hover {
  background: #f1f5f9;
  color: var(--brand-900);
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */

.btn-primary {
  background: var(--brand-900);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.875rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:hover {
  background: var(--brand-950);
}

.btn-gold {
  background: var(--gold-accent);
  color: var(--slate-900);
  font-weight: 800;
  padding: 0.6rem 1.2rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-outline {
  border: 1px solid var(--slate-200);
  background: #ffffff;
  color: var(--slate-700);
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-outline:active {
  background: #f1f5f9;
}

.badge-verified {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Property Cards
   ========================================================================== */

.property-card {
  background: #ffffff;
  border-radius: 1.25rem;
  border: 1px solid var(--slate-200);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.property-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

.property-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  overflow: hidden;
  background: #e2e8f0;
}

.property-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.property-card:hover .property-card-thumb img {
  transform: scale(1.04);
}

.property-card-body {
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

/* ==========================================================================
   Site Footer (Desktop & Global Responsive)
   ========================================================================== */
.site-footer {
  background: linear-gradient(180deg, #061e1b 0%, #041412 100%) !important;
  color: #94a3b8 !important;
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 10;
}

.site-footer .container {
  color: #94a3b8;
}

.site-footer h4 {
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.site-footer a {
  color: #cbd5e1 !important;
  text-decoration: none;
  transition: all 0.2s ease;
}

.site-footer a:hover {
  color: var(--gold-accent) !important;
  transform: translateX(2px);
}

.site-footer p {
  color: #94a3b8 !important;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer ul li {
  margin-bottom: 4px;
}

/* ==========================================================================
   Native Mobile Bottom Navigation Dock
   ========================================================================== */


.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--slate-200);
  z-index: 100;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.06);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 768px) {
  .mobile-bottom-nav { display: block; }
}

.mobile-nav-dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: var(--dock-height);
  position: relative;
  padding: 0 6px;
}

.dock-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  font-size: 10px;
  font-weight: 700;
  color: var(--slate-500);
  transition: all 0.15s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.dock-tab i {
  font-size: 18px;
  margin-bottom: 2px;
  transition: transform 0.15s ease;
}

.dock-tab.active {
  color: var(--brand-700);
  font-weight: 800;
}

.dock-tab.active i {
  color: var(--brand-700);
  transform: translateY(-1px);
}

.dock-tab:active {
  transform: scale(0.92);
}

/* Center Elevated Floating Action Button (FAB) */
.dock-center-fab-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  flex: 1;
}

.dock-fab-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-950) 0%, var(--brand-700) 100%);
  color: var(--gold-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(12, 56, 51, 0.4);
  margin-top: -24px;
  border: 3px solid #ffffff;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.dock-fab-btn:active {
  transform: scale(0.92);
  box-shadow: 0 2px 6px rgba(12, 56, 51, 0.3);
}

.dock-fab-label {
  font-size: 9px;
  font-weight: 800;
  color: var(--brand-900);
  margin-top: 2px;
}

.dock-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 900;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Single Property Sticky Action Bar (Mobile Phone Only)
   ========================================================================== */

.mobile-sticky-action-bar {
  position: fixed;
  bottom: calc(var(--dock-height) + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  background: rgba(6, 30, 27, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 90;
  box-shadow: 0 -4px 10px rgba(0,0,0,0.15);
}

.btn-whatsapp-mobile {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #25D366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  text-decoration: none;
}

.btn-call-mobile {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  text-decoration: none;
}

/* ==========================================================================
   Responsive Archive & Single Property Layouts
   ========================================================================== */

/* Single Property Gallery */
.single-prop-gallery {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-bottom: 2rem;
  border-radius: 1.25rem;
  overflow: hidden;
}

.gallery-main-img {
  height: 420px;
  position: relative;
}

.gallery-main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-side-imgs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 420px;
}

@media (max-width: 768px) {
  .single-prop-gallery {
    grid-template-columns: 1fr;
    margin-bottom: 1.25rem;
  }
  .gallery-main-img {
    height: 260px;
  }
  .gallery-side-imgs {
    display: none;
  }
}

/* Single Property Main Grid */
.single-prop-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .single-prop-main-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Archive Property Layout */
.archive-layout-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 768px) {
  .archive-layout-grid {
    grid-template-columns: 1fr;
  }
  
  .archive-filter-aside {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #ffffff;
    overflow-y: auto;
    padding: 1.5rem 1rem 5rem;
  }

  .archive-filter-aside.active {
    display: block;
    animation: slideUpModal 0.25s ease-out;
  }

  .mobile-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--slate-200);
  }
}

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

/* ==========================================================================
   Modals & Auth Card
   ========================================================================== */

.estatepulse-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100000 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.estatepulse-modal-content {
  background: #ffffff;
  border-radius: 1.25rem;
  max-width: 500px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 100001 !important;
}

@media (max-width: 640px) {
  .estatepulse-modal-content {
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 1.5rem 1.5rem 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
}


@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Auth Modal Tabs & Role Cards */
.auth-tab-btn {
  background: transparent;
  color: var(--slate-400);
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: #ffffff;
  color: var(--slate-900);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-role-card {
  padding: 10px 8px;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--slate-600);
  cursor: pointer;
  transition: all 0.15s;
}

.auth-role-card.active {
  background: var(--brand-50);
  border-color: var(--brand-600);
  color: var(--brand-900);
}

/* Compare Sticky Bottom Bar */
.compare-floating-bar {
  position: fixed;
  bottom: calc(var(--dock-height) + 14px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-950);
  color: white;
  border-radius: 9999px;
  padding: 8px 20px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  z-index: 80;
  display: none;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  white-space: nowrap;
}

@media (min-width: 769px) {
  .compare-floating-bar {
    bottom: 24px;
  }
}

/* Leaflet Map */
#estatepulse-main-map, #property-single-map {
  height: 380px;
  width: 100%;
  border-radius: 1rem;
  z-index: 10;
}

@media (max-width: 640px) {
  #estatepulse-main-map, #property-single-map {
    height: 260px;
  }
}

/* ==========================================================================
   Hero Banner & Search Component (Responsive Multi-Device)
   ========================================================================== */
.hero-banner {
  position: relative;
  border-radius: 1.5rem;
  background: linear-gradient(145deg, var(--brand-950) 0%, var(--brand-900) 55%, #082924 100%);
  color: #ffffff;
  padding: 3rem 1.5rem;
  overflow: hidden;
  box-shadow: 0 20px 40px -15px rgba(6, 30, 27, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-banner::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -20%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 90, 82, 0.45) 0%, rgba(212, 175, 55, 0.12) 50%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.hero-banner::after {
  content: "";
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.hero-banner h1 {
  font-size: clamp(1.5rem, 5vw, 2.5rem) !important;
  line-height: 1.25 !important;
}

.hero-search-box {
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 1.25rem;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(226, 232, 240, 0.8);
  color: var(--slate-800);
  margin-top: 1.5rem;
  text-align: left;
}

@media (max-width: 640px) {
  .hero-banner {
    border-radius: 1.25rem;
    padding: 2rem 1rem;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
  }
  .hero-search-box {
    padding: 1rem;
    border-radius: 1rem;
  }
}

