/* =========================================================
   AiM — Dashboard & Modal UI (clean build)
   Sections:
     0) DIR Toolbar on Animal Directory
     1) Task Grid & Cards
     2) Task Modal
     3) Global Toast
     4) Profile Customise layout polish
     5) Users Directory
     6) AiM Facts
     7) User View Page (user-view)
     8) Animations
     9) Forminator Jump Fix
     10) iOS PWA: stop “scroll past footer / black void”
   ========================================================= */

/* ==============================
   0) DIR Toolbar such as rainbow and search
   ============================== */
.aim-dir-tools{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:12px;
}

.aim-dir-switch{
  display:flex;
  align-items:center;
}

.aim-switch{
  display:inline-flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  user-select:none;
  font-weight:600;
  color:#2D3C79;
}

.aim-switch input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

.aim-switch-slider{
  position:relative;
  width:52px;
  height:30px;
  border-radius:999px;
  background:#d1d5db;
  transition:background .2s ease;
  display:inline-block;
}

.aim-switch-slider::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.18);
  transition:transform .2s ease;
}

.aim-switch input:checked + .aim-switch-slider{
  background:linear-gradient(90deg, #ec4899, #8b5cf6, #3b82f6);
}

.aim-switch input:checked + .aim-switch-slider::after{
  transform:translateX(22px);
}

.aim-switch-text{
  line-height:1;
}

/* ==============================
   1) TASK GRID & CARDS
   ============================== */

.aim-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:18px;
}

.aim-card{
  position:relative;
  border-radius:16px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.08);
  transition:transform .18s, box-shadow .18s;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
.aim-card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 22px rgba(0,0,0,.12);
}

.aim-card-id{
  position:absolute;
  right:12px; top:12px;
  height:36px; min-width:36px;
  padding:0 10px;
  border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:12px; line-height:1;
}

.aim-card-body{
  display:flex; gap:12px; align-items:flex-start;
  padding:16px;
}

.aim-avatar{
  width:56px; height:56px; flex:0 0 56px;
  border-radius:50%;
  overflow:hidden;
  border:3px solid #ddd;
  display:flex; align-items:center; justify-content:center;
  background:#f7f7f7;
}
.aim-avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.aim-avatar-initial{ font-weight:700; font-size:20px; color:#666; }

.aim-text{ flex:1 1 auto; min-width:0; }
.aim-animal{ font-weight:600; font-size:18px; margin:2px 0 2px; letter-spacing:.1px; }
.aim-title{ font-size:14px; color:#444; margin:2px 0 10px; font-weight:500; }

.aim-meta{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.aim-chip{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
}
.aim-chip.aim-due{ background:#eef2ff; color:#1f2a59; border:1px solid #dde3ff; font-weight: 700; font-size: 12px; padding: 8px 12px; }
.aim-chip.aim-due{
  white-space: nowrap;
  vertical-align: middle;
}

/* Clickable due pill: look/feel like a button */
.aim-chip.aim-due.aim-clickable{
  cursor: pointer;       /* hand cursor */
  user-select: none;     /* stop the text I-beam */
  -webkit-user-select: none;
}

/* Optional: tiny hover affordance */
.aim-chip.aim-due.aim-clickable:hover{
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.aim-chip.aim-priority{ color:#fff; }

.aim-actions{ display:flex; gap:8px; }
.aim-btn{
  border:none; padding:10px 12px; border-radius:12px;
  cursor:pointer; font-weight:600;
  margin-top: 25px;
}

.aim-confetti{
  position:absolute; inset:0;
  width:100%; height:100%;
  pointer-events:none;
}

/* ==============================
   2) TASK MODAL – generic shell ONLY
   (Task-specific look lives in aim-tasks.css)
   ============================== */

/* Shell */
.aim-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
}

.aim-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7,16,31,.52);
  backdrop-filter: saturate(120%) blur(2px);
}

.aim-modal-dialog {
  position: relative;
  width: min(980px, 96vw);
  max-height: 90vh;
  margin: 50px auto 5vh;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  transform: scale(.975);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
  display: flex;
  flex-direction: column;
}

.aim-modal.is-active .aim-modal-dialog {
  transform: scale(1);
  opacity: 1;
}

/* Close button (used by all modals) */
.aim-modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.65);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  line-height: 28px;
  font-size: 18px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

/* ==============================
   3) GLOBAL TOAST
   ============================== */

.aim-toast{
  position:fixed; left:50%; bottom:18px;
  transform:translateX(-50%) translateY(20px);
  z-index:2147483600;
  background:#141826fa; color:#fff;
  padding:10px 14px; border-radius:10px;
  box-shadow:0 10px 30px rgba(0,0,0,.25);
  font:500 14px/1.3 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  letter-spacing:.2px;
  opacity:0; pointer-events:none;
  transition:opacity .22s ease, transform .22s ease;
}
.aim-toast.is-showing{
  opacity:1; transform:translateX(-50%) translateY(0);
}

/* ==============================
   4) Profile Customise layout polish
   ============================== */

/* Push profile header titles away from left edge */
.aim-prof-titles {
  padding-left: 12px; /* adjust to taste */
}

/* Customise tab spacing */
.p-pane--custom .aim-field {
  margin-bottom: 18px; /* give each field a bit more breathing room */
}

/* Extra spacing above Task sound + Custom background sections */
#pfSound {
  margin-top: 8px;
}
#pfSoundPlay {
  margin-top: 6px;
  margin-left: 2px;
}

/* Add gap before Custom background label */
.p-pane--custom label[for="pfSound"],
.p-pane--custom label[for="pfAnim"],
.p-pane--custom label:contains("Custom background") {
  margin-top: 12px;
  display: block;
}

/* Avatar border colour input: make it pill shaped */
#pfRing {
  border-radius: 999px !important;
  height: 74px !important;
  padding: 0 6px;
  cursor: pointer;
}

/* Tidy button spacing under avatar preview */
.aim-avatar-picker button {
  margin-top: 4px;
}


/* Avatar border colour — circular swatch, no inner border */
#pfRing{
  appearance:none; -webkit-appearance:none;
  border:none; padding:0;
  width:74px; height:74px;           /* size */
  border-radius:50%;
  background:transparent;
  cursor:pointer;
  box-shadow: 0 2px 0 rgba(0,0,0,.06), inset 0 0 0 2px #e5e7eb; /* subtle outer ring */
}
#pfRing::-webkit-color-swatch-wrapper{ padding:0; border:none; border-radius:50%; }
#pfRing::-webkit-color-swatch{ border:none; border-radius:50%; }
#pfRing::-moz-color-swatch{ border:none; border-radius:50%; }
#pfRing:focus{ outline:none; }
#pfRing:focus-visible{
  outline:3px solid #a5b4fc; outline-offset:2px;
  box-shadow: 0 0 0 4px rgba(99,102,241,.18), inset 0 0 0 2px #e5e7eb;
}

/* Ensure the two columns inside .aim-field.two top-align */
.p-pane--custom .aim-field.two{ align-items:start; }

/* Make the sound/animation labels level and consistent */
.p-pane--custom label[for="pfSound"],
.p-pane--custom label[for="pfAnim"]{
  display:block;
  margin:0 0 8px;        /* same bottom gap for both */
  line-height:1.1;
}

/* Remove stray top margins and keep even spacing to the selects */
#pfSound, #pfAnim{ margin-top:0; }

/* Give the Preview button a little breathing room from the select */
#pfSoundPlay{ margin-top:8px; }

/* Slight extra space before the 'Custom background' block */
.p-pane--custom .aim-wall-grid{ margin-top:12px; }

/* ===========================
   Profile edit fields – tidy
   =========================== */

/* Make the edit block layout predictable */
.aim-edit-scope .hc-edit,
.aim-edit-scope .pf-edit{
  width: 100%;
}

/* Standardise label + field spacing */
.aim-edit-scope .aim-field{
  display: block;
  width: 100%;
  margin: 12px 0;
}

.aim-edit-scope .aim-label{
  font-weight: 700;
  margin: 0 0 8px;
  color: inherit;
}

/* Inputs + selects + textareas (mobile-friendly, modern) */
.aim-edit-scope input[type="text"],
.aim-edit-scope input[type="url"],
.aim-edit-scope input[type="email"],
.aim-edit-scope input[type="number"],
.aim-edit-scope select,
.aim-edit-scope textarea{
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(31,42,89,.18);
  background: rgba(255,255,255,.85);
  font-size: 16px;            /* prevents iOS “zoom in” on focus */
  line-height: 1.35;
  outline: none;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

/* Textarea sizing */
.aim-edit-scope textarea{
  min-height: 120px;
  resize: vertical;
}

/* Focus state – subtle AiM vibe */
.aim-edit-scope input:focus,
.aim-edit-scope select:focus,
.aim-edit-scope textarea:focus{
  border-color: rgba(209,92,120,.55);        /* subtle pink */
  box-shadow: 0 10px 24px rgba(209,92,120,.18);
  background: #fff;
}

/* If the editor injects odd wrappers, force them full width */
.aim-edit-scope .wp-editor-wrap,
.aim-edit-scope .wp-editor-container,
.aim-edit-scope .mce-tinymce,
.aim-edit-scope .mce-edit-area,
.aim-edit-scope iframe{
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Optional: tighten on very small screens */
@media (max-width: 420px){
  .aim-edit-scope input[type="text"],
  .aim-edit-scope input[type="url"],
  .aim-edit-scope input[type="email"],
  .aim-edit-scope input[type="number"],
  .aim-edit-scope select,
  .aim-edit-scope textarea{
    border-radius: 12px;
    padding: 11px 12px;
  }
}

/* ==============================
   5 Users Directory (matches aim-usercard-* markup)
   ============================== */

/* GRID */
.aim-users-wrap .aim-users-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));
  gap:18px;
  align-items:stretch;
}

/* CARD */
.aim-users-wrap .aim-user-card{
  position:relative;
  display:flex;
  flex-direction:column;
  background:#ffffff;                          /* stop wallpaper bleed-through */
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(17,24,39,.06);
  box-shadow:0 4px 18px rgba(0,0,0,.10);
  transition:transform .18s ease, box-shadow .18s ease;
  isolation:isolate;
}
.aim-users-wrap .aim-user-card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 26px rgba(0,0,0,.14);
}

/* BANNER (SVG fills the slot) */
.aim-users-wrap .aim-usercard-head{
  height:92px;
  background:linear-gradient(135deg,#334155,#64748b); /* fallback if no SVG */
}
.aim-users-wrap .aim-usercard-head > svg{
  display:block;
  width:100%;
  height:100%;
}

/* AVATAR */
.aim-users-wrap .aim-usercard-avatarwrap{
  display:flex;
  justify-content:center;
}
.aim-users-wrap .aim-usercard-avatar{
  width:160px;
  aspect-ratio:1 / 1;                           /* perfect circle */
  height:auto;
  border-radius:50%;
  overflow:hidden;
  margin:-76px auto 12px;                        /* sit over banner */
  background:#f7f7f7;
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
  border:6px solid #ffffff;                      /* clean rim; your inline ring sits outside via 'outset' if used */
}
.aim-users-wrap .aim-usercard-avatar img{
  width:100%; height:100%; object-fit:cover; display:block;
}
.aim-users-wrap .aim-usercard-initial{
  font-weight:900; font-size:42px; color:#2d3c79;
}

/* BODY */
.aim-users-wrap .aim-usercard-body{
  padding:10px 14px 14px;
}

/* TEXT */
.aim-users-wrap .aim-usercard-name{
  font-weight:800;
  font-size:18px;
  letter-spacing:.2px;
  margin:2px 0 2px;
  color:#0f172a;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  text-align: center;
}
.aim-users-wrap .aim-usercard-handle{
  margin:0 0 8px;
  color:#475569;
  font-size:13px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  text-align: center;
}
.aim-users-wrap .aim-usercard-id{
  margin-top:auto;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  color:#334155;
  font-size:12px;
  border-radius:12px;
  padding:8px 10px;
}

/* Toolbar (kept) */
.aim-seg-toggle{
  display:inline-flex; gap:2px; padding:2px;
  background:#f3f4f6; border:1px solid #d1d5db; border-radius:999px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6);
}
.aim-seg-toggle .aim-users-toggle{
  appearance:none; border:0; background:transparent; cursor:pointer;
  padding:8px 14px; border-radius:999px; font-weight:600; line-height:1.1;
  color:#374151;
}
.aim-seg-toggle .aim-users-toggle[aria-selected="true"]{
  background:#111827; color:#fff; box-shadow:0 1px 2px rgba(0,0,0,.10);
}
.aim-seg-toggle .aim-users-toggle:focus-visible{
  outline:2px solid #2563eb; outline-offset:2px; border-radius:999px;
}

/* ==============================
   6) AiM Facts
   ============================== */
.aim-fact-wrap {
  margin-top: 0;
  text-align: left;
  font-family: Open Sans, Arial,sans-serif;
  font-size: 1.3rem;
  font-style: regular;
  color: #3c3c3c;
}

.aim-fact-link {
  color: #F7F1EB !important;
  text-decoration: none;
  border-bottom: 0 dashed #2563eb;
}

.aim-fact-link:hover {
  color: #fff;
  border-bottom: 01px dashed #34548a;
  border-bottom-color: #d15c78;
}

/* ==============================
   8) Animations
   ============================== */
/* Fullscreen animation canvas sits above everything */
.aim-anim-overlay { mix-blend-mode: normal; }

/* ==============================
   9) Forminator Fixes - Global to Taskmaster
   ============================== */
/* Fixes the jumping behaviour */
.aim-taskmaster html,
.aim-taskmaster body,
.aim-taskmaster .forminator-ui {
  scroll-behavior: auto !important;
}
.aim-taskmaster {
  scroll-behavior: auto !important;
}
.aim-taskmaster * {
  scroll-behavior: auto !important;
}

/* =========================================================
   iOS PWA — Taskmaster scroll stability + safe area fill
   (use body as the scroller; avoid nested scrollers)
   ========================================================= */

/* Ensure the app always has a real background (prevents black flash) */
html, body {
  background: #0e1116 !important;
  min-height: 100%;
}

/* iOS (Safari + PWA): stop focus-zoom on inputs by ensuring >=16px font-size */
@supports (-webkit-touch-callout: none) {
  input[type="search"],
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* Taskmaster pages: make sure wrappers also have background */
body.aim-taskmaster,
body.aim-taskmaster #page-container,
body.aim-taskmaster #et-main-area,
body.aim-taskmaster #main-content {
  background: #0e1116 !important;
}

/* IMPORTANT: do NOT force body/page-container to be a nested scroller */
body.aim-taskmaster {
  height: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: auto !important;
}

/* Fill the iPhone/iPad safe-area at the bottom so you don't see a “black bar” */
body.aim-taskmaster #page-container {
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

/* If anything inside Divi tries to create phantom space, clamp it */
body.aim-taskmaster #page-container,
body.aim-taskmaster #et-main-area {
  overflow: visible !important;
}