/**
 * Saved Outputs V2 — content library
 */

.sol-root {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 100%;
  overflow-x: hidden;
}

/* Stats */
.sol-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 640px) {
  .sol-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.sol-stat {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.sol-stat__value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.1;
}

.sol-stat__label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sol-stat--accent .sol-stat__value {
  color: #4f46e5;
}

/* Recent strip */
.sol-recent {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
}

.sol-recent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sol-recent__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.sol-recent__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sol-recent-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  min-width: 140px;
  max-width: 220px;
  text-align: left;
}

.sol-recent-item:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
}

.sol-recent-item__type {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6366f1;
}

.sol-recent-item__title {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sol-recent-item__date {
  font-size: 11px;
  color: #94a3b8;
}

/* Dashboard library widgets */
.lib-widget {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 16px;
}

.lib-widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.lib-widget__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.lib-widget__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lib-widget__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 13px;
}

.lib-widget__item strong {
  color: #0f172a;
  font-weight: 600;
}

.lib-widget__item span {
  color: #94a3b8;
  font-size: 12px;
  white-space: nowrap;
}

.lib-widget__link {
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

.lib-widget__link:hover {
  text-decoration: underline;
}

/* Toolbar */
.sol-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sol-search-wrap {
  position: relative;
}

.sol-search {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
}

.sol-search:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.sol-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.45;
  pointer-events: none;
}

.sol-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sol-select {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  color: #334155;
  max-width: 100%;
}

.sol-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sol-filter-btn {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.sol-filter-btn:hover {
  border-color: #c7d2fe;
  color: #4f46e5;
}

.sol-filter-btn.is-active {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #4338ca;
}

/* Layout */
.sol-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  min-width: 0;
}

.sol-collections--mobile {
  display: block;
}

@media (min-width: 1024px) {
  .sol-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .sol-collections--mobile {
    display: none;
  }
}

@media (max-width: 1023px) {
  .sol-layout .sol-collections:not(.sol-collections--mobile) {
    display: none;
  }

  .sol-collections--mobile {
    margin-bottom: 4px;
  }
}

.sol-collections {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  min-width: 0;
}

.sol-collections__title {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.sol-collection-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sol-collection-btn {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
}

.sol-collection-btn:hover,
.sol-collection-btn.is-active {
  background: #fff;
  color: #4f46e5;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.sol-collection-add {
  margin-top: 10px;
  width: 100%;
  padding: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
}

.sol-collection-add:hover {
  border-color: #a5b4fc;
  color: #4f46e5;
}

/* Grid */
.sol-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-width: 0;
}

@media (min-width: 640px) {
  .sol-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .sol-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Card */
.sol-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s, border-color 0.2s;
  min-width: 0;
}

.sol-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.1);
}

.sol-card.is-open {
  border-color: #818cf8;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.14);
}

.sol-card__preview-zone {
  background: #0f172a;
  min-height: 120px;
  max-height: 180px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sol-card__preview-zone--text {
  background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 100%);
  padding: 14px;
  align-items: flex-start;
  justify-content: flex-start;
}

.sol-card__preview-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

.sol-card__video {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  background: #000;
}

.sol-card__video-placeholder {
  color: #94a3b8;
  font-size: 13px;
  padding: 24px;
  text-align: center;
}

.sol-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.sol-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.sol-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  word-break: break-word;
}

.sol-card__fav {
  flex-shrink: 0;
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
  color: #cbd5e1;
}

.sol-card__fav.is-on {
  color: #f59e0b;
}

.sol-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sol-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
}

.sol-tag--type {
  background: #eef2ff;
  color: #4338ca;
}

.sol-tag--status-ready {
  background: #ecfdf5;
  color: #059669;
}

.sol-tag--status-expired,
.sol-tag--status-failed {
  background: #fef2f2;
  color: #dc2626;
}

.sol-card__meta {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sol-card__activity {
  font-size: 11px;
  color: #64748b;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sol-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.sol-btn {
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}

.sol-btn:hover {
  border-color: #c7d2fe;
  color: #4f46e5;
}

.sol-btn--primary {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

.sol-btn--primary:hover {
  background: #4338ca;
  border-color: #4338ca;
  color: #fff;
}

.sol-btn--danger:hover {
  border-color: #fecaca;
  color: #dc2626;
}

/* Detail panel */
.sol-detail {
  margin-top: 8px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 12px;
  color: #475569;
}

.sol-detail pre {
  margin: 8px 0 0;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.45;
}

/* Empty */
.sol-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  background: linear-gradient(160deg, #f8fafc 0%, #fff 50%, #eef2ff 100%);
  border: 1px dashed #c7d2fe;
  border-radius: 16px;
}

.sol-empty__icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.sol-empty h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  color: #0f172a;
}

.sol-empty p {
  margin: 0 0 20px;
  font-size: 14px;
  color: #64748b;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.sol-empty-filter {
  padding: 32px 20px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
  grid-column: 1 / -1;
  background: #f8fafc;
  border-radius: 12px;
}
