import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap');

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

:root {
  --background: hsl(40, 25%, 97%);
  --foreground: hsl(220, 20%, 20%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(220, 20%, 20%);
  --primary: hsl(15, 55%, 45%);
  --primary-foreground: hsl(40, 25%, 97%);
  --secondary: hsl(145, 20%, 88%);
  --secondary-foreground: hsl(145, 25%, 25%);
  --muted: hsl(40, 15%, 92%);
  --muted-foreground: hsl(220, 10%, 45%);
  --accent: hsl(145, 25%, 35%);
  --accent-foreground: hsl(40, 25%, 97%);
  --border: hsl(40, 15%, 88%);
  --radius: 0.75rem;
}

body {
  font-family: 'DM Sans', sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

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

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.header-contact a {
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}

.header-contact a:hover {
  text-decoration: underline;
}
.header-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background-color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary-foreground);
}

.header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--foreground);
}

.title-main {
  font-weight: 700;
  font-size: 40px;
  letter-spacing: 0.05m;
}

.title-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.70em;
  font-style: italic;
  opacity: 0.85;
  padding: 8px;
}
.header-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Main Content */
main {
  padding: 2rem 0 3rem;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--muted-foreground);
}

/* Apartment Grid */
.apartments-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .apartments-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Apartment Card */
.apartment-card {
  background-color: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeIn 0.5s ease-out forwards;
  opacity: 0;
  display: flex;
  flex-direction: column;
}

.apartment-card:nth-child(1) { animation-delay: 0ms; }
.apartment-card:nth-child(2) { animation-delay: 100ms; }
.apartment-card:nth-child(3) { animation-delay: 200ms; }
.apartment-card:nth-child(4) { animation-delay: 300ms; }

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

.apartment-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.apartment-image-wrapper {
  position: relative;
}

.apartment-image {
  width: 100%;
  height: 26rem;
  object-fit: cover;
}

.status-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
}

.status-badge.available {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.status-badge.rented {
  background-color: var(--muted);
  color: var(--muted-foreground);
}

.apartment-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.apartment-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.25rem;
}

.apartment-address {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
}

.apartment-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.apartment-details {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.size-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
}

.type-label {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.size-badge svg,
.type-label svg {
  width: 0.875rem;
  height: 0.875rem;
}

.apartment-price-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.price-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.price-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
}

/* Contact Section */
.contact-section {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .contact-section {
    padding: 2rem;
  }
}

.contact-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.contact-text {
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .contact-buttons {
    flex-direction: row;
  }
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.contact-btn svg {
  width: 1rem;
  height: 1rem;
}

.contact-btn.primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.contact-btn.primary:hover {
  background-color: hsl(15, 55%, 40%);
}

.contact-btn.secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.contact-btn.secondary:hover {
  background-color: hsl(145, 20%, 82%);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: 3rem;
}

.footer-text {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
