/* Shared styles for the YouTube Data API lookup-tool family (loaded by
 * each tool page alongside tools.css): form rows, errors, inline
 * progress, channel / video cards, stat grids, history rows. Per-tool
 * CSS adds only tool-specific pieces. */

.ytl-intro { margin: 0 0 14px; color: #4b5563; font-size: 0.95rem; }
.ytl-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ytl-field { display: flex; flex-direction: column; gap: 5px; }
.ytl-field-grow { flex: 1 1 320px; }
.ytl-field-sm { flex: 0 1 170px; }
.ytl-label { font-size: 0.8rem; font-weight: 600; color: #374151; }
.ytl-text { flex: 0 0 auto; }
.ytl-select {
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    background: #fff;
    padding: 9px 10px;
    font-size: 0.9rem;
    color: #1f2937;
}
.ytl-hint { font-size: 0.78rem; color: #6b7280; }

.ytl-progress { margin: 12px 0 0; font-size: 0.86rem; color: #6b7280; display: flex; align-items: center; gap: 8px; }
.ytl-progress[hidden] { display: none; }
.ytl-spinner {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid #e5e7eb; border-top-color: #cc0000;
    animation: ytl-spin 0.8s linear infinite;
}
@keyframes ytl-spin { to { transform: rotate(360deg); } }

.ytl-errors { margin: 12px 0 4px; }
.ytl-errors[hidden] { display: none; }
.ytl-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* results shell */
.ytl-results {
    margin: 16px 0 4px;
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 14px;
    padding: 18px 20px;
    scroll-margin-top: 16px;
}
.ytl-results[hidden] { display: none; }

/* channel / video cards */
.ytl-card { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.ytl-avatar { width: 72px; height: 72px; border-radius: 50%; background: #eef0f3; object-fit: cover; flex: 0 0 auto; }
.ytl-card-main { min-width: 0; flex: 1 1 260px; }
.ytl-card-title { margin: 0 0 2px; font-size: 1.15rem; font-weight: 700; color: #1f2937; word-break: break-word; }
.ytl-card-sub { font-size: 0.86rem; color: #6b7280; word-break: break-word; }
.ytl-card-desc { font-size: 0.86rem; color: #4b5563; margin-top: 8px; max-width: 640px; }
.ytl-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ytl-card-actions .ghost-btn { text-decoration: none; font-size: 0.82rem; padding: 6px 12px; }

.ytl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.ytl-stat { background: #f8fafc; border: 1px solid #eef0f3; border-radius: 12px; padding: 12px 14px; }
.ytl-stat-value { font-size: 1.35rem; font-weight: 800; color: #1f2937; font-variant-numeric: tabular-nums; word-break: break-word; }
.ytl-stat-label { font-size: 0.76rem; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px; }
.ytl-stat-note { font-size: 0.74rem; color: #9ca3af; margin-top: 3px; }
.ytl-stat--hero { grid-column: span 2; background: #fdeeee; border-color: #f5caca; }
.ytl-stat--hero .ytl-stat-value { font-size: 1.9rem; color: #a30000; }

.ytl-kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 6px 14px; margin-top: 14px; font-size: 0.88rem; }
.ytl-kv dt { color: #6b7280; font-weight: 600; }
.ytl-kv dd { margin: 0; color: #1f2937; word-break: break-word; }

.ytl-section-title { margin: 18px 0 8px; font-size: 0.95rem; font-weight: 700; color: #1f2937; }
.ytl-muted { color: #9ca3af; }
.ytl-copy-btn { padding: 3px 9px; font-size: 0.76rem; }

/* history (project class-name contract) */
.ytl-history { margin: 18px 0 4px; }
.ytl-history[hidden] { display: none; }
.ytl-history-title { margin: 0 0 8px; font-size: 0.95rem; font-weight: 700; color: #1f2937; }
.ytl-history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 10px;
    padding: 9px 12px;
    cursor: pointer;
}
.history-item:hover { border-color: #cbd2d9; }
.history-item-input { font-weight: 600; font-size: 0.86rem; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.history-item-meta { font-size: 0.78rem; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item-when { font-size: 0.76rem; color: #9ca3af; flex: 0 0 auto; }
.history-item-delete {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #9ca3af;
    font-size: 1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    opacity: 0;
}
.history-item:hover .history-item-delete { opacity: 1; }
.history-item-delete:hover { background: #fef2f2; color: #b91c1c; }

@media (max-width: 640px) {
    .ytl-row .primary-btn { width: 100%; }
    .ytl-stat--hero { grid-column: span 1; }
}
