/* DN2 Component patterns — forms, cards, avatars, chrome */

/* ===========================
   FORMS
   =========================== */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.6rem;
}
.form-field label {
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--blue2);
}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="tel"],
.form-field input[type="date"],
.form-field input[type="number"],
.form-field textarea,
.form-field select {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.4rem;
  color: var(--blue2);
  background: #fff;
  border: 0.1rem solid var(--greyC);
  border-radius: 0.4rem;
  padding: 1rem 1.2rem;
  outline: none;
  transition: border-color var(--transition-time), box-shadow var(--transition-time);
  width: 100%;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--blue7);
  box-shadow: 0 0 0 0.3rem rgba(0, 171, 237, 0.15);
}
.form-field input::placeholder {
  color: var(--greyA);
}
.form-field input:disabled {
  background: var(--greyE);
  color: var(--text-disabled);
  cursor: not-allowed;
}
.form-field.error input,
.form-field.error textarea {
  border-color: var(--red);
}
.form-field .field-error-message {
  margin-top: 0.2rem;
}

/* Checkbox switch */
.checkbox-switch {
  position: relative;
  display: inline-block;
  width: 4.4rem;
  height: 2.4rem;
}
.checkbox-switch input { opacity: 0; width: 0; height: 0; }
.checkbox-switch .slider {
  position: absolute;
  inset: 0;
  background: var(--greyC);
  border-radius: 2.4rem;
  cursor: pointer;
  transition: background-color var(--transition-time);
}
.checkbox-switch .slider::before {
  content: "";
  position: absolute;
  width: 1.8rem;
  height: 1.8rem;
  left: 0.3rem;
  top: 0.3rem;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition-time);
}
.checkbox-switch input:checked + .slider { background: var(--blue7); }
.checkbox-switch input:checked + .slider::before { transform: translateX(2rem); }

/* Native checkbox */
.dn-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.3rem;
  color: var(--blue2);
  cursor: pointer;
  user-select: none;
}
.dn-checkbox input { position: absolute; opacity: 0; pointer-events: none; }
.dn-checkbox .box {
  width: 1.8rem;
  height: 1.8rem;
  border: 0.1rem solid var(--greyA);
  border-radius: 0.3rem;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: border-color var(--transition-time), background var(--transition-time);
}
.dn-checkbox input:checked + .box {
  background: var(--blue2);
  border-color: var(--blue2);
}
.dn-checkbox input:checked + .box::after {
  content: "";
  width: 0.5rem;
  height: 0.9rem;
  border: solid #fff;
  border-width: 0 0.2rem 0.2rem 0;
  transform: rotate(45deg) translate(-0.05rem, -0.1rem);
}

/* ===========================
   AVATARS
   =========================== */
.round-avatar {
  width: 6.4rem;
  height: 6.4rem;
  border-radius: 50%;
  background: var(--greyC);
  background-size: cover;
  background-position: center;
  position: relative;
  flex: 0 0 auto;
  display: inline-block;
}
.round-avatar.sm  { width: 4rem;  height: 4rem; }
.round-avatar.md  { width: 6.4rem; height: 6.4rem; }
.round-avatar.lg  { width: 9.6rem; height: 9.6rem; }
.round-avatar.xl  { width: 14rem; height: 14rem; }

/* online dot */
.avatar-status-dot {
  position: absolute;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--green);
  border: 0.2rem solid #fff;
  bottom: 0.2rem;
  right: 0.2rem;
}
.avatar-status-dot.offline { background: var(--greyA); }
.avatar-status-dot.camming { background: var(--orange); }

/* crown overlay */
.avatar-crown {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  width: 2.4rem;
  height: 2.4rem;
  background: var(--gold);
  color: #fff;
  border: 0.2rem solid #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* Avatar thumbnail (grid card) */
.avatar-thumbnail {
  position: relative;
  border-radius: 0.4rem;
  overflow: hidden;
  background: var(--greyE);
  aspect-ratio: 1 / 1;
  cursor: pointer;
  transition: transform var(--transition-time);
}
.avatar-thumbnail:hover { transform: scale(1.02); }
.avatar-thumbnail .photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.avatar-thumbnail .meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.6rem 0.8rem;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
  color: #fff;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.4rem;
}
.avatar-thumbnail .meta .name {
  font-size: 1.2rem;
  font-weight: 600;
  text-shadow: 0 0.1rem 0.2rem rgba(0, 0, 0, 0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avatar-thumbnail .meta .distance {
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
}
.avatar-thumbnail .badges {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  display: flex;
  gap: 0.4rem;
}
.avatar-thumbnail .badge-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.8);
}
.avatar-thumbnail .badge-dot.offline { background: var(--greyA); }
.avatar-thumbnail .badge-dot.camming { background: var(--orange); }
.avatar-thumbnail .crown-tag {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  background: var(--gold);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.avatar-thumbnail .verified-tag {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2rem;
  height: 2rem;
  background: var(--blue7);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.avatar-thumbnail .crown-tag + .verified-tag { right: 3rem; }

/* ===========================
   CARDS
   =========================== */
.base-card {
  background: #fff;
  border: 0.1rem solid var(--greyE);
  border-radius: 0.4rem;
  padding: 1.6rem;
  box-shadow: 0 0.1rem 0.2rem rgba(0, 0, 0, 0.04);
}

/* ===========================
   BADGES
   =========================== */
.dn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 0.3rem;
  background: var(--greyE);
  color: var(--grey3);
}
.dn-badge.gold     { background: var(--gold); color: #fff; }
.dn-badge.green    { background: var(--green); color: #fff; }
.dn-badge.red      { background: var(--red); color: #fff; }
.dn-badge.blue     { background: var(--blue7); color: #fff; }
.dn-badge.outline  { background: transparent; color: var(--blue2); border: 0.1rem solid var(--blue2); }
.dn-badge.queue    { background: var(--red); color: #fff; border-radius: 999px; padding: 0.2rem 0.6rem; min-width: 2rem; justify-content: center; }

/* ===========================
   SECTION TITLES (page-level)
   =========================== */
.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.6rem;
  margin-bottom: 1.6rem;
}
.section-title-row .featured-dudes-title {
  margin: 0;
}
.section-title-row .see-all {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--blue7);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.section-title-row .see-all:hover { color: var(--blue5); }

/* ===========================
   MENU / DROPDOWN
   =========================== */
.menu-dropdown {
  background: #fff;
  border: 0.1rem solid var(--greyE);
  border-radius: 0.4rem;
  box-shadow: 0 0.4rem 1.2rem rgba(0, 40, 58, 0.12);
  padding: 0.4rem 0;
  min-width: 22rem;
}
.menu-dropdown .menu-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  font-size: 1.3rem;
  color: var(--blue2);
  cursor: pointer;
  transition: background-color var(--out-in-transition-time);
}
.menu-dropdown .menu-option:hover { background: var(--greyF); color: var(--blue7); }
.menu-dropdown .menu-option.danger { color: var(--red); }
.menu-dropdown .menu-divider { height: 0.1rem; background: var(--greyE); margin: 0.4rem 0; }

/* ===========================
   MODAL / OVERLAY
   =========================== */
.modal-shell {
  background: var(--modal-bg);
  border-radius: 0.4rem;
  padding: 2.4rem;
}
.modal-card {
  background: #fff;
  border-radius: 0.4rem;
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  overflow: hidden;
}
.modal-card-header {
  padding: 1.6rem 2rem;
  border-bottom: 0.1rem solid var(--greyE);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-card-body { padding: 2rem; }
.modal-card-footer {
  padding: 1.4rem 2rem;
  border-top: 0.1rem solid var(--greyE);
  display: flex;
  justify-content: flex-end;
  gap: 0.8rem;
  background: var(--greyF);
}

/* ===========================
   CHROME — DESKTOP SIDEBAR + TOPBAR
   =========================== */
.dn-shell {
  border: 0.1rem solid var(--greyE);
  border-radius: 0.6rem;
  overflow: hidden;
  background: var(--bg);
  display: grid;
  position: relative;
}

/* Desktop shell */
.dn-shell.desktop {
  grid-template-columns: var(--side-bar-width) 1fr;
  grid-template-rows: var(--desktop-topbar-height) 1fr;
  min-height: 60rem;
}
.dn-shell.desktop .sidebar {
  grid-row: 1 / 3;
  grid-column: 1;
  background: #fff;
  border-right: 0.1rem solid var(--greyE);
  display: flex;
  flex-direction: column;
}
.dn-shell.desktop .topbar {
  grid-row: 1;
  grid-column: 2;
  background: #fff;
  border-bottom: 0.1rem solid var(--greyE);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.4rem;
  gap: 1.6rem;
}
.dn-shell.desktop .main {
  grid-row: 2;
  grid-column: 2;
  padding: 2.4rem;
  overflow: hidden;
}

/* Tablet shell — same as desktop but tighter sidebar */
.dn-shell.tablet {
  grid-template-columns: var(--desktop-notifier-width) 1fr;
  grid-template-rows: var(--desktop-topbar-height) 1fr;
  min-height: 52rem;
}
.dn-shell.tablet .sidebar {
  grid-row: 1 / 3;
  grid-column: 1;
  background: #fff;
  border-right: 0.1rem solid var(--greyE);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.6rem 0;
  gap: 1.2rem;
}
.dn-shell.tablet .topbar {
  grid-row: 1;
  grid-column: 2;
  background: #fff;
  border-bottom: 0.1rem solid var(--greyE);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}
.dn-shell.tablet .main {
  grid-row: 2;
  grid-column: 2;
  padding: 2rem;
  overflow: hidden;
}

/* Mobile shell — topbar + content + bottom bar */
.dn-shell.mobile {
  grid-template-columns: 1fr;
  grid-template-rows: var(--mobile-topbar-height) 1fr var(--mobile-bottom-bar-height);
  width: 36rem;
  min-height: 64rem;
}
.dn-shell.mobile .topbar {
  background: var(--blue2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.6rem;
  z-index: var(--z-mobile-topbar);
}
.dn-shell.mobile .main {
  padding: 1.6rem;
  overflow: hidden;
}
.dn-shell.mobile .bottom-bar {
  background: #fff;
  border-top: 0.1rem solid var(--greyE);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.8rem;
  z-index: var(--z-mobile-bottom-bar);
}

/* Sidebar pieces */
.sidebar-logo {
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 0.1rem solid var(--greyE);
}
.sidebar-logo .logo-mark {
  width: 3.6rem;
  height: 3.6rem;
  background: var(--blue2);
  color: #fff;
  border-radius: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
}
.sidebar-logo .logo-text {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.side-menu {
  list-style: none;
  margin: 0;
  padding: 0.8rem 0;
  flex: 1;
}
.side-menu li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--grey3);
  cursor: pointer;
  position: relative;
  transition: background-color var(--out-in-transition-time), color var(--out-in-transition-time);
}
.side-menu li .icon {
  width: 1.8rem;
  height: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--grey7);
}
.side-menu li:hover { background: var(--greyF); color: var(--blue7); }
.side-menu li.active {
  background: var(--greyF);
  color: var(--blue2);
  font-weight: 600;
}
.side-menu li.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0.3rem;
  background: var(--blue7);
}
.side-menu li .count {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  min-width: 1.8rem;
  text-align: center;
}

/* Topbar pieces */
.topbar-search {
  flex: 1;
  max-width: 36rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--greyF);
  border: 0.1rem solid var(--greyE);
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-size: 1.3rem;
  color: var(--grey7);
}
.topbar-search input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 1.3rem;
  font-family: inherit;
  outline: none;
  color: var(--blue2);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}
.topbar-icon-btn {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--grey5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background-color var(--out-in-transition-time), color var(--out-in-transition-time);
}
.topbar-icon-btn:hover { background: var(--greyF); color: var(--blue7); }
.topbar-icon-btn .count-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: var(--red);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  min-width: 1.6rem;
  line-height: 1.4;
  text-align: center;
}

/* Mobile topbar */
.mobile-topbar-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mobile-icon-btn {
  width: 4rem;
  height: 4rem;
  background: transparent;
  border: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.8rem;
}

/* Mobile bottom bar */
.bottom-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--grey7);
  cursor: pointer;
  position: relative;
  height: 100%;
  transition: color var(--out-in-transition-time);
}
.bottom-bar-item .icon { font-size: 1.8rem; }
.bottom-bar-item.active { color: var(--blue2); }
.bottom-bar-item.active::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2.4rem;
  height: 0.3rem;
  background: var(--blue7);
  border-radius: 0 0 0.2rem 0.2rem;
}
.bottom-bar-item .count-badge {
  position: absolute;
  top: 0.6rem;
  right: 50%;
  margin-right: -1.6rem;
  background: var(--red);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  min-width: 1.6rem;
  line-height: 1.4;
  text-align: center;
}

/* Tablet sidebar items (icon-only) */
.dn-shell.tablet .side-menu-icon {
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--grey5);
  cursor: pointer;
  position: relative;
  transition: background-color var(--out-in-transition-time), color var(--out-in-transition-time);
  font-size: 1.6rem;
}
.dn-shell.tablet .side-menu-icon:hover { background: var(--greyF); color: var(--blue7); }
.dn-shell.tablet .side-menu-icon.active { background: var(--blue2); color: #fff; }
.dn-shell.tablet .side-menu-icon .count {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  background: var(--red);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  min-width: 1.6rem;
  line-height: 1.4;
  text-align: center;
}

/* Footer mock inside shell */
.shell-footer-mock {
  background: var(--blue1);
  color: var(--brownC);
  padding: 1.6rem;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}
