/* =========================================================
   TierBoard — design tokens
   Palette (dark, default):
     --ink        #14151A  (near-black background)
     --panel      #1C1E26  (raised surfaces)
     --gold       #D8AA3F  (gold tier accent)
     --silver     #C7CDD6  (silver tier accent)
     --gray       #6B7280  (gray tier accent)
   Light theme overrides the neutrals only; tier accent colors stay put.
   Type: 'Oswald' + 'Inter' for Latin/Cyrillic; per-language fonts for
   Persian (Vazirmatn), Arabic (Noto Naskh Arabic), Chinese (Noto Sans SC).
   Signature element: the "Tier Meter" proportion bar (55/25/15)
   ========================================================= */

:root {
  --ink: #14151A;
  --panel: #1C1E26;
  --panel-2: #23252F;
  --gold: #D8AA3F;
  --gold-light: #F1D488;
  --gold-deep: #8C6A1E;
  --silver: #C7CDD6;
  --silver-light: #E8ECF1;
  --silver-deep: #767F8C;
  --gray: #6B7280;
  --gray-light: #9AA1AA;
  --gray-deep: #4B5058;
  --seller-green: #1E5631;
  --seller-green-light: #2E7D46;
  --seller-green-deep: #123A20;
  --text: #E7E6E1;
  --text-dim: #A6A8B0;
  --radius: 10px;

  --nav-bg: rgba(20, 21, 26, 0.92);
  --hairline-1: rgba(255,255,255,0.06);
  --hairline-2: rgba(255,255,255,0.10);
  --hairline-3: rgba(255,255,255,0.15);
  --overlay-hover: rgba(255,255,255,0.08);

  /* Turquoise gradient background */
  --bg-gradient: linear-gradient(160deg, #042f2e 0%, #0f766e 40%, #115e59 70%, #052e2b 100%);
}

/* ---------------- Light theme ---------------- */
[data-theme="light"] {
  --ink: #F3F1EA;
  --panel: #FFFFFF;
  --panel-2: #F1EFE7;
  --text: #1C1E26;
  --text-dim: #61646E;

  --nav-bg: rgba(243, 241, 234, 0.92);
  --hairline-1: rgba(20,21,26,0.08);
  --hairline-2: rgba(20,21,26,0.12);
  --hairline-3: rgba(20,21,26,0.18);
  --overlay-hover: rgba(20,21,26,0.06);

  --bg-gradient: linear-gradient(160deg, #99f6e4 0%, #2dd4bf 40%, #0d9488 75%, #99f6e4 100%);
}

* { box-sizing: border-box; }

body {
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.15s ease, color 0.15s ease;
}

h1, h2, h3, h4, .display-font {
  font-family: 'Oswald', system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

a { color: var(--gold-deep); }
[data-theme="dark"] a, :root:not([data-theme="light"]) a { color: var(--gold-light); }
a:hover { color: var(--gold); }

/* ---------------- Per-language typography ---------------- */

html[lang="fa"] body { font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif; }
html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3, html[lang="fa"] h4, html[lang="fa"] .display-font {
  font-family: 'Vazirmatn', sans-serif; font-weight: 600;
}

html[lang="ar"] body { font-family: 'Noto Naskh Arabic', 'Vazirmatn', sans-serif; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4, html[lang="ar"] .display-font {
  font-family: 'Noto Naskh Arabic', serif; font-weight: 700;
}

html[lang="zh"] body { font-family: 'Noto Sans SC', 'Inter', sans-serif; }
html[lang="zh"] h1, html[lang="zh"] h2, html[lang="zh"] h3, html[lang="zh"] h4, html[lang="zh"] .display-font {
  font-family: 'Noto Sans SC', sans-serif; font-weight: 700;
}

/* Uppercase + letter-spacing only make sense for Latin/Cyrillic caps */
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] h4,
html[dir="rtl"] .display-font, html[dir="rtl"] .navbar-brand,
html[lang="zh"] h1, html[lang="zh"] h2, html[lang="zh"] h3, html[lang="zh"] h4, html[lang="zh"] .display-font {
  text-transform: none;
  letter-spacing: 0;
}

/* ---------------- Navbar ---------------- */

.site-navbar {
  background: var(--nav-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline-1);
}

.navbar-brand {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text) !important;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark { display: inline-flex; gap: 3px; }
.brand-mark .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-gold { background: var(--gold); }
.dot-silver { background: var(--silver); }
.dot-gray { background: var(--gray); }

.brand-logo { height: 42px; width: auto; display: block; }

.site-navbar .nav-link { color: var(--text-dim); font-weight: 500; }
.site-navbar .nav-link:hover { color: var(--text); }

.navbar-toggler { border-color: var(--hairline-3); }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(231, 230, 225, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
[data-theme="light"] .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(28, 30, 38, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.btn-create {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, var(--gold-deep));
  color: #1a1200;
  font-weight: 600;
  border: none;
  padding: 0.4rem 0.9rem;
}
.btn-create:hover { color: #1a1200; filter: brightness(1.08); }

/* ---- Theme toggle + language switcher ---- */

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--hairline-3);
  color: var(--text);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.15s ease;
}
.theme-toggle-btn:hover { background: var(--overlay-hover); }

.lang-select-form { display: inline-block; }
.lang-select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--hairline-3);
  font-size: 0.8rem;
  padding: 0.3rem 0.5rem;
  width: auto;
}

/* ---------------- Hero ---------------- */

.hero {
  padding: 3.25rem 0 1.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto;
}

/* ---- Hero search box ---- */

.hero-search-form {
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin: 1.75rem auto 0;
  padding: 0 1rem;
}

.hero-search-input {
  flex: 1;
  border-radius: 999px;
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--hairline-3);
  background: var(--panel);
  color: var(--text);
}

.hero-city-select {
  border-radius: 999px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--hairline-3);
  background: var(--panel);
  color: var(--text);
  max-width: 150px;
  flex-shrink: 0;
}

.ad-time-badge {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.hero-search-input:focus {
  box-shadow: 0 0 0 3px rgba(216, 170, 63, 0.25);
  border-color: var(--gold);
}

.hero-search-btn {
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .hero-search-form { flex-direction: column; }
}

/* ---- Signature element: the Tier Meter ---- */

.tier-meter {
  max-width: 720px;
  margin: 2rem auto 0;
  padding: 0 1rem;
}

.tier-meter-bar {
  display: flex;
  direction: ltr;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--hairline-1);
}

.tier-meter-bar span { display: block; height: 100%; }
.meter-gold   { width: 55%; background: linear-gradient(90deg, var(--gold-deep), var(--gold-light)); }
.meter-silver { width: 25%; background: linear-gradient(90deg, var(--silver-deep), var(--silver-light)); }
.meter-gray   { width: 15%; background: linear-gradient(90deg, var(--gray-deep), var(--gray-light)); }

.tier-meter-labels {
  display: flex;
  direction: ltr;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
html[dir="rtl"] .tier-meter-labels { text-transform: none; letter-spacing: 0; }

/* ---------------- Category & price filter bar ---------------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--hairline-1);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-top: 1.5rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-pill {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--hairline-2);
  font-size: 0.82rem;
  color: var(--text-dim);
  background: var(--panel-2);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.filter-pill:hover { color: var(--text); border-color: var(--hairline-3); }
.filter-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1200;
  font-weight: 600;
}

.filter-price-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.filter-price-form input[type="number"] { width: 130px; }

.ad-category-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--hairline-2);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  margin-bottom: 0.4rem;
}
html[dir="rtl"] .ad-category-badge { text-transform: none; letter-spacing: 0; }

/* ---------------- Car-specific fields box (create/edit ad) ---------------- */

.car-fields-box {
  background: var(--panel-2);
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius);
  padding: 1rem;
}

.admin-super-links .btn { font-weight: 600; }

.admin-member-count {
  display: inline-block;
  font-weight: 600;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--hairline-3);
  border-radius: 999px;
  padding: 0.4rem 1rem;
}

/* ---------------- Ad board layout: always horizontal on tablet+ ---------------- */

.ad-board {
  display: flex;
  direction: ltr;             /* Gold → Silver → Gray always reads left to right */
  flex-wrap: nowrap;
  gap: 1.25rem;
  align-items: stretch;
  padding: 1.5rem 0 3rem;
}

.tier-column { display: flex; flex-direction: column; min-width: 0; direction: inherit; }
.tier-column[data-tier="gold"]   { flex: 0 0 55%; max-width: 55%; }
.tier-column[data-tier="silver"] { flex: 0 0 25%; max-width: 25%; }
.tier-column[data-tier="gray"]   { flex: 0 0 15%; max-width: 15%; }

/* Text inside each column still follows the page's real reading direction */
html[dir="rtl"] .tier-column { direction: rtl; text-align: right; }

/* Only stack vertically on narrow phones */
@media (max-width: 576px) {
  .ad-board { flex-wrap: wrap; }
  .tier-column[data-tier="gold"],
  .tier-column[data-tier="silver"],
  .tier-column[data-tier="gray"] {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* Between 576–760px, three columns get tight — shrink paddings/fonts a touch */
@media (max-width: 760px) {
  .ad-board { gap: 0.6rem; }
  .tier-header h2 { font-size: 0.95rem; }
  .tier-header .tier-pct { font-size: 0.68rem; }
}

.tier-header {
  display: flex;
  direction: inherit;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--hairline-2);
  gap: 0.5rem;
}

.tier-header h2 { font-size: 1.1rem; margin: 0; }
.tier-header .tier-pct { font-size: 0.8rem; color: var(--text-dim); white-space: nowrap; }

.tier-column[data-tier="gold"] .tier-header   { border-bottom-color: var(--gold); }
.tier-column[data-tier="silver"] .tier-header { border-bottom-color: var(--silver); }
.tier-column[data-tier="gray"] .tier-header   { border-bottom-color: var(--gray); }

.tier-column[data-tier="gold"] .tier-header h2   { color: var(--gold-deep); }
.tier-column[data-tier="silver"] .tier-header h2 { color: var(--silver-deep); }
.tier-column[data-tier="gray"] .tier-header h2   { color: var(--gray-deep); }
[data-theme="dark"] .tier-column[data-tier="gold"] .tier-header h2   { color: var(--gold-light); }
[data-theme="dark"] .tier-column[data-tier="silver"] .tier-header h2 { color: var(--silver-light); }
[data-theme="dark"] .tier-column[data-tier="gray"] .tier-header h2   { color: var(--gray-light); }

.ad-slot-list { display: flex; flex-direction: column; gap: 1rem; flex: 1; }

/* ---- Ad cards: styling intensity mirrors tier prominence ---- */

.ad-card {
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ad-card:hover { transform: translateY(-3px); color: var(--text); }
.ad-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.ad-card .ad-body { padding: 1rem 1.1rem 1.1rem; flex: 1; display: flex; flex-direction: column; }
.ad-card .ad-title { font-family: 'Oswald', sans-serif; font-weight: 600; margin-bottom: 0.35rem; text-transform: none; letter-spacing: 0; color: inherit; text-decoration: none; display: block; }
html[lang="fa"] .ad-card .ad-title { font-family: 'Vazirmatn', sans-serif; }
html[lang="ar"] .ad-card .ad-title { font-family: 'Noto Naskh Arabic', serif; }
html[lang="zh"] .ad-card .ad-title { font-family: 'Noto Sans SC', sans-serif; }
.ad-card .ad-price { font-weight: 700; font-size: 0.9rem; color: var(--gold-deep); margin-bottom: 0.35rem; }
[data-theme="dark"] .ad-card .ad-price { color: var(--gold-light); }
.tier-column[data-tier="gray"] .ad-card .ad-price { font-size: 0.78rem; margin-bottom: 0.1rem; }
.ad-card .ad-desc { color: var(--text-dim); font-size: 0.9rem; flex: 1; }
.ad-card .ad-img { width: 100%; object-fit: contain; display: block; background: #F3F1EA; }

.view-details-btn {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.6rem;
  background: transparent;
  border: 1px solid var(--hairline-3);
  color: var(--text);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}
.view-details-btn:hover { background: var(--overlay-hover); color: var(--text); }
.tier-column[data-tier="gray"] .view-details-btn { margin-top: 0.35rem; font-size: 0.7rem; padding: 0.2rem 0.55rem; }
.ad-card .ad-cta { font-size: 0.8rem; font-weight: 600; margin-top: 0.6rem; text-transform: uppercase; letter-spacing: 0.04em; }
html[dir="rtl"] .ad-card .ad-cta { text-transform: none; letter-spacing: 0; }

/* Gold: largest, glowing, most ornamented */
.tier-column[data-tier="gold"] .ad-card {
  border: 1px solid rgba(216,170,63,0.55);
  box-shadow: 0 0 0 1px rgba(216,170,63,0.12), 0 12px 28px -14px rgba(216,170,63,0.55);
}
.tier-column[data-tier="gold"] .ad-card::before {
  content: "★";
  position: absolute; top: 10px; inset-inline-end: 10px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1a1200; font-size: 0.7rem; font-weight: 700;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.tier-column[data-tier="gold"] .ad-card .ad-img { height: 190px; }
.tier-column[data-tier="gold"] .ad-card .ad-title { font-size: 1.15rem; }
.tier-column[data-tier="gold"] .ad-card .ad-cta { color: var(--gold-deep); }
[data-theme="dark"] .tier-column[data-tier="gold"] .ad-card .ad-cta { color: var(--gold-light); }

/* Silver: medium prominence */
.tier-column[data-tier="silver"] .ad-card {
  border: 1px solid rgba(199,205,214,0.45);
  box-shadow: 0 8px 20px -14px rgba(118,127,140,0.4);
}
.tier-column[data-tier="silver"] .ad-card .ad-img { height: 130px; }
.tier-column[data-tier="silver"] .ad-card .ad-title { font-size: 1rem; }
.tier-column[data-tier="silver"] .ad-card .ad-cta { color: var(--silver-deep); }
[data-theme="dark"] .tier-column[data-tier="silver"] .ad-card .ad-cta { color: var(--silver-light); }

/* Gray: compact, understated */
.tier-column[data-tier="gray"] .ad-card {
  border: 1px solid var(--hairline-1);
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem;
}
.tier-column[data-tier="gray"] .ad-card .ad-img { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 6px; }
.tier-column[data-tier="gray"] .ad-card .ad-body { padding: 0; }
.tier-column[data-tier="gray"] .ad-card .ad-title { font-size: 0.85rem; }
.tier-column[data-tier="gray"] .ad-card .ad-desc { font-size: 0.75rem; -webkit-line-clamp: 1; overflow: hidden; }
.tier-column[data-tier="gray"] .ad-card .ad-cta { display: none; }

.empty-slot {
  border: 1px dashed var(--hairline-3);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ---------------- Auth / form pages ---------------- */

.auth-wrap {
  max-width: 440px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.form-card {
  background: var(--panel);
  border: 1px solid var(--hairline-1);
  border-radius: var(--radius);
  padding: 2rem;
}

.form-card h1 { font-size: 1.4rem; margin-bottom: 1.5rem; }

/* Terms & rules modal — same width as the register/login form card */
.terms-modal-dialog { max-width: 440px; }
.terms-modal-body {
  max-height: 60vh;
  overflow-y: auto;
  white-space: pre-line;
  line-height: 1.9;
  font-size: 0.92rem;
}

/* On the standalone terms.php page (not the registration modal), let the
   text flow naturally instead of scrolling inside a short fixed box. */
.terms-page-card .terms-modal-body { max-height: none; overflow-y: visible; }

.form-control, .form-select {
  background: var(--panel-2);
  border: 1px solid var(--hairline-2);
  color: var(--text);
}
.form-control:focus, .form-select:focus {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--gold);
  box-shadow: 0 0 0 0.2rem rgba(216,170,63,0.2);
}
.form-control::placeholder { color: var(--text-dim); }
.form-label { color: var(--text-dim); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
html[dir="rtl"] .form-label { text-transform: none; letter-spacing: 0; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, var(--gold-deep));
  color: #1a1200; font-weight: 600; border: none;
}
.btn-gold:hover { color: #1a1200; filter: brightness(1.08); }

/* ---------------- Admin table ---------------- */

.admin-panel { padding: 2rem 0 4rem; }
.admin-table-wrap {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--hairline-1);
  overflow-x: auto;
}
.table { color: var(--text); margin: 0; }
.table thead th {
  border-bottom: 1px solid var(--hairline-2);
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
html[dir="rtl"] .table thead th { text-transform: none; letter-spacing: 0; }
.table td { border-color: var(--hairline-1); vertical-align: middle; }

.btn-outline-light { color: var(--text); border-color: var(--hairline-3); }
.btn-outline-light:hover { background: var(--overlay-hover); color: var(--text); border-color: var(--hairline-3); }

.badge-tier-gold { background: var(--gold); color: #1a1200; }
.badge-tier-silver { background: var(--silver); color: #1a1200; }
.badge-tier-gray { background: var(--gray); color: #fff; }
.badge-status-pending { background: #3a3f4d; color: #cfd2db; }
.badge-status-active { background: #2f7d4f; color: #fff; }
.badge-status-rejected { background: #7d2f2f; color: #fff; }
.badge-status-expired { background: #4b5058; color: #d8d8d8; }

/* ---------------- Footer ---------------- */

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--hairline-1);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-tiers { direction: ltr; unicode-bidi: isolate; }
.footer-tiers .swatch {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 2px;
  margin: 0 5px 0 12px;
}
.footer-tiers .swatch:first-child { margin-left: 0; }
.swatch-gold { background: var(--gold); }
.swatch-silver { background: var(--silver); }
.swatch-gray { background: var(--gray); }

.footer-credit strong { color: var(--text); }
.footer-terms-link { color: var(--text-dim); text-decoration: underline; }
.footer-terms-link:hover { color: var(--gold); }

/* ---------------- Footer contact / social icons ---------------- */

.footer-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline-1);
}

.footer-contact-label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

.footer-contact-icons {
  display: flex;
  gap: 10px;
}

.contact-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff !important;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.contact-icon:hover { transform: translateY(-2px); opacity: 0.9; }

.contact-icon-phone { background: #123A20; }       /* dark green */
.contact-icon-whatsapp { background: #25D366; }     /* light green */
.contact-icon-instagram {
  background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}
.contact-icon-tiktok { background: #000; }

.footer-trust-badges {
  display: flex;
  align-items: center;
}
.footer-trust-badges img {
  height: 72px;
  width: auto;
  border-radius: 6px;
  background: #fff;
  padding: 2px;
}

/* ---------------- PWA install button ---------------- */

.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold) !important;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.pwa-install-btn:hover { background: var(--gold); color: #1a1a1a !important; }

.pwa-install-nav-btn {
  background: transparent;
  border: none;
  color: var(--gold);
  font-weight: 600;
  cursor: pointer;
}
.pwa-install-nav-btn:hover { color: var(--gold-deep); }
[data-theme="dark"] .pwa-install-nav-btn:hover { color: var(--gold-light); }

.install-page-card { max-width: 100%; }
.install-os-block {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--hairline-1);
  background: var(--panel-2);
}
.install-os-block.install-os-highlight {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}
.install-steps { white-space: pre-line; color: var(--text-dim); }

/* ---------------- Admin notification bell ---------------- */

.notif-bell {
  position: relative;
  background: none;
  border: none;
  font-size: 1.15rem;
  line-height: 1;
  padding: 6px 8px;
  color: var(--text);
  cursor: pointer;
}

.notif-badge {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  background: #d64545;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.notif-dropdown {
  width: 320px;
  max-width: 90vw;
  max-height: 380px;
  overflow-y: auto;
  padding: 4px 0;
  direction: rtl;
  text-align: right;
}

.notif-item {
  font-size: 0.85rem;
  border-bottom: 1px solid var(--hairline-1);
}
.notif-item:last-child { border-bottom: none; }
.notif-unread { background: rgba(216, 170, 63, 0.08); }

.notif-time {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ---------------- Custom "Upload image" button (replaces native "Choose File") ---------------- */

.custom-file-upload {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.custom-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.custom-file-btn { cursor: pointer; white-space: nowrap; }
.custom-file-name {
  font-size: 0.85rem;
  color: var(--text-dim);
  word-break: break-all;
}
.custom-file-name:empty::before { content: attr(data-empty); }

/* ---------------- Dynamic "add photo" rows (create/edit ad) ---------------- */

.extra-photo-row .form-control { flex: 1; }
.extra-photo-remove {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  line-height: 1;
  font-size: 1.1rem;
}

.edit-current-photo { display: flex; align-items: center; gap: 0.75rem; }
.edit-current-photo img { width: 90px; height: 90px; object-fit: contain; background: #F3F1EA; border-radius: 6px; }

.edit-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.6rem;
}
.edit-gallery-item { text-align: center; }
.edit-gallery-item img { width: 100%; height: 80px; object-fit: contain; background: #F3F1EA; border-radius: 6px; display: block; }

.edit-remove-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
  cursor: pointer;
}
.edit-remove-check input { cursor: pointer; }

/* ---------------- Ad details modal ---------------- */

.ad-modal-content {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--hairline-2);
}
.ad-modal-content .modal-header,
.ad-modal-content .modal-footer {
  border-color: var(--hairline-1);
}
[data-theme="light"] .ad-modal-content .btn-close { filter: none; }
[data-theme="dark"] .ad-modal-content .btn-close { filter: invert(1) grayscale(1); }

.ad-modal-carousel { border-radius: var(--radius); overflow: hidden; background: var(--panel); text-align: center; }
.ad-modal-carousel .carousel-item img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  display: block;
}
.ad-modal-carousel .carousel-indicators { margin-bottom: 0.5rem; }

.ad-modal-desc { color: var(--text-dim); white-space: pre-line; }

.ad-modal-meta { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.75rem; }
.ad-modal-meta-row { font-size: 0.92rem; }
.ad-modal-meta-row strong { color: var(--text-dim); font-weight: 600; }

/* Chat-with-seller / contact-info buttons + the revealed contact panel — dark green */
.btn-chat-seller,
.btn-contact-info {
  background: linear-gradient(135deg, var(--seller-green-light), var(--seller-green) 60%, var(--seller-green-deep));
  color: #EAF6EE;
  font-weight: 600;
  border: none;
}
.btn-chat-seller:hover,
.btn-contact-info:hover {
  color: #EAF6EE;
  filter: brightness(1.1);
}

.ad-modal-contact-panel {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
  padding: 0.6rem 0.9rem;
  background: rgba(30, 86, 49, 0.12);
  border: 1px solid var(--seller-green);
  border-radius: var(--radius);
  font-size: 0.92rem;
}
.ad-modal-contact-label { color: var(--text-dim); font-weight: 600; }
.ad-modal-contact-value { color: var(--text); font-weight: 600; }
.ad-modal-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-inline-start: auto;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--seller-green-light), var(--seller-green) 60%, var(--seller-green-deep));
  color: #EAF6EE;
  flex-shrink: 0;
}
.ad-modal-call-btn:hover { color: #EAF6EE; filter: brightness(1.1); }

.ad-modal-report-panel {
  margin-top: 0.9rem;
  padding: 0.75rem 0.9rem;
  background: rgba(183, 38, 27, 0.08);
  border: 1px solid #B7261B;
  border-radius: var(--radius);
}

/* ---------------- Jobs & recruitment section ---------------- */

.jobs-section { margin-top: 2.5rem; }
.jobs-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--seller-green);
  padding-bottom: 0.6rem;
  margin-bottom: 1.2rem;
}
.jobs-section-header h2 { margin: 0; color: var(--seller-green-light); }
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

/* ---------------- Single-ad SEO detail page (ad.php) ---------------- */

.ad-detail-page .breadcrumb {
  background: transparent;
  padding: 0;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}
.ad-detail-page .breadcrumb-item + .breadcrumb-item::before { color: var(--text-dim); }
.ad-detail-page .breadcrumb-item.active { color: var(--text-dim); }

.ad-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
@media (max-width: 760px) {
  .ad-detail-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}

.ad-detail-gallery { background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.ad-detail-single-img { width: 100%; max-height: 480px; object-fit: contain; display: block; background: var(--panel); }
.ad-detail-gallery .ad-modal-carousel .carousel-item img { max-height: 480px; }

.ad-detail-title { font-size: 1.6rem; margin-bottom: 0.5rem; }
.ad-detail-price { font-weight: 700; font-size: 1.35rem; color: var(--gold-deep); margin-bottom: 0.5rem; }
[data-theme="dark"] .ad-detail-price { color: var(--gold-light); }

.ad-detail-actions { border-top: 1px solid var(--hairline-2); padding-top: 1rem; }

.similar-ads-section { margin-top: 3rem; }

/* ---------------- Chat bubbles (shared: full inbox page + popup) ---------------- */

.chat-bubble {
  max-width: 78%;
  margin-bottom: 0.6rem;
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  clear: both;
}
.chat-bubble-mine {
  background: var(--gold);
  color: #1a1300;
  margin-inline-start: auto;
  border-bottom-right-radius: 4px;
}
[data-theme="dark"] .chat-bubble-mine { color: #1a1300; }
.chat-bubble-theirs {
  background: var(--panel-2, var(--panel));
  border: 1px solid var(--hairline-2);
  margin-inline-end: auto;
  border-bottom-left-radius: 4px;
}
.chat-bubble-body { white-space: pre-wrap; word-break: break-word; font-size: 0.92rem; }
.chat-bubble-time { font-size: 0.68rem; opacity: 0.65; margin-top: 3px; text-align: end; }

/* ---------------- Full chat inbox page (chat.php) ---------------- */

.chat-page { padding: 2rem 0 4rem; }
.chat-layout {
  display: flex;
  gap: 1rem;
  min-height: 60vh;
  border: 1px solid var(--hairline-1);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.chat-thread-list {
  flex: 0 0 280px;
  border-inline-end: 1px solid var(--hairline-1);
  overflow-y: auto;
  max-height: 70vh;
}
.chat-thread-item {
  display: block;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--hairline-2);
  color: var(--text);
  text-decoration: none;
}
.chat-thread-item:hover, .chat-thread-item.active { background: var(--hairline-2); }
.chat-thread-top { display: flex; justify-content: space-between; align-items: center; }
.chat-thread-name { font-weight: 600; }
.chat-unread-badge {
  background: var(--gold);
  color: #1a1300;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}
.chat-thread-ad { font-size: 0.78rem; color: var(--text-dim); margin: 2px 0; }
.chat-thread-preview { font-size: 0.82rem; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-thread-view { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-thread-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--hairline-1);
}
.chat-thread-header-name { font-weight: 700; }
.chat-thread-header-ad { font-size: 0.8rem; color: var(--text-dim); }
.chat-back-link { color: var(--text-dim); text-decoration: none; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; }
.chat-compose { display: flex; gap: 0.6rem; padding: 0.9rem 1.1rem; border-top: 1px solid var(--hairline-1); }
.chat-compose textarea { flex: 1; resize: none; }

/* ---------------- Compact "chat with seller" popup (index.php) ---------------- */

.chat-modal-dialog { max-width: 440px; }
.chat-modal-content { height: 78vh; max-height: 620px; display: flex; flex-direction: column; }
.chat-modal-messages {
  flex: 7 1 0;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-modal-input {
  flex: 2 1 0;
  padding: 0 1rem;
  display: flex;
  min-height: 0;
}
.chat-modal-input textarea {
  width: 100%;
  height: 100%;
  resize: none;
}
.chat-modal-actions {
  flex: 1 1 0;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--hairline-1);
}
.chat-modal-send-btn {
  flex: 1;
  background: #1E8E3E;
  border-color: #1E8E3E;
  color: #fff;
  font-weight: 600;
}
.chat-modal-send-btn:hover { background: #187530; border-color: #187530; color: #fff; }
.chat-modal-cancel-btn {
  flex: 1;
  background: #D93025;
  border-color: #D93025;
  color: #fff;
  font-weight: 600;
}
.chat-modal-cancel-btn:hover { background: #B7261B; border-color: #B7261B; color: #fff; }
