/* =============================================================
   CMDB Community Layer — css/community.css
   Extends movie-redesign.css / profile.css visual language.
   Brand: #09090F bg · #FF005B primary · #00FFE0 cyan · #FF8A00 orange
============================================================= */

/* ── Movie page: collection + review action block ─────────── */
.cmdb-community-actions {
  display: grid;
  grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr);
  gap: clamp(20px,4vw,48px);
  margin: 28px 0;
  padding: clamp(20px,3vw,32px);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 14px;
  background: linear-gradient(145deg,rgba(255,0,91,.08),rgba(0,255,224,.04));
}
.cmdb-community-actions__collections .cmdb-section-kicker { margin-bottom: 10px; }
.cmdb-community-action-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.cmdb-collection-toggle {
  transition: background .15s, border-color .15s, color .15s, transform .12s;
}
.cmdb-collection-toggle.is-active {
  background: #ff005b;
  border-color: #ff005b;
  color: #fff;
}
.cmdb-collection-toggle:disabled { opacity: .55; pointer-events: none; }

/* ── Community review form ────────────────────────────────── */
.cmdb-community-review-form { display: grid; gap: 12px; }
.cmdb-community-review-form label {
  display: grid; gap: 6px;
  color: rgba(255,255,255,.72); font-weight: 800; font-size: 13px;
}
.cmdb-community-review-form select,
.cmdb-community-review-form textarea {
  width: 100%; padding: 11px 13px;
  color: #fff; background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14); border-radius: 9px; font: inherit;
  outline: 0; transition: border-color .15s;
}
.cmdb-community-review-form select:focus,
.cmdb-community-review-form textarea:focus {
  border-color: rgba(0,255,224,.45);
  box-shadow: 0 0 0 3px rgba(0,255,224,.08);
}
.cmdb-community-form-status { min-height: 1.4em; margin: 0; color: #ff8a00; font-weight: 800; font-size: 13px; }
.cmdb-community-form-status.is-success { color: #00ffe0; }

/* ── Published member reviews (movie page) ────────────────── */
.cmdb-community-movie-reviews { margin: 30px 0; }
.cmdb-community-review-list { display: grid; gap: 12px; }
.cmdb-community-review {
  padding: 18px; border-radius: 10px;
  background: linear-gradient(135deg,rgba(255,0,91,.07),rgba(0,255,224,.03));
  border: 1px solid rgba(255,255,255,.08);
}
.cmdb-community-review > div { display: flex; align-items: center; gap: 12px; }
.cmdb-community-review > div span { color: #00ffe0; font-weight: 1000; font-size: 18px; }
.cmdb-community-review h3 { margin: 0; font-size: 17px; }
.cmdb-community-review h3 a { color: #fff; text-decoration: none; }
.cmdb-community-review h3 a:hover { color: #00ffe0; }
.cmdb-community-review p { color: rgba(255,255,255,.66); margin: 8px 0 0; }
.cmdb-community-review small { color: rgba(255,255,255,.4); font-size: 12px; }

/* ── Character chips ──────────────────────────────────────── */
.cmdb-community-character-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cmdb-community-character-chips span {
  padding: 5px 12px;
  border: 1px solid rgba(0,255,224,.25); border-radius: 999px;
  background: rgba(0,255,224,.07); color: rgba(255,255,255,.8);
  font-size: 11px; font-weight: 850; letter-spacing: .04em;
}

/* ── Collection panels (profile tabs) ─────────────────────── */
.cmdb-community-collections { display: grid; gap: 20px; }
.cmdb-community-collection {
  background: linear-gradient(180deg,rgba(18,18,22,.94),rgba(11,11,16,.92));
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  padding: clamp(20px,3vw,30px);
  box-shadow: 0 26px 90px rgba(0,0,0,.42);
}
.cmdb-community-collection .cmdb-profile-v5-panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.cmdb-community-collection .cmdb-profile-v5-panel-head h2 { margin: 4px 0 0; font-size: clamp(20px,2.5vw,30px); font-weight: 1000; letter-spacing: -.04em; }
.cmdb-community-collection .cmdb-profile-v5-panel-head p { color: rgba(255,255,255,.55); font-size: 13px; font-weight: 800; }

/* ── Circle rating display (.cmdb-rating-item--circle) ────── */
.cmdb-ratings-list--circles { display: grid; gap: 10px; }
.cmdb-rating-item--circle {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  text-decoration: none;
  color: #fff;
  transition: background .15s, border-color .15s;
}
.cmdb-rating-item--circle:hover {
  background: rgba(255,255,255,.07);
  border-color: rgba(0,255,224,.2);
}
.cmdb-rating-item--circle .cmdb-rating-poster {
  width: 52px; height: 72px; border-radius: 10px;
  overflow: hidden; background: rgba(255,255,255,.07); flex-shrink: 0;
}
.cmdb-rating-item--circle .cmdb-rating-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmdb-rating-item--circle .cmdb-rating-info { flex: 1; min-width: 0; }
.cmdb-rating-item--circle .cmdb-rating-title {
  font-size: 15px; font-weight: 900;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block; margin-bottom: 4px;
}
/* Circle score widget inside rating item */
.cmdb-rating-item--circle .cmdb-rating-score { flex-shrink: 0; }
.cmdb-rating-item--circle .cmdb-hero__score { text-align: center; }
.cmdb-rating-item--circle .circle-container { position: relative; width: 52px; height: 52px; }
.cmdb-rating-item--circle .circular-chart { display: block; width: 52px; height: 52px; transform: rotate(-90deg); }
.cmdb-rating-item--circle .circle-bg { fill: none; stroke: rgba(255,255,255,.10); stroke-width: 2.8; }
.cmdb-rating-item--circle .circle {
  fill: none; stroke: url(#cmdb-rating-gradient); stroke-width: 2.8;
  stroke-linecap: round; transition: stroke-dasharray .6s ease;
}
.cmdb-rating-item--circle .rating-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 1000; color: #fff;
}
.cmdb-rating-item--circle .cmdb-hero__score-label {
  display: block; font-size: 9px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.45); margin-top: 4px; text-align: center;
}

/* Gradient definition for rating circles */
.cmdb-rating-svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ── Community dashboard ──────────────────────────────────── */
.cmdb-community-dashboard { position: relative; }
.cmdb-community-dashboard .cmdb-profile-v5-noise {
  position: absolute; inset: 0; pointer-events: none; opacity: .18;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(#000, transparent 88%);
}

.cmdb-community-dashboard__hero {
  padding: clamp(32px,7vw,80px) 0 clamp(24px,5vw,54px);
  max-width: 800px;
}
.cmdb-community-dashboard__hero .cmdb-section-kicker { margin-bottom: 8px; }
.cmdb-community-dashboard__hero h1 {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(42px,7vw,82px);
  line-height: .94;
  letter-spacing: -.055em;
  font-weight: 1000;
}
.cmdb-community-dashboard__hero p {
  max-width: 620px; margin: 0 0 24px;
  color: rgba(255,255,255,.64);
  font-size: clamp(16px,2vw,20px); line-height: 1.6;
}

.cmdb-community-dashboard__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-bottom: 60px;
  align-items: start;
}
.cmdb-community-dashboard__grid > :first-child { grid-row: span 2; }

/* ── Dashboard: trending cosplay grid ─────────────────────── */
.cmdb-community-cosplay-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
}
.cmdb-community-cosplay-grid .cmdb-cosplay-card {
  position: relative; min-height: 180px; overflow: hidden;
  border-radius: 10px; color: #fff; text-decoration: none;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .18s, border-color .18s;
}
.cmdb-community-cosplay-grid .cmdb-cosplay-card:hover { transform: translateY(-4px); border-color: rgba(0,255,224,.28); }
.cmdb-community-cosplay-grid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cmdb-community-cosplay-grid strong {
  position: absolute; z-index: 1; inset: auto 0 0;
  padding: 35px 10px 10px;
  background: linear-gradient(transparent,rgba(0,0,0,.92));
  font-size: 12px; font-weight: 900;
}

/* ── Dashboard: active members ────────────────────────────── */
.cmdb-community-members { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.cmdb-community-members a {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  color: #fff; text-decoration: none;
  border: 1px solid rgba(255,255,255,.08); border-radius: 10px;
  background: rgba(255,255,255,.03);
  transition: background .15s, border-color .15s;
}
.cmdb-community-members a:hover { background: rgba(255,255,255,.07); border-color: rgba(0,255,224,.2); }
.cmdb-community-members img { border-radius: 50%; flex-shrink: 0; }
.cmdb-community-members span { display: grid; min-width: 0; }
.cmdb-community-members strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; font-size: 14px; }
.cmdb-community-members small { color: #ff8a00; font-size: 11px; font-weight: 800; }

/* ── Feed item small detail timestamp ─────────────────────── */
.cmdb-profile-v5-feeditem p small { display: block; margin-top: 4px; color: rgba(255,255,255,.4); font-size: 11px; }

/* ── Achievement badges enhanced ─────────────────────────── */
.cmdb-profile-v5-badge-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.cmdb-profile-v5-badge {
  display: grid; grid-template-columns: 50px 1fr;
  gap: 10px 14px; align-items: center; padding: 14px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg,rgba(255,0,91,.06),rgba(0,255,224,.03));
  border: 1px solid rgba(255,255,255,.08);
  transition: border-color .15s, background .15s;
}
.cmdb-profile-v5-badge:hover { border-color: rgba(0,255,224,.22); background: linear-gradient(135deg,rgba(255,0,91,.10),rgba(0,255,224,.05)); }
.cmdb-profile-v5-badge i {
  font-style: normal; width: 50px; height: 50px;
  display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(135deg,rgba(255,0,91,.18),rgba(255,138,0,.12));
  font-size: 24px; grid-row: span 2;
}
.cmdb-profile-v5-badge strong { font-size: 15px; font-weight: 1000; line-height: 1.2; }
.cmdb-profile-v5-badge span { color: rgba(255,255,255,.55); font-size: 12px; }

/* ── XP / Achievement toast notification ──────────────────── */
.cmdb-toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.cmdb-toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: rgba(9,9,15,.95);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  backdrop-filter: blur(20px);
  color: #fff; font-size: 14px; font-weight: 800;
  max-width: 320px; min-width: 240px;
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  transition: transform .35s cubic-bezier(.16,1,.3,1), opacity .25s ease;
  pointer-events: auto;
}
.cmdb-toast.is-visible {
  transform: translateX(0);
  opacity: 1;
}
.cmdb-toast.is-leaving {
  transform: translateX(calc(100% + 30px));
  opacity: 0;
}
.cmdb-toast__icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 10px; font-size: 20px;
}
.cmdb-toast--xp .cmdb-toast__icon { background: linear-gradient(135deg,rgba(255,0,91,.25),rgba(255,138,0,.18)); }
.cmdb-toast--achievement .cmdb-toast__icon { background: linear-gradient(135deg,rgba(255,215,0,.22),rgba(255,138,0,.18)); }
.cmdb-toast--level .cmdb-toast__icon { background: linear-gradient(135deg,rgba(0,255,224,.18),rgba(255,0,91,.14)); }
.cmdb-toast__body { flex: 1; min-width: 0; }
.cmdb-toast__title { font-size: 13px; font-weight: 1000; letter-spacing: .02em; }
.cmdb-toast__sub { margin-top: 2px; font-size: 11px; font-weight: 800; color: rgba(255,255,255,.55); }
.cmdb-toast__xp {
  font-size: 15px; font-weight: 1000; flex-shrink: 0;
  background: linear-gradient(135deg,#FF005B,#FF8A00);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Collection toggle XP indicator ──────────────────────── */
.cmdb-xp-pop {
  position: absolute; top: -8px; right: -8px;
  padding: 3px 8px;
  background: linear-gradient(135deg,#FF005B,#FF8A00);
  color: #fff; font-size: 11px; font-weight: 1000;
  border-radius: 999px; line-height: 1;
  animation: cmdb-xp-fade 1.4s ease forwards;
  pointer-events: none; z-index: 10;
}
@keyframes cmdb-xp-fade {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateY(-14px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-22px) scale(.9); }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .cmdb-community-actions { grid-template-columns: 1fr; }
  .cmdb-community-dashboard__grid { grid-template-columns: 1fr; }
  .cmdb-community-dashboard__grid > :first-child { grid-row: auto; }
  .cmdb-profile-v5-badge-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .cmdb-community-cosplay-grid,
  .cmdb-community-members { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cmdb-toast-container { bottom: 16px; right: 16px; left: 16px; }
  .cmdb-toast { max-width: none; }
  .cmdb-rating-item--circle { padding: 10px 14px; gap: 12px; }
}
