/* clib-skin.css — Songs Chords Library specifics on the shared cosmic base
   (chord-styles.css supplies .bg/.rail/.shell/.mz-topbar/.mz-hero/.card + tokens).
   Reskins: Songs/Artists tabs, search bar, sort control, stats grid, song cards
   (with thumbnail fallback, clickable singers, views/date) and singer cards. */

/* ── Mode tabs (Songs | Artists) ─────────────────────────────────────────── */
.clib-tabs { display: flex; gap: 9px; margin: 4px 0 20px; flex-wrap: wrap; }
.clib-tab { display: inline-flex; align-items: center; gap: 9px; padding: 11px 20px; border-radius: 13px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 14.5px; color: var(--ink-2, var(--sub));
  border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 4%, transparent); transition: .15s ease; }
.clib-tab:hover { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); transform: translateY(-1px); }
.clib-tab.on { color: var(--accent-ink, #fff); background: var(--cta, var(--accent)); border-color: transparent; box-shadow: var(--cta-glow); }
.clib-tab svg { width: 17px; height: 17px; }

/* ── Search + sort controls ──────────────────────────────────────────────── */
.clib-controls { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; margin-bottom: 22px; }
@media (max-width: 680px) { .clib-controls { grid-template-columns: 1fr; } }
.clib-search { display: flex; flex-direction: column; gap: 9px; }
.clib-search-label { display: flex; align-items: center; gap: 8px; font-family: var(--font-body); font-weight: 600;
  font-size: 13px; color: var(--ink); }
.clib-search-label svg { width: 15px; height: 15px; color: var(--accent); }
.clib-search-row { display: flex; gap: 10px; }
.clib-input-wrap { position: relative; flex: 1; min-width: 0; }
.clib-input-ic { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--sub);
  display: grid; place-items: center; pointer-events: none; }
.clib-input-ic svg { width: 17px; height: 17px; }
.clib-input { width: 100%; height: 50px; padding: 0 16px 0 44px; border-radius: 14px; font: inherit; font-size: 15px;
  color: var(--ink); background: color-mix(in srgb, var(--bg) 45%, transparent);
  border: 1px solid var(--line-strong, var(--line)); outline: none; transition: border-color .16s ease, box-shadow .16s ease; }
.clib-input::placeholder { color: var(--sub); }
.clib-input:focus { border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.clib-search-btn { flex-shrink: 0; height: 50px; padding: 0 22px; border: 0; border-radius: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-body); font-weight: 600; font-size: 14.5px;
  color: var(--accent-ink, #fff); background: var(--cta, var(--accent)); box-shadow: var(--cta-glow); transition: .15s ease; }
.clib-search-btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.clib-search-btn svg { width: 17px; height: 17px; }

.clib-sort { display: flex; flex-direction: column; gap: 9px; }
.clib-sort-label { display: flex; align-items: center; gap: 7px; font-family: var(--font-body); font-weight: 600;
  font-size: 13px; color: var(--ink); }
.clib-sort-label svg { width: 15px; height: 15px; color: var(--accent); }
.clib-select { height: 50px; padding: 0 40px 0 15px; border-radius: 14px; font: inherit; font-size: 14px; font-weight: 500;
  color: var(--ink); background: color-mix(in srgb, var(--bg) 45%, transparent); border: 1px solid var(--line-strong, var(--line));
  cursor: pointer; outline: none; appearance: none; transition: border-color .16s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23889' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; min-width: 200px; }
[dir="rtl"] .clib-select { background-position: left 14px center; padding: 0 15px 0 40px; }
.clib-select:focus { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.clib-select option { background: var(--bg2, #14121d); color: var(--ink); }

/* ── Section headings ────────────────────────────────────────────────────── */
.clib-section-h { font-family: var(--font-body); font-weight: 700; font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -.02em; color: var(--ink); margin: 30px 0 18px; text-align: center; }
.clib-section-h.left { text-align: start; }
.clib-section-sub { text-align: center; color: var(--sub); font-size: 14px; margin: -10px 0 22px; }

/* ── Stats grid ──────────────────────────────────────────────────────────── */
.clib-stats { padding: 26px 22px; text-align: center; }
.clib-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 22px; }
@media (max-width: 680px) {
  .clib-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .clib-stat:nth-child(3) { grid-column: 1 / -1; } /* 3 boxes: last one spans the row */
}
.clib-stat { padding: 22px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 4%, transparent); transition: .18s ease; }
.clib-stat:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); }
.clib-stat-ic { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 13px; display: grid; place-items: center;
  color: var(--accent-ink, #fff); background: var(--cta, var(--accent)); box-shadow: var(--cta-glow); }
.clib-stat-ic svg { width: 22px; height: 22px; }
.clib-stat-num { font-family: var(--font-display, var(--font-body)); font-style: var(--display-style, normal);
  font-weight: 700; font-size: 30px; line-height: 1; color: var(--ink);
  background: var(--cta); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.clib-stat-label { margin-top: 7px; font-family: var(--font-body); font-size: 13px; color: var(--sub); font-weight: 500; }

/* ── Song grid + cards ───────────────────────────────────────────────────── */
.clib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 20px; }
.clib-card { display: block; text-decoration: none; color: inherit; border-radius: 18px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  transition: transform .2s cubic-bezier(.3,.7,.4,1), box-shadow .2s ease, border-color .2s ease; }
.clib-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-pop);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line)); }
.clib-card-img { position: relative; width: 100%; height: 184px; overflow: hidden; display: grid; place-items: center; }
.clib-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clib-card-img .ph { width: 100%; height: 100%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, hsl(var(--ph-h, 265) 70% 56%), hsl(calc(var(--ph-h, 265) + 50) 65% 42%)); }
.clib-card-img .ph svg { width: 54px; height: 54px; opacity: .92; }
.clib-card-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.28)); pointer-events: none; }
.clib-card-play { position: absolute; bottom: 12px; inset-inline-end: 12px; z-index: 2; width: 40px; height: 40px;
  border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.32); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transform: scale(.9); transition: .2s ease; }
.clib-card:hover .clib-card-play { opacity: 1; transform: scale(1); }
.clib-card-play svg { width: 17px; height: 17px; margin-inline-start: 2px; }
.clib-card-body { padding: 16px 18px 18px; }
.clib-card-title { margin: 0; font-family: var(--font-body); font-weight: 700; font-size: 17px; line-height: 1.25;
  color: var(--ink); letter-spacing: -.01em; }
.clib-card:hover .clib-card-title { color: var(--accent); }
.clib-card-desc { margin: 8px 0 0; font-size: 12.5px; color: var(--sub); line-height: 1.5; }
.clib-card-desc a { color: var(--accent-blue, var(--accent)); text-decoration: none; font-weight: 500; transition: .15s ease; }
.clib-card-desc a:hover { text-decoration: underline; }
.clib-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 13px;
  padding-top: 12px; border-top: 1px solid var(--line); font-size: 11.5px; }
.clib-card-date { color: var(--sub); }
.clib-card-views { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-blue, var(--accent)); font-weight: 600; }
.clib-card-views svg { width: 13px; height: 13px; }

/* ── Singer (artist) grid + cards ────────────────────────────────────────── */
.clib-singers { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 16px; }
.clib-singer { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; cursor: pointer;
  text-align: start; text-decoration: none; color: inherit; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-card); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.clib-singer:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 48%, var(--line)); box-shadow: var(--shadow-pop); }
.clib-singer-av { width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.clib-singer-av svg { width: 24px; height: 24px; }
.clib-singer-info { min-width: 0; flex: 1; }
.clib-singer-name { font-family: var(--font-body); font-weight: 600; font-size: 15.5px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clib-singer:hover .clib-singer-name { color: var(--accent); }
.clib-singer-stats { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; }
.clib-song-count { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); }
.clib-song-count svg { width: 13px; height: 13px; }
.clib-singer-arrow { color: var(--accent); display: grid; place-items: center; transition: transform .18s ease; }
.clib-singer:hover .clib-singer-arrow { transform: translateX(3px); }
[dir="rtl"] .clib-singer:hover .clib-singer-arrow { transform: translateX(-3px) scaleX(-1); }
.clib-singer-arrow svg { width: 16px; height: 16px; }

/* ── Search badge (Artists hero accent) ──────────────────────────────────── */
.clib-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; margin-bottom: 4px;
  font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent); }
.clib-badge svg { width: 13px; height: 13px; }

/* ── Back button (Artists → Library) ─────────────────────────────────────── */
.clib-back { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 11px; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px; color: var(--sub); text-decoration: none;
  border: 1px solid var(--line); background: transparent; transition: .15s ease; margin-bottom: 18px; }
.clib-back:hover { color: var(--ink); border-color: var(--accent-line, color-mix(in srgb, var(--accent) 45%, var(--line))); }
.clib-back svg { width: 15px; height: 15px; }
[dir="rtl"] .clib-back svg { transform: scaleX(-1); }

/* ── Loading / states ────────────────────────────────────────────────────── */
.clib-loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 30px 0 6px;
  color: var(--sub); font-family: var(--font-body); font-size: 14px; }
.clib-spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-top-color: var(--accent); animation: clib-spin .8s linear infinite; }
@keyframes clib-spin { to { transform: rotate(360deg); } }
.clib-end { text-align: center; padding: 26px 0 6px; color: var(--sub); font-size: 13px; opacity: .8; }
.clib-empty { text-align: center; padding: 52px 24px; color: var(--sub); font-family: var(--font-body); }
.clib-empty-ic { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.clib-empty-ic svg { width: 30px; height: 30px; }
.clib-empty h3 { margin: 0 0 8px; font-family: var(--font-body); font-weight: 700; font-size: 19px; color: var(--ink); }
.clib-empty p { margin: 4px 0; font-size: 13.5px; line-height: 1.5; }
