/* Fotozoeker (js/photo-search.js) */
.ps { display: flex; flex-direction: column; gap: 14px; }
/* Volle breedte, net als Home */
.container:has(> #tab-photos.active) { max-width: 1920px; padding: 18px 24px; }
.ps-hero { margin-bottom: 0; }
.ps-hero p { max-width: 980px; }
.ps-bar { display: flex; flex-direction: column; gap: 10px; }
.ps-search { display: flex; gap: 8px; }
.ps-search .input { flex: 1; min-width: 0; padding: 9px 12px; font-size: .95rem; }
.ps-search .btn { flex: none; padding-left: 22px; padding-right: 22px; }
.ps .input { border: 1px solid var(--border); border-radius: var(--radius); background: var(--input-bg); color: var(--text); padding: 6px 10px; font-size: .85rem; }
.ps-ex, .ps-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ps-ex .muted, .ps-tags .muted { font-size: .8rem; margin-right: 2px; }
.ps-tags:empty { display: none; }
.ps-tags small { color: var(--muted); margin-left: 3px; }
.ps-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 10px; border-top: 1px solid var(--border); }
.ps-filters select { max-width: 320px; }
.ps-date, .ps-tog { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; color: var(--muted); }
.ps-sit { display: flex; flex-wrap: wrap; gap: 6px; }
.ps-chip { display: inline-flex; align-items: center; gap: 5px; border-left: 3px solid var(--c); }
.ps-chip b { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.ps-chip.is-on { background: var(--c); border-color: var(--c); color: #fff; }
.ps-chip.is-on b { color: #fff; }
.ps-reset { margin-left: auto; }

.ps-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 14px; align-items: start; }
.ps-mapcol { position: sticky; top: calc(var(--topbar-h, 64px) + 8px); display: flex; flex-direction: column; gap: 8px; padding: 12px; }
#ps-map { height: min(68vh, 760px); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.ps-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .72rem; color: var(--muted); }
.ps-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ps-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px #003C71; }
.ps-dot.is-gps { background: #FF3300; } .ps-dot.is-punt { background: #0EA5E9; } .ps-dot.is-project { background: #94a3b8; box-shadow: 0 0 0 1.5px #64748b; border-style: dashed; }

.ps-pin { position: absolute; left: -24px; top: -52px; width: 48px; height: 48px; border-radius: 12px; border: 3px solid #FF3300; background: #e2e8f0;
    box-shadow: 0 4px 12px rgba(1,30,65,.35); cursor: pointer; transition: transform .12s; }
.ps-pin::after { content: ''; position: absolute; left: 50%; bottom: -9px; margin-left: -6px; border: 6px solid transparent; border-top-color: inherit; border-bottom: 0; }
.ps-pin.is-gps { border-color: #FF3300; } .ps-pin.is-punt { border-color: #0EA5E9; } .ps-pin.is-project { border-color: #94a3b8; border-style: dashed; }
.ps-pin img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.ps-pin b { position: absolute; top: -9px; right: -11px; min-width: 22px; padding: 1px 6px; border-radius: 99px; background: #011E41; color: #fff;
    font-size: .7rem; font-weight: 800; text-align: center; border: 2px solid #fff; font-variant-numeric: tabular-nums; }
.ps-pin:hover, .ps-pin.is-hot { transform: scale(1.25) translateY(-4px); z-index: 10; }
.ps-pin.is-hot { box-shadow: 0 0 0 4px rgba(255,51,0,.35), 0 6px 16px rgba(1,30,65,.4); }
.ps-pin.is-dim { opacity: .35; filter: grayscale(1); }

.ps-time { padding: 6px 8px 2px; border: 1px solid var(--border); border-radius: var(--r-md, 8px); background: var(--card); }
.ps-time:empty { display: none; }
.ps-bars { display: flex; align-items: flex-end; gap: 1px; height: 46px; }
.ps-bars button { flex: 1; height: 100%; display: flex; align-items: flex-end; padding: 0; border: 0; background: transparent; cursor: pointer; min-width: 2px; }
.ps-bars button i { display: block; width: 100%; border-radius: 2px 2px 0 0; background: #003C71; opacity: .7; }
.ps-bars button:hover i { opacity: 1; background: #0EA5E9; }
.ps-bars button.is-on i { background: #FF3300; opacity: 1; }
.ps-bars button.is-0 { cursor: default; }
.ps-years { display: flex; font-size: .66rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 2px; }
.ps-years span { padding-left: 3px; border-left: 1px solid var(--border); overflow: hidden; white-space: nowrap; }

.ps-listcol { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ps-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: center; font-size: .88rem; }
.ps-count { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.ps-note { display: block; font-size: .75rem; color: var(--warn); }
.ps-busy { color: var(--muted); } .ps-err { color: var(--danger); }
.ps-clear { display: flex; gap: 6px; flex-wrap: wrap; }
.ps-clear button { padding: 4px 10px; border-radius: 99px; border: 1px solid #FF3300; background: rgba(255,51,0,.08); color: var(--text); font-size: .78rem; cursor: pointer; }
.ps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ps-card { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
    color: var(--text); text-align: left; cursor: pointer; overflow: hidden; transition: transform .12s, box-shadow .12s, border-color .12s; }
.ps-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); border-color: #0EA5E9; }
.ps-thumb { position: relative; display: block; aspect-ratio: 4 / 3; min-height: 0; overflow: hidden; background: var(--card-elev); }
.ps-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ps-thumb i { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 99px; background: var(--c); color: #fff; font-style: normal; font-size: .68rem; font-weight: 700;
    box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.ps-cbody { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; min-width: 0; }
.ps-cbody b { font-size: .8rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ps-cbody small { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-empty { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 40px 12px; border: 1px dashed var(--border); border-radius: var(--r-lg); color: var(--muted); }
.ps-empty b { color: var(--text); }
.ps-more { align-self: center; }
.ps-listcol { padding: 12px 14px; }

body.ps-noscroll { overflow: hidden; }
.ps-lb { position: fixed; inset: 0; z-index: 20000; display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px 360px; align-items: center;
    background: rgba(2,8,20,.94); color: #e2e8f0; }
.ps-lb[hidden] { display: none; }
.ps-lb-fig { margin: 0; height: 100vh; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; min-width: 0; }
.ps-lb-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; cursor: zoom-in; margin-top: 12px; }
.ps-lb-stage.is-zoomed { cursor: grab; }
.ps-lb-stage.is-zoomed:active { cursor: grabbing; }
.ps-lb-fig img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.6); transform-origin: center; will-change: transform; user-select: none; -webkit-user-drag: none; }
.ps-lb-fig figcaption { display: flex; align-items: center; justify-content: center; gap: 14px; padding-bottom: 10px; font-size: .78rem; color: #94a3b8; font-variant-numeric: tabular-nums; }
.ps-lb-zoom { display: inline-flex; border: 1px solid rgba(255,255,255,.2); border-radius: 99px; overflow: hidden; }
.ps-lb-zoom button { min-width: 34px; padding: 4px 10px; border: 0; background: rgba(255,255,255,.08); color: #fff; font-size: .85rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.ps-lb-zoom button:hover { background: rgba(255,255,255,.2); }
.ps-lb-zoom button + button { border-left: 1px solid rgba(255,255,255,.15); }
.ps-lb-nav { height: 64px; width: 44px; justify-self: center; border: 0; border-radius: 10px; background: rgba(255,255,255,.08); color: #fff; font-size: 2rem; cursor: pointer; }
.ps-lb-nav:hover { background: rgba(255,255,255,.2); }
.ps-lb-x { position: absolute; top: 12px; right: 372px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 1.1rem; cursor: pointer; }
.ps-lb-info { height: 100vh; overflow: auto; padding: 22px 20px; box-sizing: border-box; background: #0F1F38; border-left: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 10px; }
.ps-lb-info h3 { margin: 0; font-size: 1.05rem; color: #fff; }
.ps-lb-ai { margin: 0; padding: 10px 12px; border-radius: 10px; background: linear-gradient(135deg, rgba(14,165,233,.18), rgba(126,87,194,.18)); border: 1px solid rgba(14,165,233,.35);
    font-size: .86rem; line-height: 1.45; color: #e2e8f0; }
.ps-lb-ai span { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #7dd3fc; margin-bottom: 3px; }
.ps-lb-ai.is-wait { opacity: .7; }
.ps-lb-sit { align-self: flex-start; padding: 3px 10px; border-radius: 99px; background: var(--c); color: #fff; font-size: .75rem; font-weight: 700; }
.ps-lb-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ps-lb-tags button { padding: 3px 10px; border-radius: 99px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #e2e8f0; font-size: .75rem; cursor: pointer; }
.ps-lb-tags button:hover { border-color: #FF3300; background: rgba(255,51,0,.2); }
.ps-lb-info dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: .8rem; }
.ps-lb-info dt { color: #94a3b8; } .ps-lb-info dd { margin: 0; color: #e2e8f0; word-break: break-word; }
#ps-lb-map { height: 150px; border-radius: 10px; overflow: hidden; flex: none; }
.ps-lb-src { margin: 0; font-size: .68rem; color: #64748b; word-break: break-all; }
.ps-lb-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.ps-lb-act .btn { padding: 7px 12px; border-radius: 99px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font-size: .8rem; text-decoration: none; cursor: pointer; }
.ps-lb-act .btn:hover { background: rgba(255,255,255,.18); }

/* Foto's toevoegen (idee #132): venster over de pagina */
.ps-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ps-addbtn { flex: none; white-space: nowrap; }
.ps-upov { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(1,30,65,.55); backdrop-filter: blur(3px); }
.ps-upov[hidden] { display: none; }
.ps-upov .input { border: 1px solid var(--border); border-radius: var(--radius); background: var(--input-bg); color: var(--text); padding: 6px 10px; font-size: .85rem; }
.ps-up { display: flex; flex-direction: column; gap: 12px; width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; margin: 0;
    box-shadow: 0 24px 60px rgba(1,30,65,.35); border-radius: var(--r-lg, 12px); }
.ps-uppill { position: fixed; left: 20px; bottom: 20px; max-width: calc(100vw - 120px); z-index: 1100; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 99px;
    background: #011E41; color: #fff; font-size: .85rem; font-weight: 600; box-shadow: 0 8px 24px rgba(1,30,65,.35); cursor: pointer; }
.ps-uppill[hidden] { display: none; }
.ps-uppill.is-done { background: #00875A; }
/* Voortgang via de assistent: ring om de knop en een tekstwolk links ervan. */
#as-fab.ps-working::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none;
    background: conic-gradient(#00C27A var(--ps-p, 0%), rgba(255,255,255,.25) 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px)); }
#as-fab.ps-working .as-fab-tip { display: none; }
.ps-say { position: fixed; right: 100px; bottom: 28px; z-index: 1199; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 190px; max-width: calc(100vw - 130px);
    padding: 9px 14px; border: 1px solid #d7e3f1; border-radius: 16px 16px 4px 16px; background: #fff; color: #011E41; font-size: .82rem; text-align: left; cursor: pointer;
    box-shadow: 0 10px 28px rgba(1,30,65,.22); animation: psSay .35s cubic-bezier(.2,1.4,.4,1); }
.ps-say::after { content: ''; position: absolute; right: -7px; bottom: 10px; width: 12px; height: 12px; background: #fff; border: solid #d7e3f1; border-width: 1px 1px 0 0; transform: rotate(45deg); }
.ps-say b { font-weight: 700; }
.ps-say span { color: #5b6b80; font-size: .76rem; }
.ps-say.is-done { border-color: #9fdcc0; background: #effaf5; }
.ps-say.is-done::after { background: #effaf5; border-color: #9fdcc0; }
.ps-say-bar { display: block; width: 100%; height: 4px; margin-top: 4px; border-radius: 2px; background: #e6edf5; overflow: hidden; }
.ps-say-bar i { display: block; height: 100%; background: linear-gradient(90deg, #003C71, #00C27A); transition: width .4s; }
@keyframes psSay { from { opacity: 0; transform: translateX(14px) scale(.9); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .ps-say { right: 88px; bottom: 20px; } }
.ps-spin { width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: ps-spin .8s linear infinite; }
@keyframes ps-spin { to { transform: rotate(360deg); } }
.ps-up-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ps-up-head h2 { margin: 0; font-size: 1.05rem; }
.ps-up p { margin: 0; font-size: .82rem; }
.ps-up-opts { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.ps-up-opts label, .ps-up-after label { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.ps-up-opts .input { width: 240px; max-width: 100%; }
.ps-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--border); border-radius: var(--r-lg, 12px);
    background: var(--card-elev); text-align: center; transition: border-color .12s, background .12s; }
.ps-drop b { font-size: 1rem; }
.ps-drop .muted { font-size: .78rem; }
.ps-drop.is-over { border-color: #0EA5E9; background: rgba(14,165,233,.08); }
.ps-up-prog { display: flex; flex-direction: column; gap: 8px; }
.ps-up-bar { height: 8px; border-radius: 99px; background: var(--card-elev); overflow: hidden; border: 1px solid var(--border); }
.ps-up-bar i { display: block; height: 100%; background: linear-gradient(90deg, #003C71, #0EA5E9); transition: width .25s; }
.ps-up-after { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ps-up-after .input { width: 160px; }
.ps-up-fails { font-size: .78rem; } .ps-up-fails ul { margin: 6px 0 0; padding-left: 18px; max-height: 180px; overflow: auto; }

/* Bewerken in de lightbox */
.ps-lb-edit { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.04); }
.ps-lb-edit > b { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; }
.ps-lb-tools, .ps-lb-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ps-lb-edit .btn { padding: 5px 10px; border-radius: 99px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font-size: .78rem; cursor: pointer; }
.ps-lb-edit .btn.primary { background: #0EA5E9; border-color: #0EA5E9; }
.ps-lb-edit .btn:disabled { opacity: .5; cursor: default; }
.ps-lb-meta label { display: flex; flex-direction: column; gap: 2px; font-size: .72rem; color: #94a3b8; width: 100%; }
.ps-lb-meta .input { border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(0,0,0,.25); color: #fff; padding: 6px 9px; font-size: .82rem; }
.ps-lb-edmsg { margin: 0; min-height: 1em; font-size: .75rem; color: #7dd3fc; }
.ps-crop { position: absolute; z-index: 3; cursor: crosshair; touch-action: none; }
.ps-crop-sel { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0,0,0,.55); cursor: move; }
.ps-crop-sel i { position: absolute; width: 16px; height: 16px; border-radius: 4px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.ps-crop-sel i[data-h="nw"] { left: -9px; top: -9px; cursor: nwse-resize; } .ps-crop-sel i[data-h="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.ps-crop-sel i[data-h="ne"] { right: -9px; top: -9px; cursor: nesw-resize; } .ps-crop-sel i[data-h="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.ps-crop-bar { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px;
    border-radius: 99px; background: rgba(15,31,56,.92); color: #fff; font-size: .78rem; white-space: nowrap; cursor: default; }
.ps-crop-bar .btn { border-radius: 99px; }

@media (max-width: 1100px) {
    .ps-main { grid-template-columns: 1fr; }
    .ps-mapcol { position: static; }
    #ps-map { height: 46vh; }
}
@media (max-width: 760px) {
    .container:has(> #tab-photos.active) { padding: 12px; }
    .ps-search button { padding: 9px 14px; }
    .ps-reset { margin-left: 0; }
    .ps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ps-lb { grid-template-columns: 1fr; grid-template-rows: 55vh auto; overflow: auto; align-items: start; }
    .ps-lb-nav { position: absolute; top: 24vh; z-index: 2; } .ps-lb-nav.is-prev { left: 6px; } .ps-lb-nav.is-next { right: 6px; }
    .ps-lb-fig { height: 55vh; }
    .ps-lb-x { right: 12px; }
    .ps-lb-info { height: auto; }
    .ps-hero { flex-direction: column; }
    .ps-crop-bar span { display: none; }
}
