@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('brand.css');

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--brand-surface);
  color: var(--brand-text);
  overflow-x: hidden;
  line-height: 1.5;
}

.container {
  display: flex; /* ✅ Use flex instead of grid for easier fixed sidebar handling */
  min-height: 100vh;
  width: 100%;
}

/* Mobile Menu Hamburger */
.menu-toggle {
  display: none;
  background: var(--brand-teal);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 1.2em;
  cursor: pointer;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  box-shadow: 0 4px 12px var(--brand-shadow);
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  background: var(--brand-teal-dark);
  transform: scale(1.05);
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.active {
  display: block;
}

/* ==========================================================================
   GLOBAL SIDEBAR LOCKDOWN - NO OVERRIDES ALLOWED
   ========================================================================== */
.sidebar {
  width: 280px !important;
  background: var(--brand-sidebar) !important;
  color: #fff !important;
  height: 100vh !important;
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 32px 16px !important; /* Unified padding for premium symmetrical spacing */
  z-index: 2000 !important;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15) !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

/* Perfect Logo & Brand Alignment */
.logo,
a.logo {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 0 12px !important;
  margin-bottom: 40px !important;
  border-bottom: none !important;
}

a.logo {
  text-decoration: none !important;
  color: inherit !important;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

a.logo:hover {
  opacity: 0.92;
}

.logo-img {
  width: 58px !important;
  height: 58px !important;
  border-radius: 14px !important;
  background: var(--brand-teal-dark) !important;
  padding: 5px !important;
  object-fit: contain !important;
}

.brand-name {
  font-size: 1.6rem !important;
  font-weight: 800 !important;
  color: #fff !important;
  letter-spacing: -0.5px !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.brand-tagline {
  font-size: 0.75rem !important;
  color: #94a3b8 !important;
  font-weight: 500 !important;
  margin: 0 !important;
}

/* Navigation Section */
.nav {
  flex: 1 !important;
}

.nav-title {
  font-size: 0.7rem !important;
  text-transform: uppercase !important;
  font-weight: 700 !important;
  color: #64748b !important;
  margin: 0 0 16px 12px !important; /* Aligns with navigation items icons */
  letter-spacing: 1.5px !important;
  display: block !important;
}

.nav ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.nav ul.nav-list--loading:empty {
  min-height: 140px;
}

.nav ul.nav-list--loading:empty::before {
  content: "Loading menu…";
  display: block;
  padding: 10px 12px;
  color: #94a3b8;
  font-size: 0.85rem;
}

.nav li {
  margin-bottom: 6px !important;
}

.nav li a {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 10px 12px !important; /* Symmetrical padding inside links */
  color: #cbd5e1 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  border-radius: 12px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  font-size: 0.95rem !important;
}

.nav li a:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  transform: translateX(4px) !important;
}

.nav li a.active {
  background: var(--brand-sidebar-active) !important;
  color: #fff !important;
  box-shadow: 0 10px 15px -3px var(--brand-shadow) !important;
}

.nav li a .icon {
  font-size: 1.2rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 24px !important;
}

/* Contact & Social Section (Bottom) */
.contact {
  margin-top: auto !important;
  padding: 40px 0 20px !important; /* Removed horizontal padding so it aligns perfectly with sidebar content boundary */
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.contact-title {
  font-size: 0.65rem !important;
  text-transform: uppercase !important;
  color: #94a3b8 !important;
  margin: 0 0 20px 12px !important; /* Aligns perfectly with logo and nav list icons */
  font-weight: 800 !important;
  letter-spacing: 2px !important;
  opacity: 0.8 !important;
}

/* Give 'Follow Us' some breathing room */
.social-list {
  margin-top: 28px !important;
}

.social-title {
  margin-top: 32px !important;
}

.contact-list, .social-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.contact-list li, .social-list li {
  margin: 0 !important;
}

.contact-list a, .social-list a {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 10px 12px !important; /* Symmetrical padding, matches nav links exactly */
  color: #cbd5e1 !important;
  text-decoration: none !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  border-radius: 10px !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.contact-list a:hover, .social-list a:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
  transform: translateX(4px) !important; /* Standardized transition to match nav links */
}

.contact-icon, .social-icon {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #818cf8 !important; /* Lighter indigo for better visibility */
  width: 24px !important; /* Set to 24px to match nav icons perfectly */
  height: 24px !important; /* Set to 24px to match nav icons perfectly */
  font-size: 1.2rem !important; /* Matching font-size */
  transition: transform 0.25s !important;
}

.contact-list a:hover .contact-icon, 
.social-list a:hover .social-icon {
  transform: scale(1.1) !important;
  color: #fff !important;
}

.contact-text {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 180px !important;
}

/* Specific Social Colors on Hover */
.social-list a:hover {
  background: rgba(99, 102, 241, 0.1) !important;
}

/* Red Logout */
#logout-link {
  color: #fca5a5 !important;
  margin-top: 20px !important;
}

#logout-link:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
}

/* Main Content Wrapper */
.main {
  flex: 1 !important;
  margin-left: 280px !important;
  padding: 40px !important;
  min-height: 100vh !important;
  box-sizing: border-box !important;
  background-color: var(--brand-surface) !important;
}

.hero {
  background: linear-gradient(135deg, var(--brand-teal-dark) 0%, var(--brand-teal) 55%, var(--brand-green) 100%);
  color: white;
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.search-box {
  display: flex;
  margin-top: 15px;
  width: 100%;
}

.search-box input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px 0 0 6px;
  box-sizing: border-box;
  cursor: pointer; /* indicate readonly interactive */
}

.search-box button {
  background: #0077ff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
}

/* Quick Filters Styling */
.quick-filters {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
}

.filter-option {
  padding: 8px 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
}

.filter-option:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.filter-option.active {
  background: white;
  color: var(--brand-teal-dark);
  border-color: white;
}

/* FIXED: Property Cards with ABSOLUTE Equal Sizes */
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
  justify-content: flex-start;
}

.property-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
  width: calc(33.333% - 14px); /* 3 columns with gap */
  min-width: 280px;
  height: 500px !important; /* KEEP to maintain current card height behavior */
  position: relative;
}

.property-card:hover {
  transform: translateY(-5px);
}

/* Force consistent image height */
.card-img {
  position: relative;
  height: 200px;
  flex-shrink: 0;
  width: 100%;
  overflow: hidden;
  background: var(--brand-surface-alt, #eef4f6);
}

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

.property-type {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--brand-teal-dark);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 20px;
  z-index: 2;
}

.price-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  background: rgba(255, 255, 255, 0.95);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: bold;
  z-index: 2;
  max-width: calc(100% - 90px);
  text-align: right;
  line-height: 1.3;
  word-break: break-word;
}

.price-badge.verified {
  background: var(--brand-green);
  color: white;
}

/* Card body with ABSOLUTE fixed structure */
.card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 300px; /* Fixed content area height */
  box-sizing: border-box;
}

.card-body h3 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.3;
  height: 44px; /* Fixed title height - 2 lines */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-body .location {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
  height: 20px; /* Fixed location height */
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.details {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  margin-bottom: 15px;
  height: 25px; /* Fixed details height */
  align-items: center;
}

.details .furnishing {
  background: #d1fae5;
  color: #065f46;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
}

/* Amenities with ABSOLUTE fixed height */
.amenities {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 15px;
  height: 80px; /* ABSOLUTE fixed height */
  overflow-y: auto;
  align-items: flex-start;
  padding: 5px 0;
  box-sizing: border-box;
}

.amenities::-webkit-scrollbar {
  width: 4px;
}

.amenities::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.amenities span {
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: #444;
  height: fit-content;
  flex-shrink: 0;
}

/* Fixed actions at bottom */
.actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  height: 50px; /* Fixed actions height */
  flex-shrink: 0;
}

.btn {
  border: none;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.btn.view {
  background: var(--brand-teal-dark);
  color: white;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn.view:hover {
  background: var(--brand-teal);
}

.btn.call {
  background: transparent;
  border: 2px solid var(--brand-teal);
  color: var(--brand-teal-dark);
  padding: 8px 10px;
}

/* Modals */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  width: 400px;
  max-width: 90%;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  text-align: center;
  box-sizing: border-box;
}

.modal-content h2 {
  font-size: 1.2rem;
  font-weight: 500;
  color: #333;
  margin: 0 0 20px;
}

.modal-content #searchForm {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgb(9, 7, 7);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.modal-content input:focus,
.modal-content select:focus {
  outline: none;
  border-color: #000204;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.btn-gradient {
  background: var(--brand-orange);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: background 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.btn-gradient:hover {
  background: var(--brand-orange-dark);
}

.close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #555;
}

.close:hover {
  color: #000;
}

/* back button for signup form */
.back-button {
  position: absolute;
  top: 20px;
  left: 20px;
  color: rgb(243, 117, 7);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
}

.back-button:hover {
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Auth Container Styles (unchanged) ... (skipping repetition for brevity) */

/* Responsive Styles follow (unchanged) */

/* Mobile Styles */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .container {
    display: block; /* ✅ Stack on mobile */
    width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    left: -280px !important; /* Hides perfectly based on the global 280px width */
    width: 280px !important;
    z-index: 2000 !important;
    transition: left 0.3s ease !important; /* Forces transition override */
    box-shadow: 2px 0 10px rgba(0,0,0,0.1) !important;
  }

  .sidebar.active {
    left: 0 !important; /* Toggles open successfully */
  }

  .main {
    padding: 60px 15px 20px;
    width: 100% !important; /* ✅ Full width on mobile */
    margin-left: 0 !important; /* ✅ No margin on mobile */
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .hero {
    padding: 20px;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .hero h1 {
    font-size: 24px;
    text-align: center;
  }

  .hero p {
    font-size: 14px;
    text-align: center;
  }

  .search-box {
    flex-direction: column;
    gap: 15px;
    width: 100%;
  }

  .search-box input {
    border-radius: 6px;
    padding: 12px;
    width: 100%;
  }

  .search-box button {
    border-radius: 6px;
    padding: 12px;
    width: 100%;
  }

  .quick-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
  }

  .filter-option {
    padding: 8px 16px;
    font-size: 14px;
  }

  /* MOBILE: Single column with forced equal heights */
  .cards {
    display: block; /* Change to block for mobile */
  }

  .property-card {
    width: 100% !important;
    height: 450px !important; /* Force equal height on mobile */
    margin-bottom: 20px;
  }

  .card-img {
    height: 180px;
  }

  .card-body {
    height: 270px;
    padding: 15px;
  }

  .card-body h3 {
    font-size: 16px;
    height: 40px;
  }

  .amenities {
    height: 70px;
  }

  .modal-content {
    width: 95%;
    margin: 20px;
    padding: 20px;
  }

  .nav-title, .contact-title {
    font-size: 11px;
  }

  #user-info {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* Tablet & Desktop styles unchanged... */

/* Ensure all images don't cause overflow */
img {
  max-width: 100%;
  height: auto;
  display: block;
}
