/* ============================================================
   discover.css — «اكتشف ولايتك»  (يستخدم متغيرات style.css فقط، تصميم داكن)
   ============================================================ */
.page-dw { padding-top: 10px; }
.dw-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.dw-title h1 { font-size: 1.25em; font-weight: 900; line-height: 1.3; }
.dw-title p { color: var(--muted); font-size: .82em; font-weight: 600; margin-top: 2px; line-height: 1.6; }
.dw-head-btns { display: flex; gap: 8px; flex-shrink: 0; }
.dw-head-btns .icon-btn svg, #dw-near svg { width: 20px; height: 20px; }
.dw-add { margin-bottom: 12px; }
.dw-add svg { width: 18px; height: 18px; }

.dw-f, .dw-form select, .dw-form textarea, .dw-form input[type=text], .dw-form input[type=search] {
    width: 100%; min-height: 46px; padding: 0 14px; background: var(--card2); color: var(--text);
    border: 1.5px solid transparent; border-radius: 12px; outline: none; font-family: inherit; font-size: 16px;
    -webkit-appearance: none; appearance: none; transition: border-color .15s;
}
select.dw-f, .dw-form select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: 16px 50%, 11px 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 14px; padding-inline-start: 32px; }
.dw-form textarea { padding: 12px 14px; min-height: 84px; resize: vertical; line-height: 1.6; }
.dw-f:focus, .dw-form select:focus, .dw-form textarea:focus, .dw-form input:focus { border-color: var(--pink); }
.dw-f:disabled { opacity: .5; }
.dw-f option { background: var(--card2); color: var(--text); }
.dw-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.dw-searchrow { display: flex; gap: 8px; margin-bottom: 10px; }
.dw-searchbox { position: relative; flex: 1; }
.dw-searchbox span { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; pointer-events: none; }
.dw-searchbox span svg { width: 18px; height: 18px; }
.dw-searchbox input { padding-inline-start: 40px !important; }
#dw-near { flex-shrink: 0; }
#dw-near.on { background: var(--pink); }

.dw-cats { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.dw-cats::-webkit-scrollbar { display: none; }
.dw-cat { flex-shrink: 0; display: flex; align-items: center; gap: 6px; padding: 0 13px; min-height: 38px; border-radius: 50px; background: var(--card); border: 1px solid var(--line2); color: var(--text2); font-weight: 800; font-size: .8em; white-space: nowrap; scroll-snap-align: start; transition: background .15s, border-color .15s; }
.dw-cat svg { width: 17px; height: 17px; }
.dw-cat.on { background: var(--pink); border-color: var(--pink); color: #fff; }

.dw-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.dw-tab { flex: 1; background: none; border: none; padding: 11px 2px; font-weight: 800; font-size: .84em; color: var(--muted); position: relative; }
.dw-tab.on { color: #fff; }
.dw-tab.on::after { content: ''; position: absolute; bottom: -1px; left: 22%; right: 22%; height: 3px; background: var(--pink); border-radius: 3px; }
.dw-status { color: var(--muted); font-weight: 700; font-size: .84em; text-align: center; padding: 4px 0 10px; min-height: 8px; }
.dw-status.err { color: var(--pink2); }

.dw-sec { margin-bottom: 18px; }
.dw-sec-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.dw-sec-h h2 { font-size: 1em; font-weight: 900; }
.dw-sec-h small { color: var(--muted); font-weight: 700; font-size: .74em; }
.dw-row { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
.dw-row::-webkit-scrollbar { display: none; }
.dw-row .dw-card { flex: 0 0 62%; max-width: 250px; scroll-snap-align: start; }
.dw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dw-sortbar { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; scrollbar-width: none; }
.dw-sortbar::-webkit-scrollbar { display: none; }
.dw-sortbar button { flex-shrink: 0; padding: 0 12px; min-height: 34px; border-radius: 50px; border: 1px solid var(--line2); background: transparent; color: var(--text2); font-weight: 800; font-size: .76em; }
.dw-sortbar button.on { background: #fff; color: #000; border-color: #fff; }

.dw-card { position: relative; display: block; text-align: start; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); aspect-ratio: 3 / 4; transition: transform .15s; }
.dw-card:active { transform: scale(.98); }
.dw-card img, .dw-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--card2); }
.dw-card .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--card2); }
.dw-card .ph svg { width: 38px; height: 38px; }
.dw-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.1) 55%, transparent); pointer-events: none; }
.dw-card .tx { position: absolute; z-index: 2; inset-inline: 10px; bottom: 9px; }
.dw-card .tx b { display: block; font-size: .92em; font-weight: 900; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dw-card .tx span { display: block; color: var(--text2); font-size: .72em; font-weight: 700; margin-top: 2px; }
.dw-badge { position: absolute; z-index: 2; top: 9px; inset-inline-start: 9px; display: flex; align-items: center; gap: 3px; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); border-radius: 50px; padding: 3px 9px; font-size: .74em; font-weight: 900; }
.dw-badge svg { width: 13px; height: 13px; color: var(--gold); }
.dw-cat-tag { position: absolute; z-index: 2; top: 9px; inset-inline-end: 9px; background: var(--pink); border-radius: 50px; padding: 3px 9px; font-size: .68em; font-weight: 800; }

.dw-empty { text-align: center; color: var(--muted); font-weight: 700; font-size: .86em; padding: 22px 12px; background: var(--card); border: 1px dashed var(--line2); border-radius: var(--radius); line-height: 1.8; }
.dw-skel { aspect-ratio: 3/4; border-radius: var(--radius); background: linear-gradient(100deg, var(--card) 30%, var(--card2) 50%, var(--card) 70%) 0 0 / 220% 100%; animation: dwSh 1.3s linear infinite; }
@keyframes dwSh { to { background-position: -120% 0; } }

/* الخريطة */
.dw-map { height: min(56dvh, 460px); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card2); z-index: 0; }
.dw-map-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.dw-map-bar .btn-secondary { flex: 1; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: .82em; }
.dw-map-bar svg { width: 17px; height: 17px; }
.dw-pin { color: var(--pink); filter: drop-shadow(0 2px 4px rgba(0,0,0,.6)); }
.dw-pin svg { width: 30px; height: 30px; fill: var(--pink); stroke: #fff; stroke-width: 1.6; }
.leaflet-container { font-family: 'Cairo', system-ui, sans-serif; direction: ltr; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--card); color: var(--text); border: 1px solid var(--line2); }
.leaflet-popup-content { margin: 10px; direction: rtl; min-width: 190px; }
.dw-pop b { display: block; font-weight: 900; margin-bottom: 2px; }
.dw-pop small { color: var(--text2); font-weight: 700; display: block; margin-bottom: 8px; }
.dw-pop div { display: flex; gap: 6px; }
.dw-pop button { flex: 1; min-height: 36px; border-radius: 10px; border: none; font-weight: 800; font-size: .78em; background: var(--pink); color: #fff; }
.dw-pop button.alt { background: var(--card2); border: 1px solid var(--line2); }
.leaflet-control-attribution { background: rgba(0,0,0,.6) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--text2) !important; }

/* التفاصيل */
.dw-detail { position: fixed; inset: 0; z-index: 9000; background: var(--bg); max-width: var(--maxw); margin: 0 auto; overflow-y: auto; overscroll-behavior: contain; animation: slideUp .25s ease both; }
.dw-d-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-top) + 8px) 12px 8px; background: rgba(0,0,0,.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.dw-d-top h3 { flex: 1; font-size: 1em; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-d-top .icon-btn svg { width: 20px; height: 20px; }
.dw-d-body { padding: 0 14px calc(var(--safe-bottom) + 30px); }
.dw-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px; scrollbar-width: none; background: #000; }
.dw-gallery::-webkit-scrollbar { display: none; }
.dw-gallery > * { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4/3; object-fit: cover; width: 100%; background: var(--card2); }
.dw-gal-n { text-align: center; color: var(--muted); font-size: .72em; font-weight: 800; padding: 6px 0 2px; }
.dw-d-name { font-size: 1.35em; font-weight: 900; margin-top: 10px; line-height: 1.4; }
.dw-d-loc { display: flex; align-items: center; gap: 5px; color: var(--text2); font-weight: 700; font-size: .86em; margin-top: 2px; flex-wrap: wrap; }
.dw-d-loc svg { width: 16px; height: 16px; color: var(--pink); }
.dw-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--card2); border: 1px solid var(--line2); border-radius: 50px; padding: 2px 10px; font-size: .74em; font-weight: 800; color: var(--text2); }
.dw-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.dw-actions button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 62px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 800; font-size: .72em; color: var(--text2); }
.dw-actions button svg { width: 21px; height: 21px; }
.dw-actions button.on { color: var(--pink); border-color: var(--pink); }
.dw-actions button.on svg { fill: var(--pink); }
.dw-actions button.dir { background: var(--pink); border-color: var(--pink); color: #fff; }
.dw-d-sec { margin-top: 18px; }
.dw-d-sec > h4 { font-size: .98em; font-weight: 900; margin-bottom: 8px; }
.dw-d-sec p { color: var(--text2); line-height: 1.85; font-size: .9em; white-space: pre-wrap; word-break: break-word; }
.dw-mini { height: 190px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); z-index: 0; }
.dw-stars { display: inline-flex; gap: 2px; color: var(--gold); }
.dw-stars svg { width: 17px; height: 17px; }
.dw-stars .off { color: var(--line2); }
.dw-rate-sum { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 800; }
.dw-rate-sum big { font-size: 1.8em; font-weight: 900; }
.dw-rate-in { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; }
.dw-rate-in .dw-stars { gap: 6px; margin-bottom: 8px; }
.dw-rate-in .dw-stars button { background: none; border: none; padding: 0; color: var(--line2); }
.dw-rate-in .dw-stars button.on { color: var(--gold); }
.dw-rate-in .dw-stars button svg { width: 30px; height: 30px; }
.dw-rate-in textarea { margin-bottom: 8px; }
.dw-rev { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.dw-rev .av, .dw-pc-av { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--card2); }
.dw-rev .av svg, .dw-pc-av svg { width: 100%; height: 100%; display: block; }
.dw-rev .bd { flex: 1; min-width: 0; }
.dw-rev .hd { display: flex; align-items: center; gap: 8px; font-size: .82em; font-weight: 900; }
.dw-rev .hd small { color: var(--muted); font-weight: 700; }
.dw-rev .tx { color: var(--text2); font-size: .86em; margin-top: 3px; word-break: break-word; white-space: pre-wrap; }
.dw-mini-del { margin-inline-start: auto; background: none; border: none; color: var(--muted); padding: 2px; }
.dw-mini-del svg { width: 16px; height: 16px; }
.dw-warn { background: rgba(255,193,7,.1); border: 1px solid rgba(255,193,7,.35); color: var(--gold); border-radius: var(--radius-sm); padding: 9px 12px; font-size: .8em; font-weight: 700; line-height: 1.7; margin-top: 12px; }

/* تجارب أهل الولاية */
.dw-composer { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.dw-composer b { font-weight: 900; font-size: .92em; }
.dw-composer .row { display: flex; gap: 8px; }
.dw-composer .row > * { flex: 1; margin: 0; }
.dw-file { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 12px; background: var(--card2); border: 1px dashed var(--line2); font-weight: 800; font-size: .82em; color: var(--text2); cursor: pointer; }
.dw-file svg { width: 18px; height: 18px; }
.dw-file input { display: none; }
.dw-post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.dw-pc-h { display: flex; align-items: center; gap: 9px; padding: 11px 12px; }
.dw-pc-h b { font-size: .88em; font-weight: 900; }
.dw-pc-h small { display: block; color: var(--muted); font-weight: 700; font-size: .72em; }
.dw-pc-h .grow { flex: 1; min-width: 0; }
.dw-follow { background: transparent; border: 1.5px solid var(--pink); color: var(--pink); border-radius: 50px; padding: 0 12px; min-height: 30px; font-weight: 800; font-size: .74em; }
.dw-follow.on { border-color: var(--line2); color: var(--muted); }
.dw-pc-m { width: 100%; max-height: 420px; object-fit: cover; display: block; background: #000; }
.dw-pc-t { padding: 10px 12px 4px; color: var(--text2); font-size: .9em; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.dw-pc-place { display: inline-flex; align-items: center; gap: 4px; margin: 4px 12px 0; padding: 3px 10px; border-radius: 50px; background: var(--card2); font-weight: 800; font-size: .74em; color: var(--cyan); border: none; }
.dw-pc-place svg { width: 14px; height: 14px; }
.dw-pc-a { display: flex; gap: 4px; padding: 6px 8px 8px; }
.dw-pc-a button { display: flex; align-items: center; gap: 5px; background: none; border: none; padding: 6px 10px; border-radius: 50px; color: var(--text2); font-weight: 800; font-size: .8em; min-height: 40px; }
.dw-pc-a button svg { width: 20px; height: 20px; }
.dw-pc-a button.liked { color: var(--pink); }
.dw-pc-a button.liked svg { fill: var(--pink); }
.dw-pc-a .sp { flex: 1; }

/* الفيديوهات */
.dw-vfeed { height: calc(100dvh - var(--top-h) - var(--safe-top) - var(--nav-h) - var(--safe-bottom) - 150px); min-height: 380px; overflow-y: auto; scroll-snap-type: y mandatory; border-radius: var(--radius); background: #000; scrollbar-width: none; }
.dw-vfeed::-webkit-scrollbar { display: none; }
.dw-vi { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; background: #000; }
.dw-vi video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.dw-vi .info { position: absolute; inset-inline: 12px 70px; bottom: 14px; text-shadow: 0 1px 6px #000; }
.dw-vi .info b { font-weight: 900; font-size: .9em; }
.dw-vi .info p { font-size: .84em; line-height: 1.6; margin-top: 3px; }
.dw-vi .side { position: absolute; inset-inline-end: 8px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; }
.dw-vi .side button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(0,0,0,.4); border: none; border-radius: 50%; width: 48px; height: 48px; justify-content: center; font-size: .66em; font-weight: 800; }
.dw-vi .side button svg { width: 22px; height: 22px; }
.dw-vi .side button.liked { color: var(--pink); }
.dw-vi .side button.liked svg { fill: var(--pink); }

/* النماذج والنوافذ */
.dw-form { display: flex; flex-direction: column; gap: 11px; padding: 4px 16px 6px; overflow-y: auto; }
.dw-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 800; font-size: .82em; color: var(--text2); }
.dw-form label small { color: var(--muted); font-weight: 600; }
.dw-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dw-pick { height: 220px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); z-index: 0; }
.dw-form .btn-secondary { display: flex; align-items: center; justify-content: center; gap: 6px; }
.dw-coords { color: var(--muted); font-size: .76em; font-weight: 700; direction: ltr; text-align: start; }
.dw-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.dw-thumbs span { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--card2); display: flex; align-items: center; justify-content: center; }
.dw-thumbs img, .dw-thumbs video { width: 100%; height: 100%; object-fit: cover; }
.dw-thumbs button { position: absolute; top: 2px; inset-inline-start: 2px; width: 20px; height: 20px; border-radius: 50%; border: none; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; padding: 0; }
.dw-thumbs button svg { width: 11px; height: 11px; }
.dw-prog { height: 6px; background: var(--card2); border-radius: 6px; overflow: hidden; }
.dw-prog i { display: block; height: 100%; width: 0; background: var(--pink); transition: width .2s; }
.dw-form-foot { padding: 8px 16px 14px; flex-shrink: 0; }
.dw-form-foot .btn-primary { width: 100%; }
.dw-note { text-align: center; font-size: .8em; font-weight: 700; color: var(--pink2); min-height: 1.2em; }
.dw-note.ok { color: var(--green); }
.dw-sheet-body { padding: 0 16px 14px; overflow-y: auto; }
.dw-me { display: flex; align-items: center; gap: 12px; background: var(--card2); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 12px; }
.dw-me big { font-size: 1.6em; font-weight: 900; color: var(--gold); }
.dw-me .lv { flex: 1; min-width: 0; }
.dw-me .lv b { display: block; font-weight: 900; }
.dw-bar { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; margin-top: 6px; }
.dw-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold)); border-radius: 8px; }
.dw-ch { padding: 10px 0; border-top: 1px solid var(--line); }
.dw-ch .t { display: flex; justify-content: space-between; font-weight: 800; font-size: .88em; }
.dw-ch .t span { color: var(--gold); font-size: .8em; }
.dw-ch.done .t b::before { content: '✓ '; color: var(--green); }
.dw-lb { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-top: 1px solid var(--line); font-weight: 800; font-size: .86em; }
.dw-lb .n { width: 22px; color: var(--muted); text-align: center; }
.dw-lb .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-lb.me { color: var(--gold); }
.dw-adm { background: var(--card2); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 10px; }
.dw-adm h5 { font-size: .92em; font-weight: 900; }
.dw-adm p { color: var(--text2); font-size: .8em; margin: 4px 0 8px; line-height: 1.7; word-break: break-word; }
.dw-adm .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.dw-adm .btns button { flex: 1; min-width: 70px; min-height: 36px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); font-weight: 800; font-size: .76em; }
.dw-adm .btns .ok { background: var(--green); border-color: var(--green); color: #000; }
.dw-adm .btns .no { color: var(--pink2); }
.dw-adm .thumbs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 6px; }
.dw-adm .thumbs img, .dw-adm .thumbs video { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.dw-h { font-weight: 900; font-size: .9em; margin: 12px 0 8px; }
.modal-overlay.dw-ov { z-index: 9500; }

@media (min-width: 560px) { .dw-row .dw-card { flex-basis: 40%; } }
@media (prefers-reduced-motion: reduce) { .dw-detail, .dw-skel { animation: none; } .dw-card, .dw-card:active { transition: none; } }