/* ===========================
   Kurdistan Modern UI Theme
   Colors: Black, Red, White, Yellow, Green
   =========================== */

:root {
  /* Flag palette */
  --k-black: #0b0d12;
  --k-red: #e2181a;
  --k-white: #ffffff;
  --k-yellow: #f6c90e;
  --k-green: #1bb34f;

  /* Base semantic */
  --bg: #0b0d12;          /* dark default (we toggle to light via .theme-light) */
  --bg-elev: #121521;
  --card: #141827;
  --text: #e9eef7;
  --muted: #9aa3b2;
  --border: rgba(255,255,255,.08);

  /* Accents */
  --primary: var(--k-green);
  --secondary: var(--k-red);
  --accent: var(--k-yellow);

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.2);
  --shadow: 0 6px 18px rgba(0,0,0,.25);
  --shadow-lg: 0 16px 40px rgba(0,0,0,.35);
  --radius: 14px;
  --radius-lg: 18px;
  --trans: .2s cubic-bezier(.2,.6,.2,1);

  /* Sizing */
  --container: 1180px;
}

.theme-light {
  --bg: #fafafa;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(2,6,23,.08);
  --shadow: 0 8px 30px rgba(2,6,23,.08);
  --shadow-lg: 0 18px 50px rgba(2,6,23,.1);
}


/* ---- Mobile compatibility & anti-zoom tweaks ---- */
html {
  /* prevent iOS font auto-boosting that causes unexpected zoom jumps */
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

/* Safe-area (notch) padding */
:root{
  --safe-top: env(safe-area-inset-top);
  --safe-right: env(safe-area-inset-right);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
}
.navbar { padding-top: calc(var(--safe-top, 0px)); padding-left: var(--safe-left, 0px); padding-right: var(--safe-right, 0px); }
.mobile-menu { padding-bottom: calc(12px + var(--safe-bottom, 0px)); }
.footer-bottom { padding-bottom: calc(14px + var(--safe-bottom, 0px)); }

/* Images/videos never overflow the viewport */
img, svg, video, canvas { max-width: 100%; height: auto; }

/* Make tap targets large enough since zoom is disabled */
a, button, .btn, .nav-link, .icon-btn { min-height: 44px; }
.icon-btn { width: 44px; height: 44px; }

/* Inputs at least 16px on phones to stop iOS from zooming into fields */
@media (max-width: 860px){
  input, select, textarea { font-size: 16px; line-height: 1.4; }
}

/* Prevent 300ms & double-tap zoom side-effects on many browsers */
a, button, input[type="button"], input[type="submit"] { touch-action: manipulation; }

/* Long words/usernames don’t break the layout on tiny screens */
* { overflow-wrap: anywhere; }






/* Generic resets */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  font-family: "Inter", "Noto Sans Arabic", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 100% -10%, rgba(27,179,79,.12), transparent 60%),
              radial-gradient(1000px 600px at -10% -20%, rgba(226,24,26,.12), transparent 60%),
              var(--bg);
}
[dir="rtl"] body { font-family: "Noto Sans Arabic","Inter",system-ui; }

.no-js .dropdown-menu { display: none; }

/* Containers */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 16px;
}

/* Skip link */
.skip-link {
  position: absolute; inset-inline-start: 8px; top: -40px;
  background: var(--k-yellow); color: #000; padding: 8px 12px;
  border-radius: 8px; text-decoration: none; font-weight: 700;
  transition: top var(--trans);
  z-index: 9999;
}
.skip-link:focus { top: 8px; }

/* Flag bar */
.flag-bar { display: grid; grid-template-rows: 4px 6px 4px; }
.flag-stripe { width: 100%; }
.flag-stripe.red { background: var(--k-red); }
.flag-stripe.white { background: var(--k-white); position: relative; }
.flag-stripe.green { background: var(--k-green); }
.flag-stripe .sunburst {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 18px; height: 18px; background: var(--k-yellow); border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(246,201,14,.25);
}

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(1.2) blur(10px);
  background: color-mix(in oklab, var(--bg-elev) 85%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-row {
  display: flex; align-items: center; gap: 12px; min-height: 68px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo:hover .logo-text { opacity: .9; }
.logo-mark { width: 34px; height: 34px; filter: drop-shadow(0 2px 10px rgba(246,201,14,.35)); }
.logo-text { font-weight: 800; letter-spacing: .2px; }
.logo-dot { color: var(--k-red); margin-inline: 2px; }

.nav-search { flex: 1; max-width: 560px; }
.nav-search form { position: relative; }
.nav-search input{
  width: 100%; height: 44px;
  background: color-mix(in oklab, var(--bg) 80%, var(--k-white) 20%);
  border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: 10px 44px 10px 14px; outline: none;
  transition: border var(--trans), box-shadow var(--trans);
}
[dir="rtl"] .nav-search input{ padding: 10px 14px 10px 44px; }
.nav-search input:focus{
  border-color: color-mix(in oklab, var(--primary) 70%, var(--text) 30%);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 25%, transparent);
}
.nav-search button{
  position: absolute; right: 6px; top: 50%; translate: 0 -50%;
  background: transparent; border: 0; color: var(--muted);
  border-radius: 10px; width: 36px; height: 36px; cursor: pointer;
}
[dir="rtl"] .nav-search button{ right: auto; left: 6px; }

.nav-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.nav-link {
  text-decoration: none; color: var(--text); opacity: .9;
  padding: 8px 12px; border-radius: 10px; border: 1px solid transparent;
  transition: background var(--trans), border var(--trans), transform var(--trans);
}
.nav-link:hover { background: color-mix(in oklab, var(--bg-elev) 85%, transparent); border-color: var(--border); }
.icon-btn {
  border: 1px solid var(--border); background: color-mix(in oklab, var(--bg-elev) 85%, transparent);
  color: var(--text); border-radius: 12px; width: 40px; height: 40px; display: grid; place-items: center;
  cursor: pointer; transition: transform var(--trans), background var(--trans), border var(--trans);
}
.icon-btn:hover { transform: translateY(-1px); border-color: color-mix(in oklab, var(--text) 20%, var(--border) 80%); }

.pill { display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-inline-end: 6px; }
.pill-accent { background: linear-gradient(90deg, var(--k-red), var(--k-yellow), var(--k-green)); }

.unread-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 6px; font-size: 12px; font-weight: 800;
  border-radius: 999px; color: #fff; background: var(--k-red); box-shadow: var(--shadow-sm);
}

.lang-switch { display: inline-flex; gap: 6px; padding: 4px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; }
.lang-switch a {
  text-decoration: none; color: var(--muted); font-weight: 700; font-size: 12px;
  padding: 6px 10px; border-radius: 999px; transition: background var(--trans), color var(--trans);
}
.lang-switch a.active { background: linear-gradient(90deg, var(--k-red), var(--k-green)); color: #000; }

/* Account dropdown */
.account-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 10px;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  border-radius: 999px; cursor: pointer; transition: border var(--trans), transform var(--trans);
}
.account-chip:hover{ border-color: color-mix(in oklab, var(--text) 20%, var(--border) 80%); transform: translateY(-1px); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #000; background: var(--k-yellow); }
.username { font-weight: 700; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 10px); min-width: 220px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 8px; display: none; z-index: 40;
}
[dir="rtl"] .dropdown-menu { inset-inline-start: 0; inset-inline-end: auto; }
.dropdown.open .dropdown-menu { display: block; animation: fadeIn .15s ease-out; }
.dropdown-menu a{
  display: block; text-decoration: none; color: var(--text); padding: 10px 12px; border-radius: 10px;
}
.dropdown-menu a:hover{ background: color-mix(in oklab, var(--bg) 80%, var(--k-white) 20%); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }

@keyframes fadeIn { from { opacity: 0; translate: 0 -6px; } to { opacity: 1; translate: 0 0; } }

/* Mobile menu & search */
.mobile-only { display: none; }
.desktop-only { display: block; }
@media (max-width: 860px){
  .desktop-only { display: none; }
  .mobile-only { display: inline-grid; }
}

.mobile-menu[hidden]{ display: none !important; }
.mobile-menu {
  position: absolute; inset-inline: 0; top: calc(68px + 14px);
  background: var(--bg-elev); border-top: 1px solid var(--border);
  display: grid; gap: 6px; padding: 12px; z-index: 30; box-shadow: var(--shadow);
}
.mobile-link{
  display: block; text-decoration: none; color: var(--text); padding: 12px 10px;
  border-radius: 10px; border: 1px solid transparent;
}
.mobile-link:hover{ border-color: var(--border); background: color-mix(in oklab, var(--bg) 80%, var(--k-white) 20%); }
.mobile-lang{ display: inline-flex; gap: 8px; margin-top: 8px; }
.mobile-lang a{ color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); }
.mobile-lang a.active{ background: var(--k-yellow); color: #000; border-color: var(--k-yellow); }

.mobile-search[hidden]{ display: none !important; }
.mobile-search {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 60; animation: fadeIn .15s ease-out;
}
.mobile-search .sheet{
  width: min(640px, 90%); background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-lg);
}
.mobile-search-form{ display: grid; gap: 10px; }
.mobile-search-form input{
  height: 48px; border-radius: 12px; border: 1px solid var(--border); background: var(--card);
  color: var(--text); padding: 12px 14px; outline: none;
}
.sheet-actions{ display: flex; gap: 10px; justify-content: flex-end; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 800; letter-spacing: .2px; text-decoration: none; cursor: pointer;
  transition: transform var(--trans), box-shadow var(--trans), background var(--trans), border var(--trans);
}
.btn:active{ transform: translateY(0); }
.btn-primary{
  background: linear-gradient(90deg, var(--k-red), var(--k-yellow), var(--k-green));
  color: #000; box-shadow: 0 6px 16px rgba(27,179,79,.2);
}
.btn-primary:hover{ box-shadow: 0 10px 24px rgba(27,179,79,.25); }
.btn-secondary{ background: var(--bg-elev); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover{ border-color: color-mix(in oklab, var(--text) 20%, var(--border) 80%); }

/* Flash messages */
.flash-messages{
  position: fixed; top: 86px; inset-inline-end: 16px; z-index: 70; display: grid; gap: 10px; width: min(420px, 90vw);
}
[dir="rtl"] .flash-messages{ inset-inline-start: 16px; inset-inline-end: auto; }
.flash{
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow);
}
.flash-success{ border-left: 4px solid var(--k-green); }
.flash-error{ border-left: 4px solid var(--k-red); }
.flash-info{ border-left: 4px solid var(--k-yellow); }
[dir="rtl"] .flash-success, [dir="rtl"] .flash-error, [dir="rtl"] .flash-info { border-left: 0; border-right: 4px solid currentcolor; }
.flash-close{
  border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}

/* Footer */
.footer { margin-top: 64px; border-top: 1px solid var(--border); background: color-mix(in oklab, var(--bg) 92%, var(--k-black) 8%); }
.footer-grid{
  display: grid; gap: 24px; grid-template-columns: 2fr 1fr 1fr; padding: 32px 0;
}
.footer-mark .sun{
  width: 28px; height: 28px; border-radius: 50%; background: var(--k-yellow);
  box-shadow: 0 0 0 6px rgba(246,201,14,.18), 0 8px 20px rgba(246,201,14,.25);
}
.footer h4{ margin: 0 0 10px; }
.footer p, .footer a{ color: var(--muted); }
.footer a{ text-decoration: none; }
.footer a:hover{ color: var(--text); }
.footer-bottom{ border-top: 1px solid var(--border); padding: 14px 0; color: var(--muted); text-align: center; }

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

/* Main content defaults (cards, forms, grids) – compatible with existing templates */
.section { padding: 36px 0; }
.card{
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad{ padding: 16px; }

.form-control{
  width: 100%; height: 44px; background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); padding: 10px 12px; outline: none;
}
textarea.form-control{ min-height: 140px; resize: vertical; }
.form-control:focus{ border-color: color-mix(in oklab, var(--primary) 70%, var(--text) 30%); box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 25%, transparent); }

.table{
  width: 100%; border-collapse: collapse; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
}
.table th, .table td{ padding: 12px 14px; border-bottom: 1px solid var(--border); text-align: start; }
.table thead th{ background: color-mix(in oklab, var(--bg) 90%, var(--k-white) 10%); color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }

/* Utilities */
.hidden { display: none !important; }
.center { display: grid; place-items: center; }

/* Light-mode support by toggling .theme-light on <html> */
html.theme-light body {
  background: radial-gradient(1200px 800px at 100% -10%, rgba(27,179,79,.08), transparent 60%),
              radial-gradient(1000px 600px at -10% -20%, rgba(226,24,26,.08), transparent 60%),
              var(--bg);
}





/* ======= Home / Hero ======= */
.hero-wrap{
  display: grid;
  gap: 18px;
  align-items: center;
}
.hero-title{
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.1;
  margin: 0 0 8px;
  font-weight: 900;
  letter-spacing: .2px;
}
.hero-sub{
  margin: 0;
  color: var(--muted);
  font-size: clamp(14px, 1.4vw, 18px);
}
.hero-search{
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hero-flag-accent{
  position: absolute; inset: auto 0 0 0; height: 5px;
  background: linear-gradient(90deg, var(--k-red), var(--k-white), var(--k-green));
}
.hero-search-form .hs-fields{
  display: grid;
  grid-template-columns: 1fr minmax(180px, 260px) auto;
  gap: 10px;
}
@media (max-width: 720px){
  .hero-search-form .hs-fields{ grid-template-columns: 1fr; }
}

/* ======= Section header ======= */
.section-header{
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.section-header h2{ margin: 0; font-size: clamp(18px, 2vw, 24px); }

/* ======= Categories ======= */
.categories-grid{
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
@media (max-width: 1080px){ .categories-grid{ grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px){ .categories-grid{ grid-template-columns: repeat(2, 1fr); } }

.category-card{
  border-radius: var(--radius);
  transition: transform var(--trans), box-shadow var(--trans), border var(--trans);
  border: 1px solid var(--border);
  text-decoration: none;
  overflow: hidden;
}
.category-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in oklab, var(--text) 18%, var(--border) 82%);
}
.category-inner{
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
}
.category-icon-wrap{
  width: 46px; height: 46px; border-radius: 12px;
  background: color-mix(in oklab, var(--bg) 80%, var(--k-white) 20%);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  position: relative;
}
.category-icon-wrap::after{
  content: ""; position: absolute; inset: 0; border-radius: 12px; pointer-events: none;
  background: linear-gradient(120deg, transparent, rgba(246,201,14,.2));
  mix-blend-mode: overlay;
}
.category-icon{ font-size: 22px; }
.category-title{ margin: 0 0 6px; font-size: 15px; font-weight: 800; color: var(--text); }
.category-count{ color: var(--muted); font-size: 12px; }

/* ======= Listings grid ======= */
.listings-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1180px){ .listings-grid{ grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px){ .listings-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px){ .listings-grid{ grid-template-columns: 1fr; } }

.listing-card{
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--trans), box-shadow var(--trans), border var(--trans);
}
.listing-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in oklab, var(--text) 18%, var(--border) 82%);
}

.listing-image{
  position: relative; display: block; aspect-ratio: 4/3; background: var(--bg);
}
.listing-image img{
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.no-image{
  width: 100%; height: 100%; display: grid; place-items: center;
  color: var(--muted); font-weight: 700; letter-spacing: .02em;
  background:
    linear-gradient(90deg, rgba(27,179,79,.18), rgba(246,201,14,.18), rgba(226,24,26,.18));
}

.highlight-ribbon{
  position: absolute; top: .6rem; left: .6rem; z-index: 2;
  background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa;
  border-radius: .6rem; padding: .2rem .5rem; font-size: .75rem; font-weight: 700;
  pointer-events: none;
}
[dir="rtl"] .highlight-ribbon{ left: auto; right: .6rem; }

.listing-content{ padding: 12px 12px 14px; }
.listing-title{ margin: 0 0 6px; font-size: 15px; line-height: 1.35; }
.listing-title a{ color: var(--text); text-decoration: none; }
.listing-title a:hover{ text-decoration: underline; }

.seller-line{ margin-top: .25rem; font-size: .9rem; color: var(--muted); }

.user-badge-link{ text-decoration: none; color: inherit; }
.user-badge{ display: inline-flex; align-items: center; gap: .35rem; }
.verified-badge{
  display: inline-grid; place-items: center;
  width: 1.1rem; height: 1.1rem; font-size: .75rem; line-height: 1;
  border-radius: 999px; background: #3b82f6; color: #fff;
}

.listing-price{
  margin: 8px 0 10px; font-weight: 900; letter-spacing: .2px;
  color: color-mix(in oklab, var(--text) 88%, var(--k-yellow) 12%);
}

.listing-meta{ display: flex; flex-wrap: wrap; gap: 8px; }
.chip{
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 82%, var(--k-white) 18%);
  border: 1px solid var(--border); color: var(--muted); font-size: 12px;
}

/* ======= Pagination ======= */
.pagination{
  margin-top: 16px; display: flex; align-items: center; gap: 10px; justify-content: center;
}
.page-indicator{ color: var(--muted); }

/* RTL fine-tuning */
[dir="rtl"] .hero-flag-accent{ background: linear-gradient(90deg, var(--k-green), var(--k-white), var(--k-red)); }






/* ======= Auth (Login / Register) ======= */
.auth-container{
  display: grid;
  place-items: center;
  min-height: calc(100vh - 180px);
}

.auth-card{
  width: min(520px, 94vw);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  padding: 22px 18px;
}

@media (min-width: 520px){
  .auth-card{ padding: 28px 24px; }
}

.auth-head{ text-align: center; margin-bottom: 14px; }
.auth-mark{
  width: 40px; height: 40px; border-radius: 50%;
  margin: 0 auto 8px;
  background: var(--k-yellow);
  box-shadow: 0 0 0 8px rgba(246,201,14,.15), 0 10px 30px rgba(246,201,14,.25);
}
.auth-title{
  margin: 0 0 4px; font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 900; letter-spacing: .2px;
}
.auth-subtitle{ margin: 0; color: var(--muted); }

.auth-form{ display: grid; gap: 12px; margin-top: 14px; }
.form-group label{ display:block; margin: 0 0 6px; font-weight: 700; color: var(--text); }

.with-icon .input-wrap{ position: relative; }
.input-icon{
  position: absolute; top: 50%; translate: 0 -50%;
  color: var(--muted);
  width: 20px; height: 20px; display: grid; place-items: center;
  inset-inline-start: 12px;
}
[dir="rtl"] .input-icon{ inset-inline-start: auto; inset-inline-end: 12px; }

.has-icon{
  padding-inline-start: 40px;
}
[dir="rtl"] .has-icon{
  padding-inline-start: 12px; padding-inline-end: 40px;
}

.error{
  display: block;
  margin-top: 6px;
  color: var(--k-red);
  font-size: 12px;
}

.btn-full{ width: 100%; margin-top: 4px; }

/* Links in Auth-Footer */
.auth-footer{
  text-align: center;
  margin-top: 14px;
  color: var(--muted);
}
.auth-footer a{
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}
.auth-footer a:hover{ text-decoration: underline; }









/* ========== Auth shared (Register ergänzt) ========== */
.form-row-2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px){ .form-row-2{ grid-template-columns: 1fr; } }

/* ========== Messages ========== */
.messages-title{
  font-size: clamp(20px, 2.2vw, 28px);
  margin: 0 0 14px;
  font-weight: 900;
}
.conversations-list{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.conversation-card{
  display: flex; align-items: center; gap: 14px;
  padding: 14px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  transition: background var(--trans);
}
.conversation-card:last-child{ border-bottom: 0; }
.conversation-card:hover{
  background: color-mix(in oklab, var(--bg-elev) 85%, var(--k-white) 15%);
}
.conversation-card.unread{
  background: color-mix(in oklab, var(--k-yellow) 14%, var(--bg-elev) 86%);
}
@supports not (color: color-mix(in oklab, red, blue)) {
  .conversation-card:hover{ background: var(--card); }
  .conversation-card.unread{ background: rgba(246,201,14,.09); }
}

.conversation-avatar{
  width: 56px; height: 56px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800; font-size: 1.1rem; color: #000;
  background: var(--k-yellow);
  box-shadow: 0 6px 16px rgba(246,201,14,.25);
}

.conversation-info{ flex: 1; min-width: 0; }
.conversation-header{
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 2px;
}
.conv-name .user-badge{ display:inline-flex; align-items:center; gap:.35rem; }
.conv-name .verified-badge{ vertical-align:middle; margin-left:.35rem; }
[dir="rtl"] .conv-name .verified-badge{ margin-left:0; margin-right:.35rem; }

.conversation-time{ color: var(--muted); font-size: .9rem; white-space: nowrap; }

.conversation-preview{
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.conversation-preview p{
  margin: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unread-badge{ /* existiert schon – hier nur sicherstellen */
  background: var(--k-red);
}

.empty-state h2{ margin: 10px 0 6px; }
.empty-state .muted{ color: var(--muted); }



/* ===== Chat ===== */
.chat-container{ max-width: 900px; margin: 0 auto; display: grid; gap: 12px; }
.chat-header{ display: flex; align-items: center; gap: 12px; }
.back-btn{ width: 40px; height: 40px; }
.chat-user-info{ display: flex; align-items: center; gap: 12px; }
.chat-title{ margin: 0 0 2px; font-size: 18px; font-weight: 900; }
.user-badge-link{ text-decoration: none; color: inherit; }
.user-avatar{
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; color: #000;
  background: var(--k-yellow); box-shadow: 0 6px 14px rgba(246,201,14,.25);
}
.muted{ color: var(--muted); }

.chat-messages{
  max-height: calc(100vh - 300px);
  overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev);
}
.message{ display: flex; margin: 6px 0; }
.message-content{
  max-width: 70%; padding: 10px 12px; border-radius: 14px; position: relative;
  border: 1px solid var(--border);
}
.message-received .message-content{
  background: var(--card); margin-inline-end: auto;
}
.message-sent{ justify-content: flex-end; }
.message-sent .message-content{
  background: linear-gradient(90deg, var(--k-green), var(--k-yellow));
  color: #000; border: 1px solid rgba(0,0,0,.08);
}
.message-content p{ margin: 0 0 4px; white-space: pre-wrap; word-wrap: break-word; }
.message-time{
  font-size: 11px; opacity: .7;
  position: absolute; bottom: 6px; inset-inline-end: 10px;
}

.chat-input{
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev);
}
#messageForm{ display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.send-btn{ height: 44px; }

/* Seen/Delivered */
.seen-status{
  text-align: end; color: var(--muted); font-size: .9rem;
}

/* ===== Post Ad (Create Listing) ===== */
.form-container{ width: min(940px, 96vw); margin: 0 auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.page-title{ margin: 0 0 8px; font-size: clamp(22px, 2.2vw, 28px); font-weight: 900; }
.listing-form{ display: grid; gap: 16px; }
.form-section{ display: grid; gap: 10px; }
.form-section h2{ margin: 0; font-size: 18px; font-weight: 900; }
.form-row-2{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px){ .form-row-2{ grid-template-columns: 1fr; } }

.form-hint{ color: var(--muted); margin: 0; }
.btn-small{ height: 32px; padding: 0 10px; border-radius: 10px; font-weight: 800; }

/* Map preview */
.map-box{
  height: 320px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg);
}

/* Leaflet tweaks to blend with theme */
.leaflet-control-attribution, .leaflet-control-zoom{
  background: color-mix(in oklab, var(--bg-elev) 92%, var(--k-white) 8%) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
}
/* --- Chat: mehr Abstand für die Uhrzeit im Bubble --- */
.message-content{
  /* mehr Platz unten + auf der "Ende"-Seite für die Zeit */
  padding: 12px 14px 28px 14px;
  padding-inline-end: 46px; /* respektiert LTR/RTL automatisch */
}

/* Uhrzeit etwas größer + klarer positioniert */
.message-time{
  bottom: 8px;
  inset-inline-end: 12px; /* logisch statt right/left */
  font-size: 12px;
  opacity: .75;
}

/* ganz kleine Screens -> noch mehr Luft */
@media (max-width: 420px){
  .message-content{ padding-bottom: 32px; padding-inline-end: 50px; }
  .message-time{ font-size: 12px; }
}






/* Verify banner */
.verify-banner{
  position: sticky; top: 68px; z-index: 80;
  background: color-mix(in oklab, var(--k-yellow) 14%, var(--bg-elev) 86%);
  border-block: 1px solid var(--border);
}
.verify-row{
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
}
.verify-dot{
  width: 10px; height: 10px; border-radius: 999px; background: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59,130,246,.2);
}
.verify-text{ color: var(--text); }
.verify-close{
  margin-inline-start: auto;
  border: 0; background: transparent; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.btn-small{ height: 32px; padding: 0 10px; border-radius: 10px; font-weight: 800; }





/* ===== Highlight Request ===== */
.highlight-page .head-inner{ padding: 6px 0 10px; }
.highlight-grid{
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}
@media (max-width: 992px){ .highlight-grid{ grid-template-columns: 1fr; } }

.section-title{ margin: 0 0 .6rem; font-size: 18px; font-weight: 900; }
.subhead{ margin: .5rem 0 .25rem; font-size: 16px; font-weight: 800; }
.bullets{ margin: .5rem 1rem; line-height: 1.7; }
.bullets li{ margin: .15rem 0; }

.preview.listing-card{ position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); }
.preview .listing-image{ height: 240px; }
.preview .listing-image img{ width:100%; height:100%; object-fit: cover; display:block; transform: scale(1.02); }
.highlight-badge{
  position: absolute; top: .75rem; inset-inline-end: .75rem;
  padding: .25rem .5rem; border-radius: .5rem; font-weight: 800; font-size: .85rem; color: #000;
  background: linear-gradient(90deg, var(--k-yellow), var(--k-green));
  box-shadow: var(--shadow-sm);
}
[dir="rtl"] .highlight-badge{ inset-inline-start: .75rem; inset-inline-end: auto; }

.pricing-options{ display: grid; gap: 10px; }
.pricing-card{
  display: block; border: 1px solid var(--border); border-radius: .75rem; padding: 12px; cursor: pointer;
  background: var(--bg-elev); transition: border var(--trans), transform var(--trans), box-shadow var(--trans);
}
.pricing-card:hover{ transform: translateY(-1px); box-shadow: var(--shadow); border-color: color-mix(in oklab, var(--text) 18%, var(--border) 82%); }
.pricing-card input[type="radio"]{ margin-inline-end: .6rem; accent-color: var(--k-green); }
[dir="rtl"] .pricing-card input[type="radio"]{ margin-inline-end: 0; margin-inline-start: .6rem; }

.pricing-content{ display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pricing-duration{ font-weight: 900; }
.pricing-amount{ font-weight: 900; color: var(--primary); }
.pricing-amount.weekly{ color: #16a34a; }

.recommended{ position: relative; border-width: 2px; border-color: #22c55e; background: linear-gradient(0deg, rgba(34,197,94,.08), transparent 60%); }
.recommended .recommended-badge{
  position: absolute; top: -10px; inset-inline-end: 12px;
  background: #22c55e; color: #fff; padding: .15rem .5rem; border-radius: .5rem; font-size: .75rem; font-weight: 800;
}
[dir="rtl"] .recommended .recommended-badge{ inset-inline-start: 12px; inset-inline-end: auto; }

.save-pill{ color: #16a34a; }

.payment-instructions{
  margin-top: .5rem; padding: 12px; border: 1px dashed var(--border); border-radius: .6rem;
  background: color-mix(in oklab, var(--bg) 90%, var(--k-white) 10%);
}
.safety-callout{
  margin-top: .75rem; padding: .75rem; border-radius: .6rem; font-size: .92rem;
  background: #fef3c7; color: #92400e; border: 1px solid #fde68a;
}

.form-actions.end{ display: flex; gap: .75rem; justify-content: flex-end; margin-top: .75rem; }
.btn-large{ height: 46px; padding: 0 16px; }
