/**
 * AgentListIQ - Mobile-Optimized App Styles
 * Clean, modern design with mobile-first approach
 * NO horizontal scrolling on mobile devices
 */

:root {
  --bg: #ffffff;
  --ink: #0b1220;
  --muted: #5a6b86;
  --line: #e8eef8;
  
  --agent: #0B5CFF;
  --list: #18C964;
  --iq: #FFCC00;
  
  --shadow: 0 18px 50px rgba(10, 30, 70, .12);
  --shadow2: 0 10px 25px rgba(10, 30, 70, .10);
  --shadow3: 0 4px 12px rgba(10, 30, 70, .08);
  
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  
  --sidebar-width: 260px;
}

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

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 12% 8%, rgba(11,92,255,.10), transparent 60%),
    radial-gradient(900px 500px at 88% 10%, rgba(24,201,100,.10), transparent 60%),
    radial-gradient(1000px 650px at 50% 92%, rgba(255,204,0,.10), transparent 60%),
    linear-gradient(#ffffff, #fbfdff);
  line-height: 1.6;
  overflow-x: hidden; /* Prevent horizontal scrolling */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: white;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--line);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s;
}

.logo-link:hover {
  opacity: 0.8;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background:
    radial-gradient(14px 14px at 30% 30%, rgba(255,255,255,.9), rgba(255,255,255,0)),
    conic-gradient(from 210deg, var(--agent), var(--list), var(--iq), var(--agent));
  box-shadow: 0 8px 20px rgba(11,92,255,.18);
  flex-shrink: 0;
}

.logo-text {
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.agent { color: var(--agent); }
.list { color: var(--list); }
.iq { color: var(--iq); }

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(11, 92, 255, 0.05);
  color: var(--ink);
}

.nav-item.active {
  background: rgba(11, 92, 255, 0.08);
  color: var(--agent);
  border-left-color: var(--agent);
}

.nav-item svg {
  flex-shrink: 0;
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0; /* Prevent flex overflow */
  width: calc(100% - var(--sidebar-width));
  max-width: 100vw;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Top Bar */
.top-bar {
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.menu-btn {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--muted);
}

.page-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
  flex: 1;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name {
  font-weight: 600;
  color: var(--muted);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 24px;
  max-width: 100%;
  overflow-x: hidden;
}

.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow3);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--agent);
  box-shadow: 0 0 0 3px rgba(11, 92, 255, 0.1);
}

.btn {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--agent);
  color: white;
  box-shadow: 0 4px 12px rgba(11, 92, 255, 0.3);
}

.btn-primary:hover {
  background: #0a52e6;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(11, 92, 255, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Messages */
.message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
}

.message.show {
  opacity: 1;
}

.message.success {
  background: rgba(24, 201, 100, 0.1);
  color: #0b6b3a;
  border: 1px solid rgba(24, 201, 100, 0.3);
}

.message.error {
  background: rgba(220, 53, 69, 0.1);
  color: #a71d2a;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }

  body {
    overflow-x: hidden; /* Critical for mobile */
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 2px 0 20px rgba(10, 30, 70, 0.2);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
  }

  .menu-btn {
    display: block;
  }

  .top-bar {
    padding: 12px 16px;
  }

  .page-title {
    font-size: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 24px;
  }

  /* Ensure no horizontal scrolling */
  .dashboard-grid,
  .section-card,
  .property-grid,
  .activity-item {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Make sure grid doesn't create horizontal scroll */
  .dashboard-grid {
    grid-template-columns: 1fr !important;
    width: 100%;
  }

  /* Text truncation for long content */
  .property-address,
  .activity-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Reduce padding on mobile */
  .section-card {
    padding: 14px;
  }

  .activity-item,
  .property-card {
    padding: 12px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .top-bar {
    padding: 10px 12px;
  }

  .page-title {
    font-size: 18px;
  }

  .stats-grid {
    padding: 12px;
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-icon {
    font-size: 28px;
  }

  .stat-value {
    font-size: 22px;
  }

  .dashboard-grid {
    padding: 12px;
    gap: 12px;
  }

  .section-title {
    font-size: 16px;
  }

  .property-image {
    width: 60px;
    height: 60px;
  }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1023px) {
  .sidebar {
    transform: translateX(0);
  }

  .main-content {
    margin-left: var(--sidebar-width);
  }

  .menu-btn {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .main-content {
    max-width: 1600px;
  }
}

/* Large desktop */
@media (min-width: 1440px) {
  .stats-grid {
    max-width: 1400px;
    margin: 0 auto;
  }

  .dashboard-grid {
    max-width: 1400px;
    margin: 0 auto;
  }
}

/* Loading States */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden {
  display: none;
}

/* Print Styles */
@media print {
  .sidebar,
  .top-bar,
  .menu-btn {
    display: none;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .stat-card,
  .section-card {
    break-inside: avoid;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --line: #666;
  }

  .nav-item:hover,
  .nav-item.active {
    background: #e0e0e0;
  }

  .form-input:focus {
    box-shadow: 0 0 0 3px #000;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  /* Uncomment to enable dark mode
  :root {
    --bg: #1a1a1a;
    --ink: #ffffff;
    --muted: #a0a0a0;
    --line: #333333;
  }

  .sidebar,
  .top-bar,
  .stat-card,
  .section-card {
    background: #222;
  }

  .form-input {
    background: #2a2a2a;
    color: white;
  }
  */
}

/* ──────────────────────────────────────── */
/* AUTH PAGE STYLES (Login/Register) */
/* ──────────────────────────────────────── */

.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #fbfdff 0%, #f7f9fc 100%);
  padding: 20px;
}

.auth-card {
  background: white;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(10, 30, 70, 0.15);
  padding: 48px;
  width: 100%;
  max-width: 420px;
  border: 1px solid rgba(10, 30, 70, 0.08);
}

.auth-card .logo {
  text-align: center;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-card .logo img {
  height: 60px;
  width: auto;
  margin-bottom: 16px;
}

.auth-card .logo p {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}

.btn-google {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  transition: all 0.2s;
}

.btn-google:hover {
  background: #f9fafb;
  border-color: var(--muted);
}

.auth-divider {
  text-align: center;
  margin: 24px 0;
  font-size: 13px;
  color: var(--muted);
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 35px);
  height: 1px;
  background: var(--line);
}

.auth-divider::before {
  left: 0;
}

.auth-divider::after {
  right: 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--agent);
  box-shadow: 0 0 0 3px rgba(11, 92, 255, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.search-page .form-row-1 {
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .search-page .container {
    padding: 0 32px;
  }

  .search-page .card {
    padding: 32px;
  }

  .search-page .form-row-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .properties-page .container {
    padding: 0 32px;
  }

  .properties-page .card {
    padding: 32px;
  }
}

.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.property-tile {
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(10, 30, 70, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.property-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(10, 30, 70, 0.12);
}

.property-tile-media {
  position: relative;
}

.property-tile-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.property-tile-media .property-status {
  position: absolute;
  top: 12px;
  left: 12px;
}

.property-tile-price {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(10, 30, 70, 0.85);
  color: #fff;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
}

.property-tile-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.property-tile-header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}

.property-tile-header p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.property-tile-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.property-tile-meta span {
  display: block;
  font-weight: 700;
  color: var(--ink);
}

.property-tile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
}

.property-tile-tags span {
  background: var(--bg-secondary);
  padding: 4px 8px;
  border-radius: 999px;
}

.property-tile-summary {
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.property-tile-summary p {
  margin: 6px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.property-tile-cma {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  background: linear-gradient(135deg, rgba(34,197,94,0.1) 0%, rgba(34,197,94,0.05) 100%);
  border-left: 3px solid var(--color-success);
  padding: 10px 12px;
  border-radius: var(--radius-md);
}

.property-tile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 768px) {
  .properties-grid {
    grid-template-columns: 1fr;
  }

  .property-tile-img {
    height: 210px;
  }

  .property-tile-meta,
  .property-tile-cma {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type='checkbox'] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--agent);
}

.btn-primary,
.btn-success {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--agent);
  color: white;
}

.btn-primary:hover {
  background: #0A4FE6;
  box-shadow: 0 8px 20px rgba(11, 92, 255, 0.25);
}

.btn-success {
  background: var(--list);
  color: white;
}

.btn-success:hover {
  background: #17AF5A;
  box-shadow: 0 8px 20px rgba(24, 201, 100, 0.25);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
}

.auth-footer a {
  color: var(--agent);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.toast {
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  color: white;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease-out;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.toast.success {
  background: var(--list);
}

.toast.error {
  background: #ff3b30;
}

.toast.warning {
  background: #ff9500;
}

.toast.info {
  background: var(--agent);
}

/* ──────────────────────────────────────── */
/* ACCOUNT / SETTINGS PAGE STYLES */
/* ──────────────────────────────────────── */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.sidebar-link {
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.sidebar-link:hover {
  background: rgba(11, 92, 255, 0.08);
  color: var(--agent);
}

.sidebar-link.active {
  background: rgba(11, 92, 255, 0.15);
  color: var(--agent);
  font-weight: 600;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 12px rgba(10, 30, 70, 0.08);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 20px;
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-blue {
  background: rgba(11, 92, 255, 0.15);
  color: var(--agent);
}

.badge-green {
  background: rgba(24, 201, 100, 0.15);
  color: var(--list);
}

.badge-yellow {
  background: rgba(255, 204, 0, 0.15);
  color: #996600;
}

.text-muted {
  color: var(--muted);
}

.text-red {
  color: #ff3b30;
}

.text-sm {
  font-size: 13px;
}

.text-xs {
  font-size: 11px;
}

.mt-1 {
  margin-top: 4px;
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--line);
  color: var(--ink);
}

.btn-block {
  width: 100%;
  display: flex;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 14px;
}

/* ──────────────────────────────────────── */
/* PROPERTY CARDS AND SEARCH STYLES */
/* ──────────────────────────────────────── */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  width: 100%;
}

.property-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(10, 30, 70, 0.08);
  border: 1px solid var(--line);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(10, 30, 70, 0.15);
  border-color: rgba(11, 92, 255, 0.3);
}

.property-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 16px 16px 0 0;
  display: block;
}

.property-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.property-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.property-address {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-specs {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.property-specs span {
  display: flex;
  align-items: center;
}

.property-specs span::before {
  content: '•';
  margin-right: 6px;
}

.property-specs span:first-child::before {
  content: '';
  margin-right: 0;
}

.cma-inline {
  flex-wrap: wrap;
}

.cma-inline .badge {
  white-space: nowrap;
}

.property-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-status.active {
  background: rgba(24, 201, 100, 0.15);
  color: var(--list);
  padding: 18px 20px;

.property-status.pending {
  background: rgba(255, 159, 0, 0.15);
  color: #ff9f00;
}

.property-status.sold {
  background: rgba(128, 128, 128, 0.15);
  color: #808080;
}

.btn-outline {
  background: white;
  border: 1px solid var(--line);
  color: var(--muted);
}

.btn-outline:hover {
  background: var(--line);
  color: var(--ink);
  border-color: var(--muted);
}

/* Reduce button sizes for property cards */
.property-card .btn-sm {
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
}

/* Search bar button size */
.card .btn-primary {
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.2;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 96px;
  width: auto; /* override base rule that makes primary buttons full-width */
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  flex: 1;
  height: 40px;
}

/* Saved indicator - make smaller */
.property-card .btn-success {
  font-size: 12px;
  padding: 8px 12px;
}

/* Desktop layout for property list */
.property-list-row {
  display: flex;
  gap: 24px;
  align-items: stretch;
  padding: 0;
}

.property-list-img {
  width: 300px !important;
  height: 240px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 8px 0 0 8px;
}

.property-list-body {
  flex: 1;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.spec-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.property-specs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.cma-summary {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.cma-summary p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text-primary);
}

/* Mobile responsive for property cards */
@media (max-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }

  .property-img {
    height: 200px;
  }

  .property-body {
    padding: 12px;
  }

  .property-price {
    font-size: 18px;
  }

  .property-address {
    font-size: 13px;
  }

  .property-list-row {
    display: flex;
    flex-direction: column;
  }

  .property-list-img {
    width: 100% !important;
    height: 220px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
  }

  .property-list-body {
    padding: 20px;
  }

  .property-specs {
    gap: 8px;
  }

  .cma-inline {
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .property-img {
    height: 180px;
  }
}

}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ──────────────────────────────────────── */
/* TOP NAVIGATION BAR */
/* ──────────────────────────────────────── */

.topnav {
  background: white;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(10, 30, 70, 0.06);
  position: sticky;
  top: 0;
  z-index: 90;
}

.topnav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.topnav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  cursor: pointer;
}

.topnav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  margin: 0 auto;
  border-radius: 2px;
}

.topnav-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.topnav-brand img {
  height: 50px;
  width: auto;
}

.topnav-links {
  display: flex;
  gap: 8px;
  flex: 1;
  margin: 0 40px;
}

.topnav-links a {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  transition: all 0.2s;
  white-space: nowrap;
}

.topnav-links a:hover {
  background: rgba(11, 92, 255, 0.08);
  color: var(--agent);
}

.topnav-links a.active {
  background: rgba(11, 92, 255, 0.15);
  color: var(--agent);
  font-weight: 600;
}

.topnav-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topnav-mobile {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 10px 16px 16px;
  border-top: 1px solid var(--line);
  background: white;
}

.topnav-mobile a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
}

.topnav-mobile a.active,
.topnav-mobile a:hover {
  color: var(--agent);
  background: rgba(11, 92, 255, 0.08);
}

.topnav-mobile.open {
  display: flex;
}

.notification-badge {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s;
}

.notification-badge:hover {
  background: rgba(11, 92, 255, 0.08);
  color: var(--agent);
  border-color: var(--agent);
}

.notification-badge svg {
  width: 20px;
  height: 20px;
}

.notification-badge .count {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff3b30;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid white;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--agent) 0%, var(--list) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(11, 92, 255, 0.25);
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(11, 92, 255, 0.35);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .topnav-inner {
    height: 60px;
    padding: 0 12px;
  }

  .topnav-toggle {
    display: flex;
  }

  .topnav-brand img {
    height: 40px;
  }

  .topnav-links {
    display: none;
    margin: 0;
  }

  .topnav-user {
    gap: 8px;
  }

  .notification-badge,
  .avatar {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }

  .container {
    max-width: 100%;
    padding: 0 14px;
  }
}

/* ========== ALERTS PAGE STYLING ========== */

/* Tabs Navigation */
.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn.active {
  color: var(--agent);
  border-bottom-color: var(--agent);
}

/* Alert Cards */
.alert-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  transition: all 0.2s;
}

.alert-card:hover {
  border-color: var(--agent);
  box-shadow: 0 4px 12px rgba(11, 92, 255, 0.08);
  transform: translateY(-1px);
}

.alert-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 24px;
  flex-shrink: 0;
}

.alert-icon.price-drop {
  background: rgba(220, 53, 69, 0.12);
  color: #dc3545;
}

.alert-icon.new-listing {
  background: rgba(255, 204, 0, 0.12);
  color: #ffc107;
}

.alert-icon.price-rise {
  background: rgba(220, 53, 69, 0.12);
  color: #dc3545;
}

.alert-info {
  flex: 1;
  min-width: 0;
}

.alert-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.alert-detail {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.alert-time {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* Badges for Alert Severity */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-red {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}

.badge-gold {
  background: rgba(255, 204, 0, 0.15);
  color: #996600;
}

.badge-green {
  background: rgba(40, 167, 69, 0.15);
  color: #28a745;
}

.badge-blue {
  background: rgba(11, 92, 255, 0.15);
  color: var(--agent);
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal h2 {
  margin-bottom: 24px;
  font-size: 20px;
}

.modal h3 {
  margin-bottom: 16px;
  font-size: 16px;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

/* Checkbox Label */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--agent);
}

/* Fade In Animation */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Text Center */
.text-center {
  text-align: center;
}

/* Margin Utilities */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* Text Size Utilities */
.text-xs {
  font-size: 12px;
}

.text-sm {
  font-size: 13px;
}

.text-muted {
  color: var(--muted);
}

.text-red {
  color: #dc3545;
}

/* Card Styling */
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .modal {
    padding: 24px;
  }

  .alert-card {
    flex-direction: column;
    gap: 12px;
  }

  .alert-card img {
    width: 100% !important;
    height: auto !important;
  }

  .tabs {
    padding-bottom: 8px;
    gap: 8px;
  }

  .tab-btn {
    padding: 12px 12px;
    font-size: 13px;
  }
}

/* Footer Styles */
.site-footer {
  margin-top: 30px;
  padding: 20px 20px;
  border-top: 1px solid rgba(10,30,70,0.06);
  background: #fff;
  width: 100%;
  font-size: 13px;
  color: #5a6b86;
}
.site-footer.fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.site-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}
.site-footer-logo {
  height: 28px;
  display: block;
}
.site-footer-links {
  display: flex;
  gap: 12px;
  align-items: center;
}
.site-footer-link {
  color: inherit;
  text-decoration: none;
  outline: none;
  border-radius: 4px;
  padding: 2px 4px;
  transition: background 0.15s, color 0.15s;
}
.site-footer-link:focus {
  background: #e8eef8;
  color: #0B5CFF;
  box-shadow: 0 0 0 2px #0B5CFF33;
}
.site-footer-link:hover {
  color: #0B5CFF;
  text-decoration: underline;
}
@media (max-width: 600px) {
  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .site-footer-links {
    gap: 8px;
  }
}
