/* MiyaTube Explorer — Organize premium v1
   Camada visual isolada. Não altera contratos, IndexedDB ou persistência. */

.organize-view .page-heading {
  margin-bottom: 20px;
}

.organize-view .page-heading h2 {
  max-width: 560px;
}

.organize-view .page-heading > p:last-child {
  max-width: 560px;
}

.library-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.library-search {
  min-height: 60px;
  margin: 0;
  padding: 0 16px;
  border-radius: 19px;
  background: rgba(255,255,255,.98);
  box-shadow: var(--premium-shadow-sm);
}

.library-search svg {
  width: 21px;
  height: 21px;
  stroke: #66809d;
  fill: none;
  stroke-width: 2;
}

.library-search input {
  min-width: 0;
  font-size: 16px;
  color: var(--premium-navy);
}

.library-search input::placeholder {
  color: #8a99aa;
}

.library-filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.library-filter {
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid #dfe7f0;
  border-radius: 14px;
  color: #47617e;
  background: rgba(255,255,255,.9);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -.01em;
  box-shadow: 0 4px 12px rgba(8,30,63,.035);
}

.library-filter.is-active {
  border-color: var(--premium-navy);
  color: #fff;
  background: var(--premium-navy);
  box-shadow: 0 8px 18px rgba(7,26,56,.16);
}

.library-filter-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  margin-left: 4px;
  padding-inline: 5px;
  place-items: center;
  border-radius: 999px;
  color: inherit;
  background: rgba(91,116,143,.1);
  font-size: 11px;
  line-height: 1;
}

.library-filter.is-active .library-filter-count {
  background: rgba(255,255,255,.16);
}

.library-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  margin: 2px 1px 12px;
  color: var(--premium-muted);
  font-size: 13px;
}

.library-summary strong {
  color: var(--premium-navy);
  font-size: 14px;
  font-weight: 850;
}

.library-sort-note {
  white-space: nowrap;
  color: #8190a1;
  font-size: 11px;
}

.library-list {
  display: grid;
  gap: 13px;
}

.library-card.library-card-premium {
  position: relative;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 112px;
  padding: 12px 11px 12px 12px;
  border: 1px solid var(--premium-line);
  border-radius: 20px;
  text-align: left;
  color: inherit;
  background: rgba(255,255,255,.98);
  box-shadow: var(--premium-shadow-sm);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.library-card.library-card-premium:active {
  transform: scale(.993);
  border-color: #ccd9e7;
  box-shadow: 0 5px 14px rgba(8,30,63,.045);
}

.library-thumb-wrap {
  position: relative;
  align-self: stretch;
  min-height: 86px;
  overflow: hidden;
  border-radius: 15px;
  background: #edf2f7;
}

.library-card.library-card-premium .video-thumb {
  width: 100%;
  height: 100%;
  min-height: 86px;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: none;
}

.library-card-body {
  min-width: 0;
  align-self: center;
}

.library-card-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--premium-navy);
  font-size: 16px;
  font-weight: 860;
  line-height: 1.18;
  letter-spacing: -.022em;
}

.library-card-channel {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 6px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  color: #667992;
  font-size: 13px;
  line-height: 1.25;
}

.library-card-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 9px;
}

.library-language {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #356a9a;
  background: #eaf4ff;
  font-size: 11px;
  font-weight: 800;
}

.library-date {
  color: #8391a1;
  font-size: 11px;
}

.library-card-status {
  position: absolute;
  right: 12px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.library-card-status::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: currentColor;
}

.library-card-status.status-ready {
  color: #167247;
  background: #e5f7ed;
}

.library-card-status.status-partial {
  color: #986712;
  background: #fff1d5;
}

.library-card-status.status-processing {
  color: #3c6e9b;
  background: #eaf3fb;
}

.library-card-chevron {
  align-self: center;
  color: var(--premium-navy);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  opacity: .82;
}

.library-empty-filter {
  margin-top: 18px;
}

.library-empty-filter .empty-icon {
  color: #5b7693;
  background: #edf4fb;
}

.library-local-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 15px 16px;
  border: 1px solid #eadfca;
  border-radius: 18px;
  color: #765c2d;
  background: linear-gradient(135deg, #fff9eb, #fffdf8);
}

.library-local-note svg {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  stroke: #b47d1e;
  fill: none;
  stroke-width: 1.8;
}

.library-local-note strong {
  display: block;
  color: #735316;
  font-size: 13px;
}

.library-local-note p {
  margin-top: 2px;
  color: #866f49;
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 420px) {
  .library-card.library-card-premium {
    grid-template-columns: 104px minmax(0, 1fr) 19px;
    gap: 11px;
    min-height: 104px;
  }

  .library-thumb-wrap,
  .library-card.library-card-premium .video-thumb {
    min-height: 78px;
  }

  .library-card-status {
    position: static;
    width: max-content;
    margin-top: 8px;
  }

  .library-card-foot {
    margin-top: 7px;
  }

  .library-card-title {
    font-size: 15px;
  }
}

@media (max-width: 360px) {
  .library-filter-row {
    grid-template-columns: 1fr;
  }

  .library-card.library-card-premium {
    grid-template-columns: 92px minmax(0, 1fr) 17px;
  }

  .library-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}
