/* Pickup pages: pickupform.html (request) and mypickups.html (history) */

main > .container { padding-top: 30px; padding-bottom: 40px; }

/* ---------- Request form ---------- */
.pickup-card { background: var(--card-bg); border-radius: 20px; padding: 40px; box-shadow: var(--shadow); max-width: 900px; margin: 0 auto; border: 1px solid rgba(128, 128, 128, 0.2); }
.pickup-card h2 { display: flex; align-items: center; gap: 10px; color: var(--primary-color); margin-bottom: 30px; }
.pickup-card .field input, .pickup-card .field textarea { padding: 14px 16px; border-radius: 12px; }
/* Condition of the items (dropdown) */
.pickup-card .field select { width: 100%; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--border-color); background: var(--card-bg); color: inherit; font: inherit; }
.pickup-card .field input[type="file"] { padding: 10px; }
/* Back link (top of card) and Back / Next buttons */
.back-link { display: inline-flex; align-items: center; gap: 8px; background: none; border: none; color: var(--primary-color); font-weight: 600; font-size: 0.95rem; cursor: pointer; margin-bottom: 15px; padding: 4px 0; }
.back-link:hover { text-decoration: underline; }
.form-actions { display: flex; gap: 12px; }
.form-actions .btn-large { width: auto; }
.btn-back { flex: 1; background: transparent; color: var(--primary-color); border: 2px solid var(--primary-color); }
.btn-back:hover { background: var(--primary-color); color: #fff; }
.btn-next { flex: 2; }

.location-row { display: flex; gap: 10px; }
.location-row .suggest-wrap { flex: 1; }
.location-row .btn { white-space: nowrap; border-radius: 12px; padding: 0 16px; }

/* Drop-a-pin map (js/components/pin-picker.js) */
.pin-map-wrap { position: relative; height: 300px; margin-top: 12px; border-radius: 12px; overflow: hidden; border: 2px solid var(--border-color); }
.pin-map { position: absolute; inset: 0; background: #f2f1ef; }
.dark-mode .pin-map { background: #1f2429; }
.pin-map-error { height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; text-align: center; color: var(--muted-text); }
/* The pin sits in the middle with its tip on the exact centre of the map */
.center-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); pointer-events: none; z-index: 2; display: flex; flex-direction: column; align-items: center; }
.center-pin i { font-size: 42px; color: #e53935; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4)); transition: transform 0.15s ease; }
.pin-shadow { width: 12px; height: 4px; border-radius: 50%; background: rgba(0, 0, 0, 0.35); margin-top: -3px; transition: transform 0.15s ease, opacity 0.15s ease; }
/* While the map is being dragged the pin lifts up */
.pin-map-wrap.moving .center-pin i { transform: translateY(-10px); }
.pin-map-wrap.moving .pin-shadow { transform: scale(1.6); opacity: 0.5; }
.pin-map-wrap .maplibregl-ctrl-attrib { font-size: 10px; }
.dark-mode .pin-map-wrap .maplibregl-ctrl-group { background-color: #2d2d2d; }
.dark-mode .pin-map-wrap .maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1); }
#locationHint.pin-set { color: var(--primary-color); font-weight: 600; }

/* ---------- Photo of the items (request form) ---------- */
.photo-drop { width: 100%; padding: 28px 16px; border: 2px dashed var(--border-color); border-radius: 12px; background: transparent; color: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; font: inherit; transition: 0.2s; }
.photo-drop i { font-size: 1.8rem; color: var(--primary-color); }
.photo-drop:hover, .photo-drop:focus-visible { border-color: var(--primary-color); outline: none; }
.photo-preview { position: relative; margin-top: 4px; }
.photo-preview img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; display: block; }
.photo-remove { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.65); color: #fff; cursor: pointer; }

.recycler-match { background: var(--light-bg); border-radius: 16px; padding: 20px; margin-top: 20px; border: 2px solid var(--primary-color); }
.recycler-match h3 { color: var(--primary-color); display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.match-intro { font-size: 0.9rem; color: var(--muted-text); margin-bottom: 15px; }
.match-card { background: var(--card-bg); border-radius: 12px; padding: 20px; margin-bottom: 15px; border: 2px solid transparent; cursor: pointer; transition: 0.2s; }
.match-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.match-card:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
.match-card.selected { border-color: var(--primary-color); background: rgba(46, 125, 50, 0.05); }
.match-name { display: block; font-size: 1.2rem; font-weight: 600; margin-bottom: 8px; }
.match-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 15px 0 5px; }
.match-detail { text-align: center; }
.match-detail .label { display: block; font-size: 0.7rem; color: var(--muted-text); text-transform: uppercase; }
.match-detail .value { font-size: 1.1rem; font-weight: 600; }
.selection-indicator { text-align: right; color: var(--primary-color); font-size: 0.9rem; }
.selection-status { margin: 15px 0; padding: 10px; background: var(--card-bg); border-radius: 8px; text-align: center; }
#confirmBtn { margin-top: 10px; }

.success-box { text-align: center; margin-top: 10px; padding: 30px; background: #f0fdf4; border-radius: 16px; color: #166534; }
.dark-mode .success-box { background: #1e3a2e; color: #b9f5c5; }
.success-box > i { font-size: 3.5rem; margin-bottom: 15px; color: #16a34a; display: block; }
.success-details { background: #dcfce7; border-radius: 10px; padding: 15px; margin-top: 15px; text-align: left; line-height: 1.8; }
.dark-mode .success-details { background: #2b4b35; color: #e6f4ea; }
.qr-wrap { padding: 15px; background: #fff; border-radius: 12px; display: inline-block; }
.success-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
.success-actions .btn { flex: 1 1 200px; padding: 14px 20px; font-size: 1rem; }

/* ---------- My pickups ---------- */
.pickups-page { max-width: 900px; }
.pickups-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 15px; flex-wrap: wrap; margin-bottom: 20px; }
.pickups-toolbar h2 { margin: 0; color: var(--primary-color); display: flex; align-items: center; gap: 10px; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 25px; }
.summary-box { background: var(--card-bg); border-radius: 14px; padding: 18px; text-align: center; box-shadow: var(--shadow); border: 1px solid rgba(128, 128, 128, 0.2); }
.summary-box .num { font-size: 1.8rem; font-weight: 700; color: var(--primary-color); }
.summary-box .lbl { font-size: 0.85rem; opacity: 0.8; }
.pickup-item { background: var(--card-bg); border-radius: 16px; padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); border: 1px solid rgba(128, 128, 128, 0.2); border-left: 5px solid var(--secondary-color); }
.pickup-item.verified { border-left-color: var(--primary-color); }
.pickup-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pickup-code { font-size: 1.35rem; font-weight: 800; letter-spacing: 1px; }
.pickup-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; font-size: 0.95rem; }
.pickup-grid p { display: flex; gap: 8px; align-items: flex-start; }
.pickup-grid i { color: var(--primary-color); width: 16px; margin-top: 4px; }
.pickup-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 15px; padding-top: 12px; border-top: 1px solid rgba(128, 128, 128, 0.2); font-size: 0.9rem; }
.points { font-weight: 600; color: var(--primary-color); }
.qr-toggle { background: none; border: 2px solid var(--primary-color); color: var(--primary-color); padding: 8px 14px; border-radius: 10px; font-weight: 600; cursor: pointer; }
.qr-toggle:hover { background: var(--primary-color); color: #fff; }
.qr-box { margin-top: 15px; text-align: center; }
.qr-box canvas { background: #fff; padding: 10px; border-radius: 12px; }

/* Photo on each pickup (My pickups) */
.pickup-photo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 15px; }
.pickup-thumb { width: 100%; max-width: 220px; height: 140px; object-fit: cover; border-radius: 10px; cursor: zoom-in; display: block; }
.pickup-thumb--empty { display: flex; align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--border-color); cursor: default; opacity: 0.7; }
.btn-link { background: none; border: 0; padding: 6px 0; color: var(--primary-color); font: inherit; font-weight: 600; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.btn-link:disabled { opacity: 0.6; cursor: wait; text-decoration: none; }

/* Thumbnails with a caption (customer photo / photo at collection) */
.thumb-fig { margin: 0; }
.thumb-fig figcaption { font-size: 0.75rem; opacity: 0.75; margin-top: 4px; }

/* Full-screen photo viewer (shared with the recycler dashboard) */
.photo-lightbox { position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, 0.85); display: flex; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.photo-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.photo-lightbox button { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.2); color: #fff; cursor: pointer; }

@media (max-width: 768px) {
  .pickup-card { padding: 25px 18px; }
  .location-row { flex-direction: column; }
  .location-row .btn { padding: 12px 16px; }
  .form-actions .btn-large { padding: 14px 12px; white-space: nowrap; }
  .pin-map-wrap { height: 260px; }
  .pickup-grid { grid-template-columns: 1fr; }
  .summary-box .num { font-size: 1.4rem; }
  .pickup-thumb { max-width: 100%; }
}