/* PropVerify Chihuahua — Estilos personalizados */

:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --secondary: #0ea5e9;
  --accent: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg-card: #ffffff;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #f3f4f6;
}

/* ── Animaciones ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

.fade-in { animation: fadeIn 0.35s ease-out; }
.slide-down { animation: slideDown 0.25s ease-out; }

/* ── Loader ── */
.loader-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Navbar ── */
.navbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
}

.navbar-brand span.accent { color: var(--accent); }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #0ea5e9 100%);
  padding: 4rem 1.5rem;
  color: white;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* ── Search Bar ── */
.search-box {
  background: white;
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: end;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

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

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

.search-box select,
.search-box input {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.search-box select:focus,
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* ── Botones ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,64,175,0.3); }

.btn-secondary { background: var(--secondary); color: white; }
.btn-secondary:hover { background: #0284c7; }

.btn-success { background: var(--accent); color: white; }
.btn-success:hover { background: #059669; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--border); color: var(--text); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Stats Bar ── */
.stats-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.stat-item h3 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}

.stat-item p {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.1rem 0 0;
}

/* ── Tarjetas de propiedades ── */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
}

.property-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.25s ease;
  cursor: pointer;
  position: relative;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.14);
}

.property-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

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

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

.property-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-verified { background: rgba(16,185,129,0.9); color: white; }
.badge-in_review { background: rgba(245,158,11,0.9); color: white; }
.badge-pending { background: rgba(107,114,128,0.9); color: white; }
.badge-rejected { background: rgba(239,68,68,0.9); color: white; }
.badge-venta { background: rgba(30,64,175,0.9); color: white; }
.badge-alquiler { background: rgba(14,165,233,0.9); color: white; }
.badge-alquiler_venta { background: rgba(99,102,241,0.9); color: white; }
.badge-featured { background: rgba(245,158,11,0.95); color: white; }
.badge-alert { background: rgba(239,68,68,0.9); color: white; }

.fav-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  color: #9ca3af;
  transition: all 0.2s;
}

.fav-btn:hover, .fav-btn.active { color: #ef4444; transform: scale(1.1); }

.property-info {
  padding: 1rem;
}

.property-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.property-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-location {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.property-features {
  display: flex;
  gap: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.feature {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
}

/* ── Badge de verificación ── */
.doc-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  margin-top: 0.5rem;
}

.doc-status.verified { background: #ecfdf5; color: #065f46; }
.doc-status.in_review { background: #fffbeb; color: #92400e; }
.doc-status.pending { background: #f3f4f6; color: #374151; }
.doc-status.rejected { background: #fef2f2; color: #991b1b; }

/* ── Detalle de propiedad ── */
.detail-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .detail-layout { grid-template-columns: 1fr; }
}

.detail-gallery {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: #000;
  height: 380px;
}

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

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.gallery-thumb {
  width: 70px; height: 52px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.gallery-thumb.active { border-color: var(--primary); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Verificación ── */
.verify-panel {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.verify-panel h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.doc-item:hover { background: #f9fafb; }

.doc-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.doc-icon.verified { background: #ecfdf5; color: #10b981; }
.doc-icon.in_review { background: #fffbeb; color: #f59e0b; }
.doc-icon.pending, .doc-icon.uploaded { background: #f3f4f6; color: #6b7280; }
.doc-icon.rejected { background: #fef2f2; color: #ef4444; }

.doc-details h4 {
  font-size: 0.86rem;
  font-weight: 600;
  margin: 0 0 0.15rem;
}

.doc-details p {
  font-size: 0.76rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

/* ── Timeline de propietarios ── */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding: 0 0 1.25rem 1rem;
}

.timeline-dot {
  position: absolute;
  left: -1.6rem;
  top: 0.2rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--primary);
}

.timeline-dot.current {
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  animation: pulse-ring 2s infinite;
}

.timeline-item h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}

.timeline-item p {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Alertas ── */
.alert-box {
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.87rem;
}

.alert-critical { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.alert-high { background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; }
.alert-medium { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }
.alert-low { background: #f0f9ff; border: 1px solid #bae6fd; color: #0c4a6e; }

/* ── Sidebar de contacto ── */
.contact-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: sticky;
  top: 80px;
}

.seller-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.seller-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  gap: 0;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.7rem 1.2rem;
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}

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

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

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-box {
  background: white;
  border-radius: 16px;
  padding: 1.75rem;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn 0.25s ease;
}

.modal-box h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Formularios ── */
.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,64,175,0.1);
}

textarea.form-control { resize: vertical; min-height: 90px; }

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideDown 0.3s ease;
  max-width: 320px;
}

.toast-success { background: var(--accent); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }
.toast-warning { background: var(--warning); }

/* ── Filtros ── */
.filters-bar {
  background: white;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  position: sticky;
  top: 64px;
  z-index: 90;
}

.filter-chip {
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-chip:hover, .filter-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

/* ── Verificación badge grande ── */
.verify-status-big {
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.verify-status-big.verified { background: linear-gradient(135deg, #ecfdf5, #d1fae5); border: 1px solid #6ee7b7; }
.verify-status-big.in_review { background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid #fcd34d; }
.verify-status-big.pending { background: linear-gradient(135deg, #f3f4f6, #e5e7eb); border: 1px solid #d1d5db; }
.verify-status-big.rejected { background: linear-gradient(135deg, #fef2f2, #fee2e2); border: 1px solid #fca5a5; }

.verify-icon-big {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.verified .verify-icon-big { background: #10b981; color: white; }
.in_review .verify-icon-big { background: #f59e0b; color: white; }
.pending .verify-icon-big { background: #6b7280; color: white; }
.rejected .verify-icon-big { background: #ef4444; color: white; }

/* ── Footer ── */
.footer {
  background: #1e3a8a;
  color: white;
  padding: 2.5rem 1.5rem 1.5rem;
  margin-top: 4rem;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .property-grid { grid-template-columns: 1fr; padding: 1rem; }
  .detail-layout { padding: 1rem; gap: 1rem; }
  .hero { padding: 2.5rem 1rem; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f3f4f6; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* Scrollbar horizontal para filtros */
.filters-bar::-webkit-scrollbar { height: 3px; }

/* ── No results ── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}
.empty-state i { font-size: 3.5rem; margin-bottom: 1rem; color: #d1d5db; }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }

/* ── Input range ── */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

/* ── Hero badge ── */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 0.3rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.search-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
  display: block;
  margin-bottom: 4px;
}

/* ── CTA Vendedor ── */
.cta-vendedor {
  background: linear-gradient(135deg, #065f46 0%, #047857 50%, #059669 100%);
  padding: 3.5rem 1.5rem;
  color: white;
}

.btn-white { background: white; color: #1e40af; font-weight: 700; }
.btn-white:hover { background: #f0f9ff; transform: translateY(-1px); }
.btn-white-outline { background: transparent; border: 2px solid white; color: white; font-weight: 700; }
.btn-white-outline:hover { background: rgba(255,255,255,0.15); }

/* ── Comisión banner ── */
.commission-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 0;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 0.85rem;
  color: #78350f;
}

.commission-icon {
  color: #f59e0b;
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Doc meta chips ── */
.doc-meta {
  font-size: 0.73rem;
  background: #f3f4f6;
  color: #374151;
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.doc-meta-blue { background: #eff6ff; color: #1e40af; }

/* ── Tab badges ── */
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 4px;
  color: white;
}
.tab-badge-verified { background: #10b981; }
.tab-badge-in_review { background: #f59e0b; }
.tab-badge-pending { background: #6b7280; }
.tab-badge-rejected { background: #ef4444; }

/* ── Filter title ── */
.filter-title {
  font-weight: 700;
  color: #374151;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* ── Responsive hidden ── */
@media (max-width: 480px) {
  .hidden-xs { display: none; }
}
@media (max-width: 768px) {
  .hidden-mobile { display: none; }
  .search-box { grid-template-columns: 1fr 1fr !important; }
}

/* ── Badge renta ── */
.badge-renta { background: rgba(14,165,233,0.9); color: white; }
.badge-venta_renta { background: rgba(99,102,241,0.9); color: white; }

/* ── Property type rancho ── */
.badge-rancho { background: rgba(180,83,9,0.9); color: white; }
