/* Library page: profile panel, select mode and boards. */

/* Profile */
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 180px;
  padding: 4px 12px 4px 5px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  color: var(--black);
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}

.profile-chip:hover { background: var(--muted-light); }

.profile-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  overflow: hidden;
  font-weight: 900;
  text-transform: uppercase;
  background: var(--lime);
  color: var(--border);
  border: 2px solid var(--border);
  border-radius: 50%;
}

.profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-chip-caret { flex: none; transition: transform 0.12s ease; }
.profile-chip[aria-expanded="true"] { background: var(--muted-light); }
.profile-chip[aria-expanded="true"] .profile-chip-caret { transform: rotate(180deg); }

.account-menu-wrap { position: relative; }

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 100;
  width: 250px;
  padding: 6px;
  background: var(--card);
  border: 2.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--border);
}

@media (max-width: 520px) {
  .account-menu { left: 0; right: auto; }
}

.account-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  margin-bottom: 6px;
  border-bottom: 1.5px solid #e2e8f0;
}

.account-menu-identity { min-width: 0; }

.account-menu-identity div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#accountMenuName { font-size: 13px; font-weight: 800; }
#accountMenuDetail { font-size: 12px; font-weight: 500; color: var(--muted); }

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  color: var(--black);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.account-menu-item:hover,
.account-menu-item:focus-visible {
  background: var(--lime-light);
  outline: none;
}

a.account-menu-item { text-decoration: none; }
.account-menu-item[hidden] { display: none; }
.menu-external { margin-left: auto; color: var(--muted); }

.account-menu-item:disabled {
  background: transparent;
  opacity: 0.5;
  cursor: not-allowed;
}

.account-menu-divided {
  position: relative;
  margin-top: 11px;
}

.account-menu-divided::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 0;
  right: 0;
  border-top: 1.5px solid #e2e8f0;
}

.profile-avatar-small { width: 24px; height: 24px; font-size: 10px; }
.profile-avatar-medium { width: 36px; height: 36px; font-size: 14px; }
.profile-avatar-large { width: 92px; height: 92px; font-size: 32px; border-width: 3px; box-shadow: 3px 3px 0 var(--border); }

.profile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s;
}

.profile-backdrop.open { opacity: 1; visibility: visible; }

.profile-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 9001;
  width: min(380px, 100vw);
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--card);
  border-right: 3px solid var(--border);
  box-shadow: 6px 0 0 var(--border);
  outline: none;
  transform: translateX(calc(-100% - 8px));
  visibility: hidden;
  transition: transform 0.2s ease, visibility 0.2s;
}

/* Visible at once, not after the slide, so focus can land inside */
.profile-panel.open { transform: none; visibility: visible; transition: transform 0.2s ease, visibility 0s; }

@media (prefers-reduced-motion: reduce) {
  .profile-backdrop, .profile-panel { transition: none; }
}

.profile-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.profile-panel-head h2 { font-size: 20px; font-weight: 900; }

.profile-identity {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.profile-photo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.profile-section { margin-bottom: 20px; }

.profile-identity-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile-identity-text strong { font-size: 17px; font-weight: 900; overflow-wrap: anywhere; }
.profile-identity-text span { font-size: 13px; font-weight: 700; color: var(--muted); overflow-wrap: anywhere; }
.profile-social p { margin-bottom: 10px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.profile-social .btn { display: inline-flex; width: auto; text-decoration: none; }
.profile-name-row { display: flex; gap: 8px; }

/* Select mode for deleting */
.bookmarks-column { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.list-count { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); }
.list-toolbar .btn, .select-bar .btn { width: auto; }
.select-bar {
  position: sticky; top: 10px; z-index: 30; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 12px; background: var(--lime-light); border: 2.5px solid var(--border); border-radius: 10px; box-shadow: 3px 3px 0 var(--border);
}
.select-bar[hidden], .list-toolbar[hidden], #btnSelectMode[hidden] { display: none; }
.select-count { flex: 1; min-width: 110px; font-size: 14px; font-weight: 900; }
.bookmark-card.selectable { cursor: pointer; user-select: none; }
.bookmark-card.selectable .bm-actions { display: none; }
.bookmark-card.is-selected { background: var(--lime-light); }
.bm-check { flex: none; width: 18px; height: 18px; margin-right: 4px; accent-color: var(--lime-dark); cursor: pointer; }
.import-actions { align-items: center; flex-wrap: wrap; }
.import-later { margin-left: auto; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--muted); background: none; border: none; cursor: pointer; text-decoration: underline; }
#importToolCard[hidden] { display: none; }

/* Boards shared to the profile */
.board-share { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 62px; box-sizing: border-box; margin-top: 12px; padding-top: 12px; border-top: 1.5px dashed #cbd5e1; }
.board-share .btn-share-board { width: 100%; }
.board-share-chip { padding: 3px 10px; font-size: 11px; font-weight: 800; background: var(--lime-light); border: 1.5px solid var(--border); border-radius: 999px; }
.board-share-link { font-size: 12px; font-weight: 800; color: var(--black); }
.board-share-stop { margin-left: auto; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--muted); background: none; border: none; cursor: pointer; text-decoration: underline; }
.board-delete-actions { flex-wrap: wrap; align-items: center; }
.board-delete-actions .btn { width: auto; }
#boardDeleteBackdrop[hidden] { display: none; }
.profile-name-row .text-input { flex: 1; min-width: 0; margin-bottom: 0; }
.profile-name-row .btn { width: auto; flex: none; }

.profile-details > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  font-size: 13px;
  border-top: 1.5px solid #e2e8f0;
}

.profile-details dt { flex: none; color: var(--muted); font-weight: 600; }
.profile-details dd { min-width: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }

.danger-zone {
  padding: 16px;
  background: #fef2f2;
  border: 2px solid var(--error);
  border-radius: 10px;
}

.danger-zone h3 { font-size: 14px; font-weight: 900; color: #b91c1c; margin-bottom: 6px; }
.danger-zone p { font-size: 12px; line-height: 1.5; color: #991b1b; margin-bottom: 12px; }
