/* XploreR website · accounts, dialogs and personal pages (profile, trips, member profiles) */

:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

/* header account button and menu */
.xr-account { position: relative; flex: none; }
.xr-me { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.xr-avatar { border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; flex: none; background: var(--blue); color: #fff; font-weight: 900; }
.xr-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 250px; border-radius: 16px; padding: 6px; z-index: 50; background: var(--glass-strong); }
.xr-menu a, .xr-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 11px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 14px; text-align: left; }
.xr-menu a:hover, .xr-menu button:hover { background: var(--fill-2); }
.xr-menu-head { display: flex; gap: 10px; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.xr-menu-head small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.xr-count { margin-left: auto; color: var(--muted); font-weight: 800; }

/* dialogs */
.xr-modal { position: fixed; inset: 0; z-index: 80; background: rgba(4, 8, 14, .55); display: grid; place-items: center; padding: 16px; animation: xrfade .15s; }
@keyframes xrfade { from { opacity: 0; } }
.xr-dialog { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 24px; padding: 26px 24px 20px; background: var(--panel-solid); }
.xr-dialog.wide { width: min(640px, 100%); }
.xr-dialog h2 { margin: 4px 0 6px; font-size: 22px; letter-spacing: -.01em; }
.xr-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--fill-2); }
.xr-brand { font-weight: 900; font-size: 22px; margin-bottom: 6px; }
.xr-brand b { color: var(--amber); }
.xr-reason { margin: 0 0 12px; color: var(--muted); }
.xr-tabs { display: flex; background: var(--fill-2); border-radius: 12px; padding: 3px; margin: 8px 0 14px; }
.xr-tabs button { flex: 1; padding: 8px; border-radius: 9px; font-weight: 800; color: var(--muted); }
.xr-tabs button.on { background: var(--panel-solid); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.xr-dialog form, .xr-form { display: grid; gap: 11px; }
.xr-dialog label, .xr-form label { display: grid; gap: 5px; font-size: 13px; font-weight: 800; color: var(--muted); }
.xr-dialog input:not([type=checkbox]):not([type=radio]):not([type=file]), .xr-dialog textarea, .xr-dialog select,
.xr-form input:not([type=checkbox]):not([type=radio]):not([type=file]), .xr-form textarea, .xr-form select {
  width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--fill); color: var(--text); font-size: 15px; font-weight: 500; outline: none; }
.xr-dialog input:focus, .xr-dialog textarea:focus, .xr-form input:focus, .xr-form textarea:focus, .xr-form select:focus { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(79,179,240,.2); }
.xr-form select option { color: #000; }
.xr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xr-file input { font-size: 13px; font-weight: 500; color: var(--text); }
.xr-submit { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.xr-link { color: var(--blue-2); font-weight: 700; font-size: 14px; padding: 6px; justify-self: center; display: block; margin: 2px auto 0; }
.xr-note { color: var(--muted); font-size: 13px; margin: 4px 0; }
.xr-note.center { text-align: center; margin-top: 12px; }
.xr-note a { color: var(--blue-2); }
.xr-error { color: #ff7a6a; background: rgba(255,90,60,.1); border-radius: 10px; padding: 8px 10px; margin: 0; font-size: 14px; font-weight: 600; }
.xr-bell { font-size: 40px; }
.xr-interests { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 14px 0; }
.xr-int { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--fill); font-weight: 800; font-size: 14px; text-align: left; }
.xr-int span { font-size: 18px; }
.xr-int.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); }
.xr-leads { display: grid; gap: 8px; margin: 14px 0 10px; }
.xr-lead { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--fill); color: var(--text) !important; font-size: 15px !important; font-weight: 700 !important; cursor: pointer; }
.xr-lead input { width: 18px; height: 18px; accent-color: var(--blue); }
.xr-switch { display: flex !important; align-items: center; gap: 10px; color: var(--text) !important; font-size: 15px !important; margin-bottom: 8px; }
.xr-switch input { width: 18px; height: 18px; accent-color: var(--blue); }

/* pop-up messages (the map page has its own; this covers the other pages) */
#xr-toast { position: fixed; z-index: 90; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; transition: all .3s;
  pointer-events: none; padding: 10px 16px; border-radius: 14px; font-weight: 700; max-width: calc(100vw - 30px); text-align: center; background: var(--glass-strong); }
#xr-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* save / actions in event details */
.btn.saved { background: #e0457b; color: #fff; border-color: transparent; }
.xr-mini { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.xr-mini:hover { color: var(--text); }
.who { color: var(--blue-2); font-weight: 800; text-decoration: none; }

/* personal pages */
.xr-page { max-width: 980px; margin: 0 auto; padding: 96px 18px 60px; }
.xr-page h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 4px; letter-spacing: -.02em; }
.xr-sub { color: var(--muted); margin: 0 0 20px; }
.xr-tabbar { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 18px; padding-bottom: 4px; scrollbar-width: none; }
.xr-tabbar button { flex: none; padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; background: var(--fill-2); color: var(--muted); }
.xr-tabbar button.on { background: var(--text); color: var(--night); }
.xr-card { background: var(--fill); border: 1px solid var(--line); border-radius: 20px; padding: 18px; margin-bottom: 14px; }
.xr-card h3 { margin: 0 0 10px; font-size: 18px; }
.xr-list { display: grid; gap: 10px; min-width: 0; }
.xr-item { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 16px; background: var(--fill); border: 1px solid var(--line); text-decoration: none; min-width: 0; max-width: 100%; overflow: hidden; }
.xr-item .ph { width: 64px; height: 64px; border-radius: 12px; flex: none; background: #1a2230 center/cover no-repeat; display: grid; place-items: center; font-size: 24px; }
.xr-item .bd { flex: 1; min-width: 0; overflow: hidden; }
.xr-item .t { font-weight: 800; line-height: 1.25; }
.xr-item .m { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xr-item .acts { display: flex; gap: 6px; flex: none; }
.xr-empty { color: var(--muted); text-align: center; padding: 30px 10px; }
.xr-hero-user { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.xr-hero-user .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.xr-badge { display: inline-block; font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 999px; background: rgba(6,118,182,.18); color: var(--blue-2); margin-left: 6px; vertical-align: middle; }
.xr-day { margin: 18px 0 8px; font-weight: 900; font-size: 16px; }
.xr-day small { color: var(--muted); font-weight: 700; margin-left: 6px; }
.xr-seg { display: inline-flex; background: var(--fill-2); border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.xr-seg button { padding: 7px 14px; border-radius: 9px; font-weight: 800; font-size: 14px; color: var(--muted); }
.xr-seg button.on { background: var(--panel-solid); color: var(--text); }
.xr-plan { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 10px; align-items: end; }
.xr-plan label { display: grid; gap: 5px; font-size: 13px; font-weight: 800; color: var(--muted); min-width: 0; }
.xr-plan input { width: 100%; min-width: 0; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--fill); color: var(--text); font-size: 15px; }
.xr-sugg { position: relative; }
.xr-sugg-list { position: absolute; z-index: 30; top: 100%; left: 0; right: 0; margin-top: 4px; border-radius: 12px; padding: 4px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); }
.xr-sugg-list button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 9px; font-size: 14px; }
.xr-sugg-list button:hover { background: var(--fill-2); }
.xr-sugg-list small { color: var(--muted); display: block; }
.xr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.xr-chip { padding: 6px 11px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 700; font-size: 13px; background: var(--fill); }
.xr-chip.on { border-color: var(--c, var(--blue)); background: color-mix(in srgb, var(--c, var(--blue)) 18%, transparent); }
.xr-photo-preview { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; }

@media (max-width: 860px) {
  /* 16 px stops iPhone Safari zooming into form fields */
  .xr-dialog input:not([type=checkbox]):not([type=radio]):not([type=file]), .xr-dialog textarea, .xr-dialog select,
  .xr-form input:not([type=checkbox]):not([type=radio]):not([type=file]), .xr-form textarea, .xr-form select, .xr-plan input { font-size: 16px; }
  /* the account button sits beside the search field, so the first header row is unchanged */
  #xr-signin { width: 38px; height: 38px; padding: 0; font-size: 0; }
  #xr-signin::before { content: "👤"; font-size: 17px; }
  .map-page .xr-account { order: 10; }
  .map-page .search { flex-basis: calc(100% - 46px); }
  .xr-plan input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-height: 44px; max-width: 100%; }
  .xr-plan { grid-template-columns: 1fr 1fr; }
  .xr-plan > :first-child, .xr-plan > :last-child { grid-column: 1 / -1; }
  .xr-row { grid-template-columns: 1fr; }
  .xr-menu { position: fixed; right: 8px; left: 8px; width: auto; top: 64px; }
  .xr-item .acts { flex-direction: column; }
}

/* scrolling to results leaves room for the fixed header */
#tResults, #sec { scroll-margin-top: 150px; }
