/* ================================
   EXPLORE ALL PAGE STYLES
   (cleaned / organized)
   ================================ */

/* --- Variables --- */
:root {
  --primary: #9a8f2f;
  --gold: #908220;
  /* icon color requested */
  --text: #15202b;
  --muted: #6b7280;
  --bg: #ffffff;
  --card-bg: #ffffff;
  --radius: 12px;
}

/* --- Reset / base --- */
* {
  box-sizing: border-box
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial;
}

/* ===== Filter bar ===== */
.filter-bar {
  background: #000;
}

.filter-form {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  background-color: #908220;
  padding: 5px;
  align-items: center;
  height: 60px;
}

.filter-field {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
}

.filter-field i {
  margin-right: 8px;
  color: var(--primary)
}

.filter-field select {
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  width: 100%;
  cursor: pointer;
}

/* ===== All properties ===== */
.all-properties {
  padding: 30px  50px;
  background: var(--bg);
}

.section-title {
  font-family: "Playfair Display", serif;
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 18px;
}
/* Grid */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-top: 30px;
  justify-items: center;
  align-items: start;
}

/* Card */
.property-card {
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  width: 80%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  margin-bottom: 32px;
}

.property-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.property-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.property-info {
  padding: 14px 16px;
  color: #444;
  font-size: 14px;
}

.property-info p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.property-details {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  color: #666;
  flex-wrap: wrap;
}

.property-details p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #444;
}

.property-details i,
.property-info i {
  color: var(--gold);
  padding: 10px;
}

/* View button */
.view-btn {
  margin: 12px 16px 16px;
  padding: 10px 0;
  background: var(--primary, #003366);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

 .view-btn:hover {
  background: grey;
}

/* ==========================
   MODAL (popup) - blurred background
   ========================== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}

.modal[aria-hidden="false"] {
  display: flex;
}

/* overlay blur layer */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* modal panel */
.modal-panel {
  position: relative;
  width: 95%;
  max-width: 1100px;
  margin: auto;
  z-index: 1300;
  transform: translateY(20px) scale(.98);
  opacity: 0;
  transition: all 260ms ease;
  will-change: transform, opacity;
}

.modal[aria-hidden="false"] .modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* close button */
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1400;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #333;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(0,0,0,0.1);
  border-radius: 50%;
}

/* panel inner card */
.modal-inner {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 24px;
}

/* layout inside modal: left & right */
.modal-inner {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.modal-left {
  flex: 1 1 56%;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-right {
  flex: 1 1 36%;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* main image + info */
.modal-main-image {
  background: #f5f5f5;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.modal-main-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* info under main image */
.modal-info h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.8rem;
  color: var(--text);
}

.modal-location {
  margin: 6px 0 10px 0;
  color: #666;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-desc {
  color: #444;
  line-height: 1.6;
}

/* thumbnails: laid out row with two per row (wrap) */
.modal-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-thumb {
  width: calc(50% - 10px);
  min-height: 80px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.modal-thumb:hover {
  transform: scale(1.05);
  border-color: var(--primary);
}

.modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* agent card under thumbnails */
.agent-card-modal {
  margin-top: 10px;
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.agent-card-modal h4 {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.agent-card-modal h3 {
  margin: 0 0 6px 0;
  font-size: 1.05rem;
}

.agent-card-modal p {
  margin: 0 0 8px 0;
  color: #666;
  font-size: 0.95rem;
}

.agent-card-modal textarea {
  width: 100%;
  resize: vertical;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #e6e6e6;
  margin-top: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.agent-card-modal textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.agent-card-modal .send-btn {
  margin-top: 10px;
  width: 100%;
  padding: 12px;
  background: var(--primary);
  border: none;
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.3s ease;
}

.agent-card-modal .send-btn:hover {
  background: var(--gold);
}

.agent-card-modal .send-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Contact Form Modal Styles */
#contact-form-modal {
  z-index: 1500; /* Higher than property modal */
}

#contact-form-modal .modal-inner {
  max-width: 500px;
  width: 90%;
  margin: 20px;
}

#contact-form-modal h2 {
  margin-bottom: 25px;
  font-family: "Playfair Display", serif;
  text-align: center;
  color: var(--text);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
  font-family: inherit;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(154, 143, 47, 0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 25px;
}

.btn-secondary {
  padding: 12px 24px;
  background: #f5f5f5;
  color: var(--text);
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  cursor: pointer;
  flex: 1;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 14px;
}

.btn-secondary:hover {
  background: #e8e8e8;
}

.send-contact-btn {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  flex: 1;
  transition: background 0.3s ease;
  font-weight: 600;
  font-size: 14px;
}

.send-contact-btn:hover {
  background: var(--gold);
}

.send-contact-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ==========================
   LANGUAGE SELECTOR STYLES
   ========================== */
.language-selector {
    margin-left: 20px;
}

.language-selector select {
    padding: 8px 12px;
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector select:hover {
    border-color: var(--primary);
}

.language-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(154, 143, 47, 0.1);
}

/* ==========================
   RTL SUPPORT FOR ARABIC
   ========================== */
html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .property-info {
    text-align: right;
    margin-right: 20px;
    margin-left: 0;
}

html[dir="rtl"] .property-details {
    margin-right: 20px;
    margin-left: 0;
}
/* Add this to your existing CSS */
#contact-form-modal {
    display: none;
    z-index: 2000;
}

#contact-form-modal .modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

#contact-form-modal .modal-panel {
    z-index: 2001;
}


html[dir="rtl"] .filter-field i {
    margin-right: 0;
    margin-left: 8px;
}

html[dir="rtl"] .modal-close {
    right: auto;
    left: 10px;
}

html[dir="rtl"] .modal-location {
    justify-content: flex-end;
}

html[dir="rtl"] .agent-card-modal {
    text-align: right;
}

/* ==========================
   RESPONSIVE STYLES
   ========================== */

/* responsive adjustments of grid */
@media (max-width:1100px) {
  .properties-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
  }
  
  .property-card {
    width: 90%;
  }
}

@media (max-width:800px) {
  .properties-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .property-card {
    width: 95%;
  }
}

@media (max-width:480px) {
  .properties-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .property-card {
    width: 100%;
  }
}

/* Small screens: stack nicely */
@media (max-width:900px) {
  .modal-inner {
    padding: 18px;
  }

  .modal-left,
  .modal-right {
    flex: 1 1 100%;
    min-width: 0;
  }

  .modal-main-image {
    min-height: 220px;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .language-selector {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .language-selector select {
        width: 100%;
    }
    
    html[dir="rtl"] .property-info {
        margin-right: 10px;
    }
    
    html[dir="rtl"] .property-details {
        margin-right: 10px;
    }
}

/* ==========================
   EXPLORE PAGE MOBILE FIXES
   ========================== */

@media (max-width: 768px) {
  /* Filter bar - stack vertically */
  .filter-form {
    flex-direction: column;
    height: auto;
    padding: 15px;
    gap: 12px;
  }
  
  .filter-field {
    width: 100%;
    justify-content: flex-start;
  }
  
  /* Properties grid adjustment */
  .properties-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .property-card {
    width: 100%;
    margin-bottom: 20px;
  }
  
  /* Modal mobile optimization */
  .modal-panel {
    width: 98%;
    margin: 10px;
  }
  
  .modal-inner {
    padding: 15px;
    flex-direction: column;
  }
  
  .modal-left,
  .modal-right {
    flex: 1 1 100%;
    min-width: 0;
  }
  
  .modal-main-image {
    min-height: 200px;
  }
  
  /* Language selector mobile */
  .language-selector {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
  }
  
  .language-selector select {
    width: 100%;
  }
  
  /* Contact form modal mobile */
  #contact-form-modal .modal-inner {
    margin: 10px;
    padding: 20px;
  }
  
  .form-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  /* Small mobile devices */
  .properties-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .all-properties {
    padding: 20px 15px;
  }
  
  .property-info {
    padding: 12px;
  }
  
  .property-details {
    flex-direction: column;
    gap: 8px;
  }
  
  /* Modal thumbnails - single column */
  .modal-thumb {
    width: 100%;
  }
  
  /* Contact form adjustments */
  #contact-form-modal .modal-inner {
    padding: 15px;
  }
}

/* CRITICAL FIXES FOR CONTACT MODAL */
#contact-form-modal {
    display: none !important;
    z-index: 9999 !important;
}

#contact-form-modal[style*="display: flex"] {
    display: flex !important;
}

#contact-form-modal .modal-overlay {
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: 10000 !important;
}

#contact-form-modal .modal-panel {
    z-index: 10001 !important;
    transform: none !important;
    opacity: 1 !important;
}

/* Ensure property modal stays behind */
#property-modal {
    z-index: 100 !important;
}

#property-modal .modal-panel {
    z-index: 101 !important;
}

#property-modal .modal-overlay {
    z-index: 99 !important;
}