/* Reset and basics */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  height: 100%;
  font-family: 'Open Sans', sans-serif;
  background: url('../images/background.jpg') center center/cover no-repeat;
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Properties Section */
.properties-section {
  padding-top: 120px;
  text-align: center;
  opacity: 0;
  transform: translateY(50px);
  animation: fadeInUp 1s ease-out forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.properties-section h1 {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  margin-bottom: 40px;
  color: black;
  position: relative;
}

.properties-section h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: #d60000;
  transition: width 0.3s ease;
}

.properties-section h1:hover::after {
  width: 150px;
}

/* Grid layout */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  padding: 0 40px 60px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .properties-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .properties-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .properties-grid {
    grid-template-columns: 1fr; /* Single column on phones */
    gap: 20px; /* Reduced gap for mobile */
    padding: 0 20px 40px; /* Reduced padding for mobile */
  }
  .properties-grid .property-card {
    position: relative !important;
    width: 300px !important; /* Fixed width with high specificity */
    height: 300px !important; /* Fixed height to match width with high specificity */
    min-height: 0 !important; /* Override desktop min-height */
    border: 7px solid #d60000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    text-decoration: none !important;
    color: inherit;
    background-color: transparent;
    opacity: 0;
    animation: cardPopIn 0.6s ease-out forwards;
    animation-delay: calc(var(--card-index) * 0.1s);
    margin: 0 auto; /* Center the card */
  }
}

/* Card styling */
.property-card {
  position: relative;
  min-height: 400px;
  border: 7px solid #d60000;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  text-decoration: none !important;
  color: inherit;
  background-color: transparent;
  opacity: 0;
  animation: cardPopIn 0.6s ease-out forwards;
  animation-delay: calc(var(--card-index) * 0.1s);
}

@property-card:nth-child(1) { --card-index: 1; }
@property-card:nth-child(2) { --card-index: 2; }
@property-card:nth-child(3) { --card-index: 3; }
@property-card:nth-child(4) { --card-index: 4; }

@keyframes cardPopIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.property-card:hover,
.property-card:focus {
  transform: translateY(-10px) rotate(1deg);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  border-color: #ff3333;
  text-decoration: none !important;
}

.property-card * {
  text-decoration: none !important;
}

.property-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: transform 0.5s ease;
}

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

.property-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  padding: 15px;
  z-index: 2;
  border-radius: 0 0 13px 13px;
  transform: translateY(0);
  opacity: 1;
  transition: background-color 0.4s ease;
  font-size: 14px;
}

.property-card:hover .property-info {
  background-color: rgba(255, 255, 255, 0.9);
}

.property-info h2 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  line-height: 1.3;
  margin-bottom: 5px;
  color: #222;
  text-decoration: none;
  position: relative;
}

.property-info h2::before {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: #d60000;
  transition: width 0.3s ease;
}

.property-info h2:hover::before {
  width: 100%;
}

.property-info p {
  font-size: 14px;
  line-height: 1.3;
  color: #555;
  text-decoration: none;
  margin: 0;
}

.property-info a,
.property-info a:hover,
.property-info a:focus {
  text-decoration: none;
}

/* Particle effect */
@property-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

@property-card:hover::before {
  opacity: 1;
}