/* === Base Reset === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  background-color: #f7f9fb;
  color: #333;
}

/* === Layout Structure === */
body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  width: 100%;
  padding: 2rem;
}

/* Header & Footer */
header, footer {
  width: 100%;
  background-color: #2d3e50;
  color: white;
  padding: 1rem 2rem;
  text-align: center;
}

footer {
  flex-shrink: 0;
}

/* === Headings === */
h1, h2, h3 {
  color: #2c3e50;
}

h1 {
  font-size: 2rem;
  color: white;
}

h2 {
  font-size: 1.75rem;
  margin-top: 1.5rem;
}

h3 {
  font-size: 1.5rem;
  margin-top: 1.25rem;
}

/* === Links === */
a {
  color: #2980b9;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* === Navigation === */
nav {
  background: #2c3e50;
  padding: 10px 20px;
  text-align: center;
}

nav a {
  color: #ecf0f1;
  text-decoration: none;
  margin: 0 12px;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover {
  color: #f39c12;
}

nav .right {
  float: right;
}

/* === Cards === */
.card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
}

.card h3 {
  margin-top: 0;
}

/* === Forms === */
form {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
  width: 75%;
  margin-left: auto;
  margin-right: auto;
}

form input,
form select,
form textarea {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

form button {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
}

form button:hover {
  background-color: #217dbb;
}

/* === Filters Form === */
form.filters {
  background: #fff;
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.05);
  width: 100%;
  text-align: center;
  white-space: nowrap;
}

form.filters input,
form.filters select,
form.filters button {
  display: inline-block;
  vertical-align: middle;
  width: auto;
  min-width: 160px;
  margin-right: 1rem;
  margin-bottom: 1rem;
  padding: 0.6rem;
  font-size: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

form.filters button {
  background-color: #27ae60;
  color: white;
  border: none;
  cursor: pointer;
}

form.filters button:hover {
  background-color: #219150;
}

/* === Responsive: Stack fields vertically on small screens === */
@media (max-width: 1240px) {
  form.filters {
    white-space: normal;
  }

  form.filters input,
  form.filters select,
  form.filters button {
    display: block;
    width: 100%;
    margin-right: 0;
  }
}



/* === House List === */
ul.house-list {
  width: 100%;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 0;
  margin: 2rem 0;
}

ul.house-list li {
  background-color: #ffffff;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

ul.house-list li:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

ul.house-list li a {
  display: block;
  padding: 1.2rem;
  color: #2c3e50;
}

ul.house-list li img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

ul.house-list li h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
}

ul.house-list li p {
  font-size: 1rem;
  color: #555;
  margin: 0;
}

/* === House Details View === */
.house-details {
  width: 75%;
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  margin: 2rem auto;
}

.house-details img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.house-details p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 0.8rem;
  color: #444;
}

.house-details strong {
  color: #2d3e50;
}

/* === Alerts === */
.alert {
  padding: 1rem;
  background-color: #fbeaea;
  color: #a94442;
  border-radius: 6px;
  margin: 1rem 0;
}

.success {
  padding: 1rem;
  background-color: #e0f7ea;
  color: #2e7d32;
  border-radius: 6px;
  margin: 1rem 0;
}

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: white;
}

th, td {
  padding: 0.75rem;
  border: 1px solid #e1e1e1;
  text-align: left;
}

th {
  background-color: #f2f2f2;
}

/* === Responsive === */
@media (max-width: 768px) {
  form.filters {
    flex-direction: column;
    align-items: stretch;
  }

  ul.house-list {
    grid-template-columns: 1fr;
  }
}


