/* mxm-albums — real album experience. Brand family #2f38ff -> #7c5cff. */

/* ---- Albums landing: tabs ---------------------------------------------- */
.mxm-albums-heading { margin-bottom: 14px; }
.mxm-albums-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 18px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.10);
}
.mxm-albums-tab {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: inherit;
  opacity: 0.7;
  transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.mxm-albums-tab:hover { opacity: 1; }
.mxm-albums-tab.is-active {
  background: linear-gradient(135deg, #2f38ff, #7c5cff);
  color: #fff;
  opacity: 1;
  box-shadow: 0 2px 8px rgba(47, 56, 255, 0.28);
}

/* ---- Member Albums grid ----------------------------------------------- */
.mxm-memalbums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.mxm-memalbum-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: var(--wo-content-bg, #fff);
  border: 1px solid rgba(127, 127, 127, 0.14);
  text-decoration: none !important;
  color: inherit !important;
  transition: transform 0.18s ease, box-shadow 0.22s ease;
}
.mxm-memalbum-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12); }
.mxm-memalbum-cover {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  background: #d9def5 center/cover no-repeat;
  background-image: linear-gradient(135deg, rgba(47,56,255,0.12), rgba(124,92,255,0.10));
}
.mxm-memalbum-cover[style] { background-blend-mode: normal; }
.mxm-memalbum-count {
  position: absolute;
  right: 8px; bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}
.mxm-memalbum-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.mxm-memalbum-name {
  font-size: 14.5px; font-weight: 700; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mxm-memalbum-owner { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.mxm-memalbum-owner img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.mxm-memalbum-owner-name { font-size: 12.5px; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mxm-memalbum-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mxm-memalbum-reserve {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
  padding: 2px 8px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(47,56,255,0.12), rgba(124,92,255,0.10));
  color: #2f38ff;
}
.mxm-memalbum-date { font-size: 11.5px; opacity: 0.55; }
.mxm-memalbums-empty { text-align: center; padding: 40px 16px; opacity: 0.8; }

/* ---- Single album page ------------------------------------------------- */
.mxm-album-wrap { padding-bottom: 40px; }
.mxm-album-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 240px;
  display: flex;
  align-items: flex-end;
  background: #2a2f5a center/cover no-repeat;
  margin-bottom: 20px;
}
.mxm-album-hero-shade {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, rgba(20,22,45,0.05) 0%, rgba(20,22,45,0.35) 45%, rgba(20,22,45,0.86) 100%);
}
.mxm-album-hero-inner { position: relative; z-index: 1; padding: 22px 24px; width: 100%; color: #fff; }
.mxm-album-back {
  display: inline-flex; align-items: center; gap: 4px;
  color: rgba(255,255,255,0.92) !important; text-decoration: none !important;
  font-size: 13px; font-weight: 600; margin-bottom: 10px; opacity: 0.9;
}
.mxm-album-back:hover { opacity: 1; }
.mxm-album-title { color: #fff; font-size: 30px; font-weight: 800; margin: 0 0 8px; line-height: 1.1; text-shadow: 0 2px 12px rgba(0,0,0,0.4); }
.mxm-album-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13px; color: rgba(255,255,255,0.92); }
.mxm-album-owner { display: inline-flex; align-items: center; gap: 7px; color: #fff !important; text-decoration: none !important; font-weight: 600; }
.mxm-album-owner img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1.5px solid rgba(255,255,255,0.6); }
.mxm-album-dot { opacity: 0.6; }
.mxm-album-priv {
  margin-left: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,0.18); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); color: #fff;
}
.mxm-album-priv--3 { background: rgba(255, 99, 99, 0.30); }

/* Interactive privacy badge (owner) — native <select> styled as a pill.
   appearance:none + a custom caret is supported across Chrome/Edge/Opera/
   Firefox; we avoid a custom JS dropdown so nothing breaks per-browser. */
.mxm-album-priv-wrap { display: inline-flex; align-items: center; position: relative; margin-left: 4px; }
/* Caret drawn with a CSS triangle (no data-URI — avoids Firefox SVG-uri quirks) */
.mxm-album-priv-wrap::after {
  content: ""; position: absolute; right: 10px; top: 50%; margin-top: -2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid #fff; pointer-events: none;
}
.mxm-album-priv-select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  box-sizing: border-box; height: 24px; padding: 0 26px 0 11px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,0.42);
  background-color: rgba(255,255,255,0.18); color: #fff;
  font-family: inherit; font-size: 11px; font-weight: 700; line-height: 22px; cursor: pointer;
  outline: none;
}
.mxm-album-priv-select:focus { border-color: #fff; }
.mxm-album-priv-select.mxm-album-priv--3 { background-color: rgba(255, 99, 99, 0.32); }
/* Native option list renders with system colors — keep text readable. */
.mxm-album-priv-select option { color: #1d1f33; background: #fff; }

/* Privacy chip on album cards (My Albums + profile Photos tab) */
.mxm-album-card-priv {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 700;
  background: rgba(47,56,255,0.10); color: #2f38ff;
}
.mxm-album-card-priv.mxm-album-priv--3 { background: rgba(224,70,60,0.12); color: #c0392b; }
.mxm-profile-albums-grid { margin-top: 4px; }
.mxm-album-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.mxm-album-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  box-sizing: border-box; height: 38px; padding: 0 16px; cursor: pointer;
  border-radius: 999px; border: 1px solid rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.14); color: #fff;
  font-family: inherit; font-size: 12.5px; font-weight: 700; line-height: 1; white-space: nowrap;
  vertical-align: middle; -webkit-appearance: none; appearance: none;
  transition: background 0.18s ease, transform 0.15s ease;
}
.mxm-album-btn:hover { background: rgba(255,255,255,0.26); transform: translateY(-1px); }
.mxm-album-btn-primary { background: linear-gradient(135deg, #2f38ff, #7c5cff); border-color: transparent; }
.mxm-album-btn-danger { border-color: rgba(255,120,120,0.6); background: rgba(255,80,80,0.22); }
.mxm-album-btn-danger:hover { background: rgba(255,80,80,0.40); }
.mxm-album-add { position: relative; overflow: hidden; }

/* manage bar */
.mxm-album-managebar {
  background: rgba(127,127,127,0.07);
  border: 1px solid rgba(127,127,127,0.14);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 18px;
}
.mxm-album-managebar-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mxm-album-rename {
  flex: 1 1 220px; min-width: 0; padding: 9px 12px; border-radius: 8px;
  border: 1px solid rgba(127,127,127,0.30); background: var(--wo-content-bg, #fff); color: inherit; font-size: 14px;
}
.mxm-album-privacy { padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(127,127,127,0.30); background: var(--wo-content-bg, #fff); color: inherit; font-size: 13.5px; }
.mxm-album-managebar .mxm-album-btn { color: #2f38ff; border-color: rgba(47,56,255,0.35); background: rgba(47,56,255,0.06); }
.mxm-album-managebar .mxm-album-btn-primary { color: #fff; background: linear-gradient(135deg, #2f38ff, #7c5cff); border-color: transparent; }
.mxm-album-managehint { margin-top: 10px; font-size: 12px; opacity: 0.6; }

/* photo grid */
.mxm-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.mxm-album-tile {
  position: relative; margin: 0; border-radius: 10px; overflow: hidden;
  aspect-ratio: 1 / 1; background: rgba(127,127,127,0.08);
}
.mxm-album-tile-img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; transition: transform 0.25s ease; }
.mxm-album-tile:hover .mxm-album-tile-img { transform: scale(1.04); }
.mxm-album-tile.is-cover { outline: 3px solid #7c5cff; outline-offset: -3px; }
.mxm-album-tile-coverbadge {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800;
  background: linear-gradient(135deg, #2f38ff, #7c5cff); color: #fff;
}
.mxm-album-tile-tools {
  position: absolute; right: 6px; top: 6px; z-index: 3;
  display: none; gap: 4px;
}
.mxm-album-grid.can-manage.is-managing .mxm-album-tile-tools,
.mxm-album-root.is-managing .mxm-album-tile-tools { display: inline-flex; }
.is-managing .mxm-album-tile-tools { display: inline-flex; }
.mxm-album-tool {
  width: 26px; height: 26px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(20,22,45,0.72); color: #fff; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.mxm-album-tool:hover { transform: scale(1.1); }
.mxm-album-tool-cover:hover { background: #7c5cff; }
.mxm-album-tool-remove:hover { background: #e0463c; }
.mxm-album-empty { grid-column: 1 / -1; text-align: center; padding: 40px 16px; opacity: 0.7; }

/* not-found / private states */
.mxm-album-state { text-align: center; padding: 70px 20px; opacity: 0.85; }
.mxm-album-state svg { color: #7c5cff; margin-bottom: 14px; }
.mxm-album-state h2 { font-size: 22px; font-weight: 800; margin: 0 0 6px; }
.mxm-album-state p { opacity: 0.7; margin: 0 0 18px; }
.mxm-album-state .mxm-album-btn { color: #2f38ff; border-color: rgba(47,56,255,0.35); background: rgba(47,56,255,0.06); }

@media (max-width: 560px) {
  .mxm-album-title { font-size: 23px; }
  .mxm-album-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .mxm-album-tile-img, .mxm-memalbum-card, .mxm-album-btn { transition: none; }
}

/* ---- Album lightbox ---------------------------------------------------- */
body.mxm-alb-lb-lock { overflow: hidden; }
.mxm-alb-lb {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 99999;
  display: none; align-items: center; justify-content: center;
  background: rgba(12, 13, 28, 0.92);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.mxm-alb-lb.is-open { display: flex; }
.mxm-alb-lb-stage {
  margin: 0; max-width: 92vw; max-height: 88vh;
  display: flex; align-items: center; justify-content: center;
}
.mxm-alb-lb-img {
  max-width: 92vw; max-height: 88vh; width: auto; height: auto;
  object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  user-select: none;
}
.mxm-alb-lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.12); color: #fff; font-size: 30px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.16s ease, transform 0.16s ease;
}
.mxm-alb-lb-nav:hover { background: rgba(255,255,255,0.24); }
.mxm-alb-lb-prev { left: 18px; }
.mxm-alb-lb-next { right: 18px; }
.mxm-alb-lb-close {
  position: absolute; top: 16px; right: 18px;
  width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,0.12); color: #fff; font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.16s ease;
}
.mxm-alb-lb-close:hover { background: rgba(255,80,80,0.5); }
.mxm-alb-lb-counter {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  padding: 5px 14px; border-radius: 999px; background: rgba(0,0,0,0.45);
  color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: 0.03em;
}
@media (max-width: 560px) {
  .mxm-alb-lb-nav { width: 42px; height: 42px; font-size: 24px; }
  .mxm-alb-lb-prev { left: 8px; } .mxm-alb-lb-next { right: 8px; }
}

/* Fallback for engines without aspect-ratio (older Opera/Firefox): keep square
   tiles + 4:3 covers via the padding-box technique so nothing collapses. */
@supports not (aspect-ratio: 1 / 1) {
  .mxm-memalbum-cover { height: 0; padding-top: 75%; }
  .mxm-album-tile { height: 0; padding-top: 100%; }
  .mxm-album-tile .mxm-album-tile-img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  }
}
