:root {
  --primary:    #1a6b4a;
  --primary-d:  #145538;
  --primary-l:  #e8f5ef;
  --secondary:  #557e6e;
  --secondary-d:#3b6957;
  --accent:     #e63946;
  --bg:         #f4f6f9;
  --surface:    #ffffff;
  --surface-2:  #f8fafc;
  --text:       #1a1a2e;
  --text-2:     #4a5568;
  --muted:      #8a95a3;
  --border:     #e2e8f0;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow:     0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.14);
  --radius-sm:  8px;
  --radius:     14px;
  --radius-lg:  22px;
  --font-main:  'Noto Sans Arabic', 'Segoe UI', system-ui, sans-serif;
  --transition: .22s cubic-bezier(.4,0,.2,1);
  --success:    #22c55e;
  --warning:    #f59e0b;
  --danger:     #ef4444;
  --info:       #3b82f6;
}
/* ====================================================
   RESET & BASE
   ==================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.7;
  min-height: 100vh;
}
img { display: block; max-width: 100%; }
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }
input, textarea, select, button { font-family: inherit; }

/* ====================================================
   LAYOUT
   ==================================================== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

/* ====================================================
   NAVBAR
   ==================================================== */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary);
}
.nav-logo span { color: var(--secondary); }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a {
  color: var(--text-2);
  font-weight: 500;
  padding: .4rem .2rem;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--primary); border-color: var(--primary); }
.nav-cta { display: flex; gap: .75rem; }

/* ====================================================
   BUTTONS
   ==================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .625rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,107,74,.3); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-d); transform: translateY(-1px); }
.btn-outline   { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-l); }
.btn-ghost     { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-sm  { padding: .4rem 1rem; font-size: .875rem; }
.btn-lg  { padding: .85rem 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }

/* ====================================================
   HERO
   ==================================================== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0f4a32 100%);
  color: #fff;
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; margin-bottom: 1rem; position: relative; }
.hero p  { font-size: 1.15rem; opacity: .88; margin-bottom: 2rem; position: relative; }
/* Search Bar */
.search-bar {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  max-width: 820px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.search-bar select,
.search-bar input {
  flex: 1;
  min-width: 150px;
  padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: .95rem;
  transition: var(--transition);
}
.search-bar select:focus,
.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,107,74,.15);
}

/* ====================================================
   STATS BAR
   ==================================================== */
.stats-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.2rem 0;
}
.stats-inner { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; }
.stat-item   { text-align: center; }
.stat-num    { font-size: 1.75rem; font-weight: 800; color: var(--primary); }
.stat-label  { font-size: .8rem; color: var(--muted); }

/* ====================================================
   PROPERTY CARD
   ==================================================== */
.property-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
}
.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.card-img {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg);
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.property-card:hover .card-img img { transform: scale(1.05); }
.card-badge {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: var(--primary);
  color: #fff;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
}
.card-badge.rent    { background: var(--info); }
.card-badge.daily   { background: var(--warning); color: var(--text); }
.card-save {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: rgba(255,255,255,.9);
  border: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  transition: var(--transition);
}
.card-save:hover { background: var(--accent); color: #fff; }
.card-body   { padding: 1rem; }
.card-price  { font-size: .8rem; font-weight: 800; color: var(--primary); margin-bottom: .35rem; }
.card-title  { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-loc    { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .3rem; margin-bottom: .75rem; }
.card-meta   { display: flex; gap: 1rem; font-size: .82rem; color: var(--text-2); border-top: 1px solid var(--border); padding-top: .75rem; }
.card-meta span { display: flex; align-items: center; gap: .3rem; }
.match-badge {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-d));
  color: #fff;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
}
/* ====================================================
   FORMS
   ==================================================== */
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
  max-width: 520px;
  margin: 2rem auto;
}
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: .4rem; color: var(--text-2); }
.form-control {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(26,107,74,.12);
}
.form-control.error { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: .82rem; margin-top: .3rem; }
.form-hint  { color: var(--muted); font-size: .82rem; margin-top: .3rem; }
textarea.form-control { min-height: 120px; resize: vertical; }

/* ====================================================
   ALERTS / FLASH
   ==================================================== */
.alert {
  padding: .9rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
/* ====================================================
   MATCH SECTION
   ==================================================== */
.match-section {
  background: linear-gradient(135deg, var(--secondary-d), #b4dfce);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 2rem;
}
.match-section h3 { color: #fff; margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem; }
.match-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
/* ====================================================
   SECTION HEADERS
   ==================================================== */
.section-header { text-align: center; margin-bottom: 2.5rem; }
.section-header h2 { font-size: 1.9rem; font-weight: 800; margin-bottom: .5rem; }
.section-header p  { color: var(--muted); }
.section-line { width: 60px; height: 4px; background: var(--primary); border-radius: 2px; margin: .75rem auto 0; }

/* ====================================================
   TABS
   ==================================================== */
.tabs { display: flex; gap: .5rem; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab-btn {
  padding: .65rem 1.5rem;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.tab-btn.active { color: var(--primary); border-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ====================================================
   IMAGE UPLOAD PREVIEW
   ==================================================== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--primary); background: var(--primary-l); }
.img-preview-grid { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.img-preview-item {
  position: relative;
  width: 100px; height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.img-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.img-preview-item .remove-img {
  position: absolute;
  top: 2px; left: 2px;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: .75rem;
  cursor: pointer;
  display: grid; place-items: center;
}
/* ====================================================
   FOOTER
   ==================================================== */
.footer {
  background: var(--text);
  color: rgba(255,255,255,.8);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; text-align: center;}
.footer-brand h3 { color: #fff; font-size: 1.3rem; margin-bottom: .75rem; }
.footer-links h4 { color: #fff; margin-bottom: .75rem; font-size: .95rem; }
.footer-links a  { display: block; margin-bottom: .4rem; font-size: .88rem; opacity: .75; transition: var(--transition); }
.footer-links a:hover { opacity: 1; color: var(--secondary); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.25rem; text-align: center; font-size: .85rem; opacity: .65; }
#menuToggle { display: none; }
.nav-cta-mobile { display: none; }
.menu-close {
    display: none;
    position: absolute;
    top: 1.2rem;
    left: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted);
    line-height: 1;
}
/* MATCH BODY */
.match-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    padding: 1.25rem;
    align-items: center;
}
/* STATIC PAGES */
.page-content h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.75rem 0 .6rem;
    color: var(--text);
}
.page-content p, .page-content li {
    color: var(--muted);
    line-height: 1.9;
    margin-bottom: .5rem;
}
.page-content ul {
    padding-right: 1.5rem;
    margin-bottom: 1rem;
}
.page-content a { color: var(--primary); }

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 992px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .menu-close { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-links.open { 
    display: flex; 
    flex-direction: column; 
    position: fixed; 
    inset: 0; 
    background: var(--surface); 
    z-index: 999; 
    justify-content: center; 
    align-items: center; 
    gap: 2rem;
    padding: 2rem;
    overflow-y: auto;
  }
  .footer-grid { grid-template-columns: 1fr; }
  .stats-inner { gap: 1.5rem; }
  #menuToggle { display: inline-flex; }
  .nav-cta .btn:not(#menuToggle) { display: none; }
  .nav-links.open > a { 
    font-size: 1.3rem; 
    font-weight: 700;
    padding: .5rem 1rem;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid var(--border);
  }
  .nav-cta-mobile { 
    display: flex; 
    gap: 1rem; 
    width: 100%;
    max-width: 280px;
    align-items: stretch;
    margin-bottom: .5rem;
  }
  .nav-cta-mobile .btn {
    width: 100%;
    gap: 1rem; 
    margin-bottom: .5rem;
    text-align: center;
    padding: .75rem 1rem !important;
    font-size: 1rem !important;
    justify-content: center;
    display: block;
    color: #fff;
  }
  .match-body {
      grid-template-columns: 1fr;
      text-align: right;
  }
  .match-body > div:nth-child(2) {
      order: 2;
      font-size: 1.8rem;
      transform: rotate(90deg);
  }
  .match-body > a:first-child {
      order: 1;
      justify-content: right;
  }
  .match-body > a:last-child {
      order: 3;
      flex-direction: row !important;
      justify-content: right;
      text-align: right !important;
  }
  .match-body > a:last-child > div {
      text-align: right !important;
  }
  .match-body [style*="max-width:200px"] {
      max-width: 100% !important;
      white-space: normal !important;
  }
  .pagess {
      margin-left: 20px;
      margin-right: 20px;
  }
}
/* ====================================================
   UTILITIES
   ==================================================== */
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.text-primary { color: var(--primary); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: .5rem;  } .mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem;  } .mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; } .align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.badge { display: inline-block; padding: .2rem .65rem; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning {
  background: #a1dac3;
  color: #287052;}
.badge-danger  { background: #fee2e2; color: #991b1b; }
.skeleton { background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (max-width: 768px) {
    .offer-layout {
        grid-template-columns: 1fr !important;
    }
    .offer-layout > div:last-child {
        position: static !important;
        order: 2;
    }
    .offer-layout > div:first-child {
        order: 1;
    }
}