/* Phase 13.2 — Lost & Found styles. Self-contained, pattern Phase 12 jobs. */

.lf-body {
  background: var(--bg); color: var(--text);
  min-height: 100vh; min-height: 100dvh;
  font-family: 'Nunito', sans-serif;
  padding-bottom: calc(env(safe-area-inset-bottom, 0) + 62px);
}

/* ─── Header (sticky orange) ─── */
.app-header.lf-header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg, #6750A4, #4F378B);
  color: #fff;
  padding-top: env(safe-area-inset-top, 0);
  box-shadow: 0 2px 12px rgba(103, 80, 164,.18);
}
.app-header.lf-header .app-header-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; max-width: 760px; margin: 0 auto;
}
.app-header.lf-header .hdr-back {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.22); color: #fff; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  transition: transform .15s, background .15s;
}
.app-header.lf-header .hdr-back:active { transform: scale(.92); background: rgba(255,255,255,.3); }
.app-header.lf-header .app-header-title { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.app-header.lf-header .app-header-name {
  font-size: 17px; font-weight: 900; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-header.lf-header .app-header-sub {
  font-size: 10px; font-weight: 800; color: rgba(255,255,255,.85);
  text-transform: uppercase; letter-spacing: .5px; margin-top: 1px;
}
.lf-fab-btn {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.22); color: #fff; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: transform .15s, background .15s;
}
.lf-fab-btn:active { transform: scale(.92); background: rgba(255,255,255,.3); }

/* ─── Chips catégories ─── */
.lf-chips {
  display: flex; gap: 8px; padding: 12px 16px 10px;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
  position: sticky; top: 60px; z-index: 15;
  background: rgba(245,245,247,.94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(15,23,42,.05);
}
.lf-chips::-webkit-scrollbar { display: none; }
.lf-chip {
  flex-shrink: 0; padding: 8px 14px; border-radius: 22px;
  background:var(--card-bg); border: 1px solid rgba(15,23,42,.08);
  color: var(--text-soft); font-size: 13px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .18s ease;
}
.lf-chip i { font-size: 11px; opacity: .8; }
.lf-chip:active { transform: scale(.96); }
.lf-chip.active {
  background: linear-gradient(135deg, #6750A4, #4F378B);
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(103, 80, 164,.32);
}
.lf-chip.active i { opacity: 1; }

/* Hide chips on tabs mine/inquiries */
.lf-body[data-tab="mine"] .lf-chips,
.lf-body[data-tab="inquiries"] .lf-chips { display: none; }

/* ─── Shell ─── */
.lf-shell { max-width: 760px; margin: 0 auto; padding: 8px 14px 14px; }

.lf-panel { display: none; }
.lf-panel.active { display: block; }

.lf-scope-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 4px 12px;
}
.lf-scope-info { font-size: 12px; color: var(--text-soft); font-weight: 700; }
.lf-scope-info i { color: #6750A4; margin-right: 4px; }
.lf-scope-toggle {
  font-size: 12px; font-weight: 800; color: #6750A4;
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  border-radius: 8px; font-family: inherit;
}
.lf-scope-toggle:active { background: rgba(103, 80, 164,.1); }

.lf-list { display: flex; flex-direction: column; gap: 12px; }
.lf-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 32px; color: var(--text-soft); font-size: 13px; justify-content: center;
}
.gs-spinner {
  display: inline-block; width: 22px; height: 22px;
  border: 2.5px solid rgba(15,23,42,.1); border-top-color: #6750A4;
  border-radius: 50%; animation: lfSpin .8s linear infinite;
}
@keyframes lfSpin { to { transform: rotate(360deg); } }
.lf-empty {
  text-align: center; padding: 50px 18px; color: var(--text-muted);
}
.lf-empty i { font-size: 38px; margin-bottom: 12px; display: block; opacity: .55; color: #6750A4; }
.lf-empty-title { font-size: 14.5px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.lf-empty-sub { font-size: 12px; color: var(--text-soft); }

/* ─── Card ─── */
.lf-card {
  background:var(--card-bg); border-radius: 14px; overflow: hidden;
  border: 1px solid rgba(15,23,42,.05);
  box-shadow: 0 1px 3px rgba(15,23,42,.04), 0 3px 10px rgba(15,23,42,.04);
  cursor: pointer; transition: transform .15s ease;
  display: flex; gap: 10px;
}
.lf-card:active { transform: scale(.985); }
.lf-card-photo {
  width: 96px; height: 96px; flex-shrink: 0;
  background: rgba(15,23,42,.05); object-fit: cover; display: block;
}
.lf-card-photo-placeholder {
  width: 96px; height: 96px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(103, 80, 164,.12), rgba(232,85,0,.05));
  display: flex; align-items: center; justify-content: center;
}
.lf-card-photo-placeholder i {
  font-size: 28px; color: #6750A4; opacity: .6;
}
.lf-card-body { flex: 1; min-width: 0; padding: 10px 12px 10px 0; }
.lf-card-top {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 900; letter-spacing: .8px;
  text-transform: uppercase; margin-bottom: 5px; flex-wrap: wrap;
}
.lf-badge-lost { color: #EF4444; background: rgba(239,68,68,.1); padding: 2px 7px; border-radius: 6px; }
.lf-badge-found { color: #10B981; background: rgba(16,185,129,.1); padding: 2px 7px; border-radius: 6px; }
.lf-badge-cat {
  color: var(--text-soft); background: rgba(15,23,42,.06);
  padding: 2px 7px; border-radius: 6px;
}
.lf-badge-status-returned { color: #10B981; background: rgba(16,185,129,.1); padding: 2px 7px; border-radius: 6px; }
.lf-badge-status-closed { color: var(--text-muted); background: rgba(148,163,184,.15); padding: 2px 7px; border-radius: 6px; }
.lf-card-title {
  font-size: 14.5px; font-weight: 900; color: var(--text);
  line-height: 1.3; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lf-card-desc {
  font-size: 12px; color: var(--text-soft); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 5px;
}
.lf-card-meta {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 10.5px; color: var(--text-muted); font-weight: 700;
}
.lf-card-meta i { font-size: 9px; }
.lf-card-meta .lf-meta-dot { width: 3px; height: 3px; border-radius: 50%; background: #94A3B8; opacity: .5; }

.lf-card-inquiry-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #6750A4, #4F378B);
  color: #fff; font-size: 10px; font-weight: 900;
  padding: 3px 8px; border-radius: 999px;
}

.lf-load-more {
  display: block; margin: 14px auto;
  padding: 9px 20px; border-radius: 20px;
  background:var(--card-bg); border: 1px solid rgba(15,23,42,.08);
  color: var(--text-soft); font-size: 13px; font-weight: 800;
  font-family: inherit; cursor: pointer;
}
.lf-load-more:active { transform: scale(.96); }

/* ─── Bottom-nav tabs (pattern Phase 12) ─── */
.lf-tabs {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background:var(--card-bg);
  border-top: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 30;
}
.lf-tab {
  flex: 1; min-width: 0; padding: 9px 4px 10px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; font-weight: 700;
  transition: color .15s ease;
  position: relative;
}
.lf-tab i { font-size: 18px; }
.lf-tab.active { color: #6750A4; }
.lf-tab.active::after {
  content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px;
  background: linear-gradient(135deg, #6750A4, #4F378B); border-radius: 0 0 3px 3px;
}
.lf-tab-badge {
  position: absolute; top: 4px; right: calc(50% - 22px);
  background: #EF4444; color: #fff;
  font-size: 9px; font-weight: 900;
  padding: 1px 5px; border-radius: 999px; min-width: 14px; text-align: center;
}

/* ─── Modals (détail / post / chat) ─── */
.lf-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,23,42,.5);
  display: none; align-items: flex-end; justify-content: center;
}
.lf-overlay.open { display: flex; animation: lfOverlayFade .2s ease; }
@keyframes lfOverlayFade { from { opacity: 0; } to { opacity: 1; } }
.lf-modal {
  background:var(--card-bg); width: 100%; max-width: 760px;
  border-radius: 16px 16px 0 0;
  max-height: 92vh; height: 92vh;
  display: flex; flex-direction: column;
  animation: lfModalSlide .25s ease;
}
@keyframes lfModalSlide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.lf-modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid rgba(15,23,42,.06);
  flex-shrink: 0;
}
.lf-modal-back {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: rgba(15,23,42,.06); color: var(--text); font-size: 14px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lf-modal-back:active { transform: scale(.92); background: rgba(15,23,42,.1); }
.lf-modal-head span { font-size: 14.5px; font-weight: 900; flex: 1; }
.lf-modal-scroll { flex: 1; overflow-y: auto; padding: 16px 16px 32px; }

/* Détail modal */
.lf-detail-photo {
  width: 100%; max-height: 320px; object-fit: cover;
  border-radius: 14px; background: rgba(15,23,42,.05);
  margin-bottom: 14px; cursor: zoom-in;
}
.lf-detail-photo-placeholder {
  width: 100%; height: 200px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(103, 80, 164,.12), rgba(232,85,0,.05));
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.lf-detail-photo-placeholder i { font-size: 44px; color: #6750A4; opacity: .6; }

.lf-detail-title { font-size: 19px; font-weight: 900; color: var(--text); margin-bottom: 10px; line-height: 1.3; letter-spacing: -.2px; }
.lf-detail-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--text-muted); font-weight: 700; margin-bottom: 14px; }
.lf-detail-desc { font-size: 14px; line-height: 1.65; color: var(--text); margin-bottom: 18px; white-space: pre-wrap; }
.lf-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.lf-detail-btn {
  padding: 10px 16px; border-radius: 10px; border: none;
  font-size: 13.5px; font-weight: 800; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.lf-btn-primary { background: linear-gradient(135deg, #6750A4, #4F378B); color: #fff; box-shadow: 0 4px 12px rgba(103, 80, 164,.32); }
.lf-btn-secondary { background:var(--card-bg); border: 1px solid rgba(15,23,42,.1); color: var(--text); }
.lf-btn-danger { background: rgba(239,68,68,.1); color: #EF4444; }
.lf-btn-success { background: rgba(16,185,129,.12); color: #10B981; }
.lf-detail-btn:active { transform: scale(.96); }

.lf-detail-inquiries { margin-top: 22px; border-top: 1px solid rgba(15,23,42,.06); padding-top: 18px; }
.lf-detail-inq-title { font-size: 14px; font-weight: 900; margin-bottom: 12px; color: var(--text); }
.lf-detail-inq-title i { color: #6750A4; margin-right: 6px; }
.lf-inquiry-row {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(15,23,42,.05); margin-bottom: 8px;
}
.lf-inquiry-row:active { background: rgba(103, 80, 164,.04); }
.lf-inquiry-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #6750A4, #4F378B);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 900; flex-shrink: 0;
}
.lf-inquiry-info { flex: 1; min-width: 0; }
.lf-inquiry-pseudo { font-size: 13.5px; font-weight: 800; color: var(--text); }
.lf-inquiry-preview { font-size: 11.5px; color: var(--text-soft); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.lf-inquiry-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.lf-inquiry-time { font-size: 10.5px; color: var(--text-muted); font-weight: 700; }
.lf-inquiry-unread {
  background: #6750A4; color: #fff;
  font-size: 10px; font-weight: 900;
  padding: 1px 6px; border-radius: 999px; min-width: 16px; text-align: center;
}

/* Post modal */
.lf-type-row { display: flex; gap: 8px; margin-bottom: 16px; }
.lf-type-btn {
  flex: 1; padding: 10px 12px; border-radius: 10px;
  background:var(--card-bg); border: 1px solid rgba(15,23,42,.1);
  color: var(--text-soft); font-size: 13px; font-weight: 800;
  font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.lf-type-btn.active[data-type="lost"] { background: rgba(239,68,68,.1); color: #EF4444; border-color: rgba(239,68,68,.3); }
.lf-type-btn.active[data-type="found"] { background: rgba(16,185,129,.12); color: #10B981; border-color: rgba(16,185,129,.3); }
.lf-form { display: flex; flex-direction: column; gap: 14px; }
.lf-form-field { display: flex; flex-direction: column; }
.lf-form-label { font-size: 11.5px; font-weight: 800; color: var(--text-soft); margin-bottom: 5px; }
.lf-form input[type="text"],
.lf-form textarea,
.lf-form select {
  padding: 10px 12px; border-radius: 10px;
  background:var(--card-bg); border: 1px solid rgba(15,23,42,.1);
  font-size: 14px; font-family: inherit; color: var(--text);
  resize: vertical;
}
.lf-form input[type="text"]:focus,
.lf-form textarea:focus,
.lf-form select:focus { outline: 2px solid rgba(103, 80, 164,.3); border-color: rgba(103, 80, 164,.5); }
.lf-photo-add {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px; border-radius: 10px;
  background: rgba(103, 80, 164,.06); border: 1px dashed rgba(103, 80, 164,.4);
  color: #6750A4; font-size: 13px; font-weight: 800;
  font-family: inherit; cursor: pointer;
}
.lf-photo-add:active { background: rgba(103, 80, 164,.12); }
.lf-photo-preview { width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; margin-top: 4px; }
.lf-gps-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-soft); font-weight: 700; cursor: pointer;
}
.lf-gps-toggle input { accent-color: #6750A4; }
.lf-gps-toggle i { color: #6750A4; }
.lf-submit-btn {
  padding: 12px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #6750A4, #4F378B);
  color: #fff; font-size: 14.5px; font-weight: 900;
  font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(103, 80, 164,.32);
}
.lf-submit-btn:disabled { opacity: .6; cursor: default; }
.lf-submit-btn:active:not(:disabled) { transform: scale(.97); }
.err { color: #EF4444; font-size: 12.5px; }

/* Photo viewer fullscreen */
.lf-photo-fs {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.lf-photo-fs[hidden] { display: none; }
.lf-photo-fs img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lf-photo-fs-close {
  position: absolute; top: calc(env(safe-area-inset-top, 0) + 14px); right: 14px;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.18); color: #fff; font-size: 16px; cursor: pointer;
}

/* Chat modal */
.lf-chat-modal { height: 92vh; max-height: 92vh; }
.lf-chat-head { background: linear-gradient(135deg, #6750A4, #4F378B); color: #fff; border-bottom: none; }
.lf-chat-head .lf-modal-back { background: rgba(255,255,255,.22); color: #fff; }
.lf-chat-head-info { flex: 1; min-width: 0; }
.lf-chat-head-name { font-size: 14.5px; font-weight: 900; color: #fff; line-height: 1.2; }
.lf-chat-head-sub { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.85); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.lf-chat-msgs {
  flex: 1; overflow-y: auto; padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-soft);
}
.lf-chat-bubble {
  max-width: 78%; padding: 8px 12px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.45; word-break: break-word;
}
.lf-chat-bubble.mine {
  align-self: flex-end;
  background: linear-gradient(135deg, #6750A4, #4F378B);
  color: #fff; border-bottom-right-radius: 4px;
}
.lf-chat-bubble.other {
  align-self: flex-start;
  background:var(--card-bg); color: var(--text);
  border: 1px solid rgba(15,23,42,.06);
  border-bottom-left-radius: 4px;
}
.lf-chat-bubble-time {
  font-size: 9.5px; opacity: .7; margin-top: 3px; font-weight: 700;
}
.lf-chat-input-bar {
  display: flex; gap: 8px;
  padding: 10px 12px calc(env(safe-area-inset-bottom, 0) + 10px);
  border-top: 1px solid rgba(15,23,42,.06);
  background:var(--card-bg); flex-shrink: 0;
}
.lf-chat-input {
  flex: 1; padding: 10px 14px; border-radius: 20px;
  background: var(--bg-soft); border: none;
  font-size: 14px; font-family: inherit; color: var(--text);
  outline: none;
}
.lf-chat-input:focus { background:var(--card-bg); box-shadow: 0 0 0 2px rgba(103, 80, 164,.25); }
.lf-chat-send {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #6750A4, #4F378B); color: #fff;
  font-size: 14px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.lf-chat-send:active { transform: scale(.92); }
.lf-chat-send:disabled { opacity: .55; }
