/* ============================================================
   Explorer UI — cards, toolbars, submissions, reader, upload
   ============================================================ */

/* ---------- toolbar + category chips ---------- */
.xtoolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}
.xsearch {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(20, 10, 40, 0.65);
  border: 1px solid rgba(185, 138, 232, 0.3);
}
.xsearch input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
.xsearch svg { color: #b98ae8; flex-shrink: 0; }

.xchips { display: flex; gap: 8px; flex-wrap: wrap; }
.xchip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(185, 138, 232, 0.35);
  background: transparent;
  color: #cbbcec;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s;
}
.xchip:hover { background: rgba(139, 61, 246, 0.15); color: #efe6ff; }
.xchip.on {
  background: linear-gradient(135deg, #f5d97e, #d4af37);
  color: #241403;
  border-color: transparent;
}

/* ---------- cards grid ---------- */
.xgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px;
}
.xcard {
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s, box-shadow 0.22s;
  animation: xcardIn 0.4s ease both;
}
@keyframes xcardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.xcard:hover { transform: translateY(-5px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45); }

.xcard-coverwrap { position: relative; aspect-ratio: 2 / 3; background: #17092e; }
.xcard-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.xcard-likes {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ffd7dc;
  background: rgba(20, 8, 30, 0.78);
  backdrop-filter: blur(4px);
}

.xcard-body { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.xcard-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.xcard-author { margin: 0; font-size: 0.8rem; color: #b9a8d9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xcard-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.xcard-meta .lang-badge { font-size: 0.68rem; padding: 3px 9px; }

/* ---------- card action buttons ---------- */
.xcard-actions {
  display: flex;
  gap: 7px;
  margin-top: auto;
  padding-top: 4px;
}
.xact {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(185, 138, 232, 0.32);
  background: rgba(139, 61, 246, 0.08);
  color: #b9a8d9;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
}
.xact svg { width: 17px; height: 17px; }
.xact .ic { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.xact:hover { transform: translateY(-2px); background: rgba(139, 61, 246, 0.2); color: #efe6ff; }
.xact:disabled { opacity: 0.5; cursor: wait; transform: none; }

.xact-like.on { color: #ff5f79; border-color: rgba(255, 95, 121, 0.55); background: rgba(255, 95, 121, 0.12); }
.xact-like.on .ic { fill: currentColor; }
.xact-fav.on { color: #f5d97e; border-color: rgba(212, 175, 55, 0.6); background: rgba(212, 175, 55, 0.12); }
.xact-fav.on .ic { fill: currentColor; }
.xact-lib.on { color: #9be29b; border-color: rgba(155, 226, 155, 0.5); background: rgba(155, 226, 155, 0.1); }
.xact-lib.on .ic { fill: currentColor; }
.xact-dl { color: #b98ae8; }
.xact-dl:hover { color: #efe6ff; background: rgba(139, 61, 246, 0.25); }

.xempty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #8f7fb5;
  font-size: 1rem;
}

/* ---------- page shell ---------- */
.xpage { padding-top: 26px; padding-bottom: 90px; }
.xpage-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.xpage-title { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; margin: 0; color: var(--text); }
.xpage-count { color: #8f7fb5; font-size: 0.9rem; }

/* ---------- status badges (submissions) ---------- */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-pending { color: #ffd88a; background: rgba(245, 197, 66, 0.14); border: 1px solid rgba(245, 197, 66, 0.4); }
.badge-approved { color: #9be29b; background: rgba(107, 203, 119, 0.13); border: 1px solid rgba(107, 203, 119, 0.42); }
.badge-rejected { color: #ff9aa8; background: rgba(255, 95, 121, 0.12); border: 1px solid rgba(255, 95, 121, 0.42); }
.badge-changes_requested { color: #9ecbff; background: rgba(110, 168, 254, 0.13); border: 1px solid rgba(110, 168, 254, 0.42); }

/* ---------- submission cards ---------- */
.sub-list { display: flex; flex-direction: column; gap: 14px; }
.sub-card {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  align-items: flex-start;
}
.sub-cover {
  width: 74px;
  height: 111px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(185, 138, 232, 0.3);
  flex-shrink: 0;
  background: #17092e;
}
.sub-info { flex: 1; min-width: 0; }
.sub-title { margin: 0 0 4px; font-size: 1.02rem; font-weight: 700; color: var(--text); }
.sub-meta { color: #8f7fb5; font-size: 0.82rem; margin: 0 0 8px; }
.sub-note {
  margin: 8px 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.86rem;
  line-height: 1.6;
  background: rgba(255, 95, 121, 0.08);
  border: 1px solid rgba(255, 95, 121, 0.28);
  color: #ffc9d1;
}
.sub-note.info { background: rgba(110, 168, 254, 0.08); border-color: rgba(110, 168, 254, 0.3); color: #cfe3ff; }
.sub-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- upload form ---------- */
.up-drop {
  border: 2px dashed rgba(185, 138, 232, 0.45);
  border-radius: 18px;
  padding: 34px 20px;
  text-align: center;
  color: #b9a8d9;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(139, 61, 246, 0.05);
}
.up-drop:hover, .up-drop.drag {
  border-color: #f5d97e;
  background: rgba(212, 175, 55, 0.07);
  color: #efe6ff;
}
.up-drop strong { color: #f5d97e; }
.up-filechip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(139, 61, 246, 0.16);
  border: 1px solid rgba(185, 138, 232, 0.35);
  color: #efe6ff;
  font-size: 0.85rem;
  font-weight: 600;
}
.up-progress {
  height: 10px;
  border-radius: 999px;
  background: rgba(185, 138, 232, 0.15);
  overflow: hidden;
  margin-top: 12px;
}
.up-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b3df6, #d4af37);
  transition: width 0.25s ease;
}
.up-label { font-size: 0.82rem; color: #8f7fb5; margin-top: 6px; }

/* ---------- reader ---------- */
.reader-shell { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: #0d0618; }
.reader-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: rgba(18, 8, 38, 0.96);
  border-bottom: 1px solid rgba(185, 138, 232, 0.25);
  flex-wrap: wrap;
}
.reader-title { font-weight: 700; color: var(--text); font-size: 0.95rem; flex: 1; min-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-slider { display: flex; align-items: center; gap: 10px; flex: 2; min-width: 220px; }
.reader-slider input[type="range"] { flex: 1; accent-color: #d4af37; }
.reader-percent { color: #f5d97e; font-weight: 700; font-size: 0.85rem; min-width: 44px; text-align: right; }
.reader-frame { flex: 1; width: 100%; border: none; background: #262626; }

/* ---------- notifications ---------- */
.notif-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff5f79;
  color: #fff;
  font-size: 0.66rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.notif-item {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 14px;
  background: rgba(139, 61, 246, 0.07);
  border: 1px solid rgba(185, 138, 232, 0.2);
  margin-bottom: 10px;
  align-items: flex-start;
}
.notif-item.unread { border-color: rgba(212, 175, 55, 0.5); background: rgba(212, 175, 55, 0.06); }
.notif-icon { font-size: 1.2rem; line-height: 1.2; }
.notif-body b { color: var(--text); display: block; margin-bottom: 2px; font-size: 0.92rem; }
.notif-body p { margin: 0; color: #a99cc9; font-size: 0.84rem; line-height: 1.55; }
.notif-time { color: #6f6191; font-size: 0.72rem; margin-left: auto; white-space: nowrap; }

/* ---------- dashboard rows ---------- */
.dash-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.mini-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(139, 61, 246, 0.08);
  border: 1px solid rgba(185, 138, 232, 0.22);
  text-decoration: none;
  transition: all 0.18s;
}
.mini-card:hover { transform: translateY(-2px); border-color: rgba(212, 175, 55, 0.5); }
.mini-card img { width: 42px; height: 63px; object-fit: cover; border-radius: 7px; flex-shrink: 0; }
.mini-card .t { font-size: 0.8rem; font-weight: 700; color: var(--text); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-card .s { font-size: 0.7rem; color: #8f7fb5; margin-top: 2px; }

@media (max-width: 560px) {
  .xgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .sub-card { flex-direction: column; }
}
