/* =========================================================
   DR Luxury Real Estate — Custom CSS (Tailwind complement)
   ========================================================= */

/* ---- Fonts -------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Inter:wght@300;400;500;600&display=swap');

/* ---- CSS Custom Properties ---------------------------- */
:root {
  --navy:      #0D1B2A;
  --navy-mid:  #1A2F47;
  --gold:      #C9A84C;
  --gold-light:#E8D5A3;
  --cream:     #F8F4EE;
  --off-white: #FAFAF8;
  --charcoal:  #2D3748;
  --text-muted:#718096;
  --transition: 350ms cubic-bezier(.4,0,.2,1);
}

/* ---- Base --------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--off-white);
  color: var(--charcoal);
  -webkit-font-smoothing: antialiased;
}

/* ---- Typography helpers ------------------------------- */
.font-display  { font-family: 'Playfair Display', Georgia, serif; }
.tracking-hero { letter-spacing: .14em; }

/* ---- Navigation --------------------------------------- */
#site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
}
#site-header.scrolled {
  background: rgba(255,255,255,.97);
  box-shadow: 0 2px 20px rgba(0,0,0,.09);
  backdrop-filter: blur(8px);
}
#site-header:not(.scrolled) .nav-link { color: rgba(255,255,255,.9) !important; }
#site-header.scrolled .nav-logo,
#site-header.scrolled .nav-link { color: var(--navy) !important; }
#site-header.scrolled .nav-cta  { color: #fff !important; }
.nav-link {
  position: relative;
  transition: color var(--transition);
}
.nav-link::after {
  content: '';
  position: absolute; bottom: -3px; left: 0; width: 0; height: 1px;
  background: var(--gold);
  transition: width var(--transition);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* ---- Hero --------------------------------------------- */
.hero-section {
  position: relative; height: 100vh; min-height: 600px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0D1B2A 0%, #1A3A5C 50%, #0D2B1E 100%);
}
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; opacity: 0;
  transition: opacity 1s ease;
}
.hero-video.loaded { opacity: 1; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(13,27,42,.55) 0%,
    rgba(13,27,42,.4) 50%,
    rgba(13,27,42,.75) 100%
  );
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center; color: #fff;
}
.hero-search {
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 4px;
  padding: 6px 6px 6px 16px;
  display: flex; align-items: center; gap: 8px;
}
.hero-search input {
  background: transparent; border: none; outline: none;
  color: #fff; flex: 1; font-size: .95rem;
}
.hero-search input::placeholder { color: rgba(255,255,255,.65); }

/* Gold divider */
.gold-divider {
  display: flex; align-items: center; gap: 12px;
  justify-content: center;
}
.gold-divider::before,
.gold-divider::after {
  content: ''; flex: 1; max-width: 80px;
  height: 1px; background: var(--gold);
}

/* ---- Property Card ------------------------------------ */
.property-card {
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow var(--transition), transform var(--transition);
}
.property-card:hover {
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
  transform: translateY(-4px);
}
.property-card-image-wrap {
  overflow: hidden;
  aspect-ratio: 4/3;
  position: relative;
}
.property-card-image {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.4,0,.2,1);
}
.property-card:hover .property-card-image { transform: scale(1.06); }
.property-badge {
  position: absolute; top: 12px; left: 12px;
  background: var(--gold);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 2px;
}
.property-badge.rental  { background: #1B6CA8; }
.property-badge.sold    { background: #9B2C2C; }
.property-badge.new     { background: #276749; }

/* ---- Category Grid ------------------------------------ */
.category-card {
  position: relative; overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 4/3;
  cursor: pointer;
  transition: transform var(--transition);
}
.category-card:hover { transform: scale(1.02); }
.category-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,27,42,.85) 0%, rgba(13,27,42,.2) 60%);
  transition: background var(--transition);
}
.category-card:hover .category-card-overlay {
  background: linear-gradient(to top, rgba(13,27,42,.9) 0%, rgba(13,27,42,.4) 60%);
}
.category-card-bg {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.category-card:hover .category-card-bg { transform: scale(1.07); }

/* ---- Blog Card ---------------------------------------- */
.blog-card { background: #fff; border-radius: 4px; overflow: hidden; box-shadow: 0 2px 12px rgba(13,27,42,.07); transition: box-shadow .3s ease; }
.blog-card:hover { box-shadow: 0 6px 24px rgba(13,27,42,.13); }
.blog-card-image-wrap {
  overflow: hidden;
  aspect-ratio: 16/9;
}
.blog-card-image {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.blog-card:hover .blog-card-image { transform: scale(1.05); }
.blog-card-body { padding: 1.25rem 1.5rem 1.5rem; }
.blog-card-title { font-family: 'Playfair Display', Georgia, serif; font-size: 1.1rem; font-weight: 700; color: #0D1B2A; margin-bottom: .5rem; line-height: 1.4; }
.blog-card-title a { color: inherit; text-decoration: none; }
.blog-card-title a:hover { color: #C9A84C; }
.blog-card-excerpt { font-size: .875rem; color: #718096; line-height: 1.6; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.blog-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: .75rem; color: #A0AEC0; border-top: 1px solid #EDF2F7; padding-top: .75rem; }
.blog-tag { display: inline-block; background: #F0EAD8; color: #8B6914; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 2px; }

/* ---- Gallery ------------------------------------------ */
#lightbox {
  display: none; position: fixed; inset: 0;
  z-index: 9999; background: rgba(0,0,0,.92);
  align-items: center; justify-content: center;
  flex-direction: column;
}
#lightbox.active { display: flex; }
#lightbox img {
  max-width: 90vw; max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px,1fr)); gap: 6px; }
.thumb-item { aspect-ratio: 1; overflow: hidden; cursor: pointer; border-radius: 3px; }
.thumb-item img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s; }
.thumb-item:hover img, .thumb-item.active img { opacity: .75; }
.thumb-item.active { outline: 2px solid var(--gold); }

/* ---- Filters sidebar ---------------------------------- */
.filter-label {
  font-size: .75rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted);
  display: block; margin-bottom: 6px;
}
.filter-select {
  width: 100%; padding: 9px 12px;
  border: 1px solid #E2E8F0; border-radius: 3px;
  background: #fff; color: var(--charcoal);
  font-size: .9rem; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--gold); }

/* Price range slider */
.range-input { -webkit-appearance: none; width: 100%; height: 3px; background: #E2E8F0; border-radius: 2px; outline: none; }
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--gold); cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* ---- Buttons ------------------------------------------ */
.btn-gold {
  background: var(--gold);
  color: #fff;
  padding: .7rem 1.8rem;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: none; border-radius: 3px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-gold:hover {
  background: #b89240;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201,168,76,.4);
}
.btn-navy {
  background: var(--navy);
  color: #fff;
  padding: .7rem 1.8rem;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: none; border-radius: 3px;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-navy:hover { background: var(--navy-mid); }
.btn-outline {
  border: 1.5px solid currentColor;
  padding: .65rem 1.7rem;
  font-size: .875rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
}
.btn-outline:hover { background: var(--navy); border-color: var(--navy); color: #fff !important; }

/* ---- Forms -------------------------------------------- */
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid #E2E8F0;
  border-radius: 3px;
  font-size: .9rem;
  color: var(--charcoal);
  background: #fff;
  outline: none;
  transition: border-color var(--transition);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.12);
}
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ---- Stats bar ---------------------------------------- */
.stats-bar {
  background: var(--navy);
  color: rgba(255,255,255,.9);
}
.stat-item { text-align: center; }
.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--gold);
  line-height: 1.1;
}

/* ---- Section dividers --------------------------------- */
.wave-divider { overflow: hidden; line-height: 0; }

/* ---- Scroll reveal animation -------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Pagination --------------------------------------- */
.page-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px;
  border: 1px solid #E2E8F0;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
}
.page-btn:hover, .page-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* ---- Mobile nav --------------------------------------- */
#mobile-menu {
  position: fixed; inset: 0; z-index: 999;
  background: var(--navy);
  display: flex; flex-direction: column;
  padding: 80px 2rem 2rem;
  transform: translateX(100%);
  transition: transform var(--transition);
}
#mobile-menu.open { transform: translateX(0); }
.mobile-nav-link {
  color: rgba(255,255,255,.85);
  font-size: 1.25rem;
  font-weight: 300;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: block;
  transition: color .2s;
}
.mobile-nav-link:hover { color: var(--gold); }

/* ---- Map placeholder ---------------------------------- */
.map-placeholder {
  background: #E2E8F0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: .9rem;
}

/* ---- Footer ------------------------------------------- */
footer { background: var(--navy); color: rgba(255,255,255,.8); }
footer a { color: rgba(255,255,255,.65); transition: color .2s; }
footer a:hover { color: var(--gold); }

/* ---- Admin layout ------------------------------------- */
.admin-sidebar {
  width: 260px; min-height: 100vh;
  background: var(--navy);
  color: rgba(255,255,255,.8);
  padding: 1.5rem 0;
  position: fixed; top: 0; left: 0;
}
.admin-content {
  margin-left: 260px; min-height: 100vh;
  background: #F7FAFC;
  padding: 2rem;
}
.admin-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.65);
  font-size: .875rem;
  transition: all .2s;
}
.admin-nav-item:hover, .admin-nav-item.active {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-left: 3px solid var(--gold);
}
.admin-card {
  background: #fff; border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  padding: 1.5rem;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #EDF2F7;
  text-align: left;
  font-size: .875rem;
}
.admin-table th {
  background: #F7FAFC;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .06em;
}
.admin-badge {
  font-size: .7rem; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: .06em;
}
.admin-badge.active   { background: #C6F6D5; color: #276749; }
.admin-badge.inactive { background: #FED7D7; color: #9B2C2C; }
.admin-badge.sold     { background: #E2E8F0; color: #4A5568; }

/* ---- Loading spinner ---------------------------------- */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(201,168,76,.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Responsive tweaks -------------------------------- */
@media (max-width: 768px) {
  .hero-section { height: 100svh; }
  .admin-sidebar { display: none; }
  .admin-content { margin-left: 0; padding: 1rem; }
  .stat-number { font-size: 1.5rem; }
}
