/* ===========================
   The Chilled Beans — Dialogs & Member Accounts
   Shared by the tier list app and the site pages (navbar sign-in). Needs theme.css.
   =========================== */

/* ===========================
   Dialogs (menu cards)
   =========================== */
.tl-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(59, 34, 24, 0.65);
}

.tl-modal[hidden] {
  display: none;
}

.tl-modal-content {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100% - 8px);
  overflow-y: auto;
  padding: 22px;
  background: var(--foam) var(--paper-grain);
  border: 3px solid var(--espresso);
  border-radius: 16px;
  box-shadow: 8px 8px 0 var(--espresso);
}

.tl-modal h2 {
  font-size: 1.5rem;
  margin-right: 36px;
}

.tl-modal h3 {
  font-size: 1.1rem;
}

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 2px solid var(--espresso);
  border-radius: 50%;
  background: var(--foam);
  box-shadow: 2px 2px 0 var(--espresso);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--espresso);
}

.close:hover {
  background: var(--mustard);
}

.reviewer-notice {
  background: #f6dcb0;
  border: 2px solid var(--espresso);
  border-left-width: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.account-field label {
  display: block;
  margin-bottom: 3px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mocha);
}

/* ===========================
   Member Account Bar (tier list app)
   =========================== */
.account-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.account-bar[hidden] {
  display: none;
}

.account-bar .btn-link {
  color: var(--cherry);
  font-weight: 700;
}

.account-hint {
  font-size: 0.8rem;
  color: var(--mocha);
}

.account-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.account-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--espresso);
  border-radius: 50%;
  background: var(--mustard);
  font-family: var(--font-display);
  font-weight: 900;
}

.role-badge {
  padding: 1px 8px;
  border: 2px solid var(--espresso);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.role-owner { background: var(--cherry); color: var(--foam); }
.role-admin { background: var(--caramel); color: var(--foam); }
.role-pending { background: var(--mustard); color: var(--espresso); }
.role-disabled { background: var(--cream); color: var(--mocha); border-style: dashed; }
.role-you { background: var(--foam); color: var(--espresso); }

.account-notice {
  margin-bottom: 16px;
}

/* Sign-in / account dialogs */
.tl-modal-content.auth-dialog {
  max-width: 420px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-form[hidden] {
  display: none;
}

.auth-form .reviewer-notice {
  margin: 0;
}

.auth-switch {
  margin: 0;
  font-size: 0.9rem;
  text-align: center;
}

/* Members panel (admins) */
.tl-modal-content.members-dialog {
  max-width: 820px;
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-row {
  border: 2px solid var(--espresso);
  border-radius: 12px;
  background: #fff;
}

.member-row[open] {
  box-shadow: 3px 3px 0 var(--espresso);
}

.member-row summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.member-row summary::-webkit-details-marker {
  display: none;
}

.member-row summary::before {
  content: "▸";
  color: var(--caramel);
  transition: transform 0.15s ease;
}

.member-row[open] summary::before {
  transform: rotate(90deg);
}

.member-row-name {
  font-weight: 700;
}

.member-row-name small {
  font-weight: 500;
  color: var(--mocha);
}

.member-row-meta {
  flex-basis: 100%;
  padding-left: 18px;
  font-size: 0.75rem;
  color: var(--mocha);
}

.member-row summary [data-action="approve"] {
  margin-left: auto;
}

.member-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  padding: 10px 14px;
  border-top: 2px dotted var(--coffee-light);
}

.member-form .account-field {
  flex: 1 1 150px;
}

.member-admin {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
  font-weight: 700;
}

.member-locked,
.member-message {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--mocha);
}

/* ===========================
   Navbar sign-in (site pages)
   =========================== */
.nav-account .nav-signin {
  border: 2px solid var(--mustard);
  border-radius: 999px;
  background: none;
  padding: 4px 14px !important;
  color: var(--mustard) !important;
}

/* keep the sign-in's space while the script loads, so the nav links don't shift over */
@media (min-width: 992px) {
  [data-chilled-account]:empty {
    min-width: 170px;
  }
}

.nav-account .nav-signin:hover {
  background: var(--mustard);
  color: var(--espresso) !important;
}

.nav-account .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
}

.nav-account .account-initial {
  width: 26px;
  height: 26px;
  font-size: 0.85rem;
  color: var(--espresso);
  text-transform: none;
  letter-spacing: 0;
}

.nav-account .dropdown-menu {
  min-width: 210px;
  border: 3px solid var(--espresso);
  border-radius: 12px;
  background: var(--foam);
  box-shadow: 5px 5px 0 var(--espresso);
}

.nav-account .dropdown-header {
  font-weight: 700;
  color: var(--espresso);
}

.nav-account .dropdown-item {
  font-weight: 600;
  color: var(--espresso);
}

.nav-account .dropdown-item:hover,
.nav-account .dropdown-item:focus {
  background: var(--mustard);
  color: var(--espresso);
}

.menu-count {
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--cherry);
  color: var(--foam);
  font-size: 0.72rem;
}

/* Pending-approval note under the navbar */
.site-account-notice {
  margin: 16px auto 0;
  max-width: 960px;
}
