:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --primary: #1d4ed8;
  --primary-strong: #0f172a;
  --accent: #f97316;
  --text: #11264f;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header,
.site-footer {
  background: #0f172a;
  color: white;
}

.header-inner,
.footer-inner,
.hero-grid,
.section-header,
.highlight-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-header {
  padding: 18px 0;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 12px;
  background: white;
  padding: 4px;
}

.brand span {
  display: inline-block;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.main-nav a {
  color: rgba(255,255,255,0.9);
  transition: color 0.2s ease;
}

.main-nav a:hover {
  color: white;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  padding: 14px 24px;
  background: var(--accent);
  color: white;
  box-shadow: 0 16px 30px rgba(249, 115, 22, 0.18);
}

.button-secondary {
  padding: 12px 22px;
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1px solid rgba(255,255,255,0.18);
}

.button-secondary:hover {
  background: rgba(255,255,255,0.18);
}

.admin-actions .button-secondary {
  background: rgba(15, 23, 42, 0.08);
  color: var(--primary-strong);
  border-color: rgba(15, 23, 42, 0.14);
}

.admin-actions .button-secondary:hover {
  background: rgba(15, 23, 42, 0.16);
}

.hero-section {
  padding: 80px 0 60px;
  background: radial-gradient(circle at top, rgba(249,115,22,0.18), transparent 35%),
              linear-gradient(180deg, #eef2ff 0%, #f8fafc 100%);
}

.hero-grid {
  gap: 40px;
}

.hero-copy {
  flex: 1.1;
  max-width: 540px;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.8rem, 5vw, 4.2rem);
  line-height: 0.95;
}

.hero-text {
  margin: 24px 0 0;
  max-width: 520px;
  color: var(--muted);
}

.hero-card {
  flex: 0.9;
  min-width: 320px;
  background: white;
  padding: 32px;
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.search-card label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.search-card input,
.search-card select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  margin-bottom: 18px;
  outline: none;
}

.range-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.section {
  padding: 80px 0;
}

.featured-properties {
  padding-top: 0;
}

.section-header {
  align-items: flex-end;
}

.property-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.property-card {
  display: block;
  border-radius: 24px;
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.property-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
}

.property-image {
  height: 230px;
  background-size: cover;
  background-position: center;
}

.property-info {
  padding: 22px;
}

.property-meta {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 600;
}

.property-price {
  margin: 12px 0 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-strong);
}

.highlights {
  background: #f8fafc;
}

.highlight-grid {
  gap: 24px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card {
  background: white;
  border-radius: 22px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.feature-card h3 {
  margin-top: 0;
}

.empty-state,
.alert-message {
  padding: 40px;
  text-align: center;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--shadow);
  color: var(--muted);
}

.site-footer {
  background: linear-gradient(135deg, #0b1224 0%, #111827 100%);
  color: rgba(255,255,255,0.95);
  padding: 64px 0 28px;
}

.footer-inner {
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.2fr) minmax(180px, 1fr) minmax(220px, 1fr);
  gap: 40px;
}

.footer-brand {
  max-width: 520px;
}

.brand-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-footer img {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255,255,255,0.1);
  padding: 8px;
}

.brand-footer span {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.footer-brand p,
.footer-contact p,
.footer-note {
  color: rgba(255,255,255,0.72);
  line-height: 1.85;
}

.footer-links-block,
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.footer-links-block h3,
.footer-contact h3 {
  margin: 0;
  color: white;
  font-size: 1.05rem;
}

.footer-nav {
  display: grid;
  gap: 10px;
}

.footer-nav a {
  color: rgba(255,255,255,0.78);
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-contact {
  max-width: 320px;
}

.footer-social {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-social a {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  color: white;
  font-weight: 700;
  transition: background 0.2s ease, transform 0.2s ease;
}

.footer-social a:hover {
  background: rgba(249,115,22,0.2);
  transform: translateY(-2px);
}

.footer-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding-top: 28px;
  margin-top: 36px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.68);
}

.footer-bottom p {
  margin: 0;
  text-align: center;
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .site-footer {
    padding: 48px 0 24px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

.form-panel,
.card-panel,
.property-panel,
.chat-panel {
  background: white;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px;
}

form input,
form select,
form textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #d1d5db;
  margin-bottom: 18px;
  outline: none;
}

form textarea {
  min-height: 160px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 20px;
  overflow: hidden;
}

thead {
  background: #eef2ff;
}

th,
td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

tr:last-child td {
  border-bottom: none;
}

.status-pill {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: white;
  background: #10b981;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
}

.admin-actions a,
.admin-actions button {
  margin-right: 8px;
}

.property-detail {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  width: 100%;
  min-width: 0;
}

.property-detail > div {
  min-width: 0;
}

.property-gallery {
  display: grid;
  gap: 18px;
}

.property-gallery img {
  width: 100%;
  border-radius: 20px;
  object-fit: cover;
  aspect-ratio: 16 / 9;
  min-height: 260px;
}

.gallery-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.property-meta-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.property-meta-list li {
  margin-bottom: 14px;
  color: var(--muted);
}

.property-map iframe {
  width: 100%;
  min-height: 320px;
  border: 0;
  border-radius: 20px;
}

@media (max-width: 768px) {
  .property-map iframe {
    min-height: 250px;
  }
}

@media (max-width: 1024px) {
  .hero-grid,
  .section-header,
  .highlight-grid,
  .header-inner,
  .footer-inner {
    flex-direction: column;
  }

  .property-detail {
    grid-template-columns: 1fr;
  }

  .property-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .property-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .property-gallery {
    gap: 16px;
  }

  .gallery-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .property-gallery img {
    min-height: 220px;
  }

  .property-meta-list li {
    font-size: 0.95rem;
  }

  .card-panel {
    padding: 20px;
  }
}

/* Additional responsive styles for better mobile and tablet support */

@media (max-width: 1024px) {
  .container {
    width: calc(100% - 20px);
  }

  .hero-grid,
  .property-detail,
  .section-header,
  .highlight-grid,
  .header-inner,
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .property-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    max-width: 100%;
    padding: 20px;
  }

  .table-container {
    overflow-x: auto;
  }

  table {
    min-width: 600px; /* Ensure table doesn't shrink too much */
  }
}

@media (max-width: 768px) {
  .container {
    width: calc(100% - 16px);
  }

  .site-header {
    padding: 12px 0;
  }

  .brand {
    font-size: 1.5rem;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .main-nav {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .hero-card {
    padding: 20px;
  }

  .hero-text {
    font-size: 1.1rem;
  }

  .property-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .property-card {
    padding: 16px;
  }

  .property-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .property-gallery {
    gap: 12px;
  }

  .gallery-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .property-meta-list li {
    font-size: 0.9rem;
  }

  .form-panel,
  .card-panel,
  .property-panel,
  .chat-panel {
    padding: 20px;
    border-radius: 16px;
  }

  .chatbox {
    min-height: 300px;
  }

  .site-footer {
    padding: 32px 0 16px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .alert-message {
    font-size: 0.9rem;
    padding: 12px;
  }

  .button {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .admin-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .admin-actions .button {
    width: 100%;
  }
}

/* Chatbot specific styles */
.chatbox {
  min-height: 360px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 22px;
  overflow-y: auto;
}

.chat-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

@media (max-width: 768px) {
  .chatbox {
    min-height: 300px;
    padding: 16px;
  }

  .chat-form {
    gap: 12px;
    margin-top: 16px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    width: calc(100% - 30px);
  }

  .property-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-panel {
    max-width: 800px;
  }
}
/* ============================= */
/* FINAL RESPONSIVE FIX (GLOBAL) */
/* ============================= */

/* 🔥 FIX HEADER (iPhone + all mobile) */
@media (max-width: 768px) {

  .site-header {
    width: 100%;
    padding: 10px 0 !important;
  }

  .header-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    text-align: center;
  }

  .brand {
    justify-content: center !important;
    width: auto;
  }

  .main-nav {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 420px;
  }

  .main-nav a {
    width: 100% !important;
    text-align: center !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,0.08);
    font-size: 0.95rem;
  }
}

/* 🔥 FIX PROPERTY IMAGE SIZE (OnePlus + Android fix) */
.property-gallery img {
  width: 100% !important;
  height: auto !important;
  min-height: 280px !important;
  max-height: 420px !important;
  object-fit: cover !important;
  border-radius: 20px;
}

/* 🔥 MOBILE IMAGE FIX */
@media (max-width: 768px) {
  .property-gallery img {
    min-height: 300px !important;
    max-height: 380px !important;
  }
}

/* 🔥 FIX GALLERY GRID */
.gallery-row {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

/* 🔥 FIX PROPERTY DETAIL LAYOUT */
@media (max-width: 1024px) {
  .property-detail {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
}

