/* ========================================
   COZY HOMES - Color Palette
   ======================================== */
/* Rust Orange: #C17857 | Teal: #5B9CAA | Golden Yellow: #F4D8A8 | White: #FFFFFF */

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

:root {
  --color-rust: #C17857;
  --color-teal: #5B9CAA;
  --color-golden: #F4D8A8;
  --color-white: #FFFFFF;
  --color-dark: #2C3E50;
  --color-light-bg: #F8F4F0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--color-dark);
  background-color: var(--color-light-bg);
}

html {
  scroll-padding-top: 96px;
}

section[id] {
  scroll-margin-top: 96px;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */
header {
  background: linear-gradient(135deg, var(--color-rust) 0%, #B85D42 100%);
  color: var(--color-white);
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease;
}

.site-navbar {
  background: transparent;
}

.site-navbar .nav-link {
  position: relative;
  color: var(--color-white);
  font-weight: 500;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.site-navbar .nav-link::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.25rem;
  height: 2px;
  background: var(--color-golden);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.site-navbar .nav-link:hover {
  color: var(--color-golden) !important;
  background: rgba(255, 255, 255, 0.08);
}

.site-navbar .nav-link:hover::after,
.site-navbar .nav-link.active::after {
  transform: scaleX(1);
}

.site-navbar .nav-link.active {
  color: var(--color-golden) !important;
  background: rgba(244, 216, 168, 0.16);
  box-shadow: inset 0 0 0 1px rgba(244, 216, 168, 0.35);
}

header.nav-scrolled {
  background: rgba(184, 93, 66, 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

nav {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  gap: 3rem;
  position: relative;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  padding-left: 1rem;
}

.logo-container img {
  height: 50px;
  width: 50px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.logo-container:hover img {
  transform: scale(1.05);
}

.brand-name {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-white);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--color-white);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease, border-bottom 0.3s ease;
  padding-bottom: 0.25rem;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover {
  color: var(--color-golden);
  border-bottom: 2px solid var(--color-golden);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero {
  background: linear-gradient(135deg, rgba(91, 156, 170, 0.75) 0%, rgba(74, 133, 149, 0.75) 100%), url('/static/img/bg.png') center/cover no-repeat;
  color: var(--color-white);
  padding: 5rem 2rem;
  text-align: center;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: var(--color-golden);
  border-radius: 50%;
  opacity: 0.1;
}

/* ========================================
   GALLERY SECTION
   ======================================== */
.gallery-section {
  background: #111;
  padding: 1.5rem 0 0;
}

.gallery-header {
  text-align: center;
  margin: 0 0 1rem;
}

.gallery-header h2 {
  color: var(--color-golden);
  font-size: 2rem;
  margin: 0;
  letter-spacing: 0.8px;
}

.gallery-carousel .carousel-item {
  height: calc(100vh - 96px);
  min-height: 540px;
  background: #000;
}

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

.gallery-carousel .carousel-control-prev-icon,
.gallery-carousel .carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  padding: 1.25rem;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -50%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: var(--color-rust);
  border-radius: 50%;
  opacity: 0.1;
}

.hero-content {
  max-width: 1000px;
  z-index: 1;
  position: relative;
}

.hero img {
  height: 200px;
  width: auto;
  margin-bottom: 2rem;
  filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.2));
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  letter-spacing: 1px;
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  line-height: 1.8;
}

.cta-button {
  display: inline-block;
  background-color: var(--color-rust);
  color: var(--color-white);
  padding: 1rem 2.5rem;
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(193, 120, 87, 0.3);
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  background-color: #B85D42;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(193, 120, 87, 0.4);
}

.cta-button-secondary {
  background-color: var(--color-golden);
  color: var(--color-dark);
  margin-left: 1rem;
}

.cta-button-secondary:hover {
  background-color: #E5C899;
}

/* ========================================
   FEATURES SECTION
   ======================================== */
.features {
  max-width: 1200px;
  margin: 5rem auto;
  padding: 0 2rem;
}

.section-title {
  font-size: 2.5rem;
  color: var(--color-rust);
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--color-teal) 0%, var(--color-rust) 100%);
  border-radius: 2px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 5rem;
}

.feature-card {
  background: var(--color-white);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border-left: 5px solid var(--color-teal);
  text-align: center;
}

.feature-card:nth-child(2) {
  border-left-color: var(--color-rust);
}

.feature-card:nth-child(3) {
  border-left-color: var(--color-golden);
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  color: var(--color-rust);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.feature-card p {
  color: #666;
  line-height: 1.8;
}

/* ========================================
   LISTINGS SECTION
   ======================================== */
.listings {
  background-color: #FFFAFB;
  padding: 5rem 2rem;
}

.listings-container {
  max-width: 1200px;
  margin: 0 auto;
}

.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.listing-card {
  background: var(--color-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.listing-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-golden) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--color-white);
  opacity: 0.8;
}

.listing-content {
  padding: 1.5rem;
}

.listing-price {
  color: var(--color-rust);
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.listing-title {
  color: var(--color-dark);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.listing-location {
  color: #888;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.listing-details {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #EEE;
}

.listing-detail {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.listing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.listing-card:hover .listing-image {
  opacity: 1;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
  background-color: var(--color-dark);
  color: var(--color-white);
  padding: 3rem 2rem;
}

.footer-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: start;
}

.footer-section h4 {
  color: var(--color-golden);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.8rem;
}

.footer-section a {
  color: #CCC;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--color-golden);
}

.footer-bottom {
  border-top: 1px solid #444;
  padding-top: 2rem;
  text-align: center;
  color: #AAA;
}

/* ========================================
   CONTACT SECTION & FORMS
   ======================================== */
.contact {
  max-width: 900px;
  margin: 4rem auto;
  padding: 3rem 2rem;
  background: var(--color-white);
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.contact h2 {
  color: var(--color-rust);
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.contact > p {
  color: var(--color-dark);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--color-rust);
  font-weight: bold;
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid var(--color-teal);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-rust);
  box-shadow: 0 0 8px rgba(193, 120, 87, 0.3);
}

.form-group textarea {
  resize: vertical;
}

.text-center {
  text-align: center;
}

.text-center p {
  margin-bottom: 1rem;
  color: var(--color-dark);
  font-weight: 500;
}

#captchaContainer {
  margin: 1.5rem 0;
  padding: 1rem;
  background-color: #F8F4F0;
  border-radius: 8px;
}

#captchaContainer p {
  margin-bottom: 1rem;
  color: var(--color-dark);
  font-weight: 500;
}

.captcha-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.captcha-option {
  position: relative;
}

#captchaContainer label {
  display: inline-block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#captchaContainer label:hover {
  transform: scale(1.05);
}

#captchaContainer img {
  height: 80px;
  width: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 3px solid transparent;
  transition: border-color 0.2s ease;
  display: block;
}

#captchaContainer input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

#captchaContainer input[type="radio"]:checked + label img {
  border-color: var(--color-rust);
  box-shadow: 0 0 10px rgba(193, 120, 87, 0.5);
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--color-rust) 0%, #B85D42 100%);
  color: var(--color-white);
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(193, 120, 87, 0.4);
}

.submit-btn:active {
  transform: translateY(0);
}

.mb-3 {
  margin-bottom: 1rem;
}

/* Messages/Alerts */
.messages {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  max-width: 400px;
}

.alert {
  background-color: #d4edda;
  border: 2px solid #28a745;
  color: #155724;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease-out;
}

.alert.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

.alert.alert-warning {
  background-color: #fff3cd;
  border-color: #ffeeba;
  color: #856404;
}

.alert.alert-info {
  background-color: #d1ecf1;
  border-color: #bee5eb;
  color: #0c5460;
}

.alert-close {
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: bold;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.alert-close:hover {
  opacity: 1;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 768px) {
  .nav-links {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .cta-button-secondary {
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .features-grid,
  .listings-grid,
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
  .footer-content {
    grid-template-columns: 1fr;
  }

  .gallery-carousel .carousel-item {
    height: 70vh;
    min-height: 420px;
  }
}

@media (max-width: 480px) {
  nav {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .hero {
    padding: 3rem 1rem;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero img {
    height: 120px;
  }

  .features,
  .listings,
  .testimonials {
    padding: 2rem 1rem;
  }
}
