:root {
  --bg-color: #0f172a;
  --bg-panel: rgba(30, 41, 59, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.5);
  --border: rgba(255, 255, 255, 0.1);
  --success: #10b981;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  background-image:
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
  background-attachment: fixed;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* HERO */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.highlight {
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  background-image: linear-gradient(to right, #60a5fa, #a78bfa);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* GLASS PANEL */
.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  max-width: 700px;
  margin: 0 auto 3rem;
  text-align: center;
}

.glass-panel h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* FORM & CHECKBOXES */
/* HIDDEN IN PHASE 6: .checkbox-group */
.checkbox-group {
  display: none;
  /* User requested to hide agency selection */
}

/* BUTTONS */
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  border-radius: 3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px 0 var(--accent-glow);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.btn-primary:disabled {
  background: #475569;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-link:hover {
  text-decoration: underline;
}

/* BANNER CAROUSEL */
.top-banner {
  background: var(--accent);
  color: white;
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

.banner-track {
  display: inline-block;
  animation: scrollBanner 25s linear infinite;
}

.banner-track span {
  margin-right: 50px;
}

@keyframes scrollBanner {
  0% {
    transform: translateX(50%);
  }

  100% {
    transform: translateX(-100%);
  }
}

/* VISIT BUTTON */
.btn-visit {
  background: var(--success);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

.btn-visit:hover {
  background: #059669;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.6);
}

/* DATA META TAGS */
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
}

.meta-tag {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #cbd5e1;
}

/* STATUS & PROGRESS BAR */
.status-box {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  animation: fadeIn 0.5s ease;
}

.hidden {
  display: none !important;
}

.loader {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s ease-in-out infinite;
}

.progress-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  height: 12px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #60a5fa, #a78bfa);
  width: 0%;
  transition: width 0.4s ease-out;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

/* RESULTS GRID / LIST */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.view-controls {
  display: flex;
  gap: 10px;
  margin-left: auto;
  margin-right: 20px;
}

.view-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.view-btn:hover,
.view-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-color: var(--accent);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* LIST VIEW MODIFIER */
.cards-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cards-grid.list-view .property-card {
  display: flex;
  flex-direction: row;
  height: 180px;
}

.cards-grid.list-view .card-img-wrapper {
  width: 250px;
  height: 100%;
  flex-shrink: 0;
}

.cards-grid.list-view .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cards-grid.list-view .card-footer {
  margin-top: auto;
  border-top: none;
  padding-top: 0;
}

.property-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: slideUp 0.5s ease forwards;
}

.property-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.card-img-wrapper {
  position: relative;
  height: 220px;
  background: #1e293b;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.property-card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

.badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  backdrop-filter: blur(8px);
}

.badge-op {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.7);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge.icasa {
  background: rgba(245, 158, 11, 0.9);
  color: white;
}

.badge.mb {
  background: rgba(16, 185, 129, 0.9);
  color: white;
}

.card-content {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-location {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.card-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--success);
}

/* ANIMATIONS */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .checkbox-group {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .results-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* PREMIUM FILTERS SECTION */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
  margin-bottom: 30px;
  width: 100%;
}

.filters-bar input,
.filters-bar select {
  font-family: inherit;
  font-size: 1rem;
  padding: 14px 24px;
  border-radius: 40px; /* Pill shape */
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(30, 41, 59, 0.7);
  color: #f8fafc;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  flex: 1 1 auto;
  min-width: 150px;
  max-width: 250px;
}

.filters-bar input::placeholder {
  color: rgba(248, 250, 252, 0.5);
}

.filters-bar input:focus,
.filters-bar select:focus {
  border-color: #6366f1;
  background: rgba(30, 41, 59, 0.95);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.25), 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.filters-bar select option {
  background: #1e293b;
  color: #f8fafc;
}

.filters-bar input[type="number"] {
  -moz-appearance: textfield;
}

.filters-bar input[type="number"]::-webkit-outer-spin-button,
.filters-bar input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}