/* =========================================================
   TRENDIFY
   Trend cards that each end in one action: "Your move".
========================================================= */

.trend-refreshed {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-2);
}

.trend-refreshed-note {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-3);
}

#trendRefreshBtn[disabled] {
    opacity: .6;
    cursor: progress;
}

/* ---------- filters ---------- */

.trend-filters {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.trend-filters .tabs {
    margin-bottom: 0;
    flex: 1 1 auto;
}

.trend-filters .tab:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.trend-filters .filter { flex: 0 0 auto; }

/* ---------- states ---------- */

.trend-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: 12.5px;
    color: var(--text-2);
}

.trend-note.is-error {
    border-color: var(--danger-soft);
    background: var(--danger-soft);
    color: var(--danger);
}

.trend-spinner {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--primary-soft);
    border-top-color: var(--primary);
    animation: trend-spin .8s linear infinite;
}

@keyframes trend-spin { to { transform: rotate(360deg); } }

.trend-empty {
    grid-column: 1 / -1;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 44px 28px;
    text-align: center;
}

.trend-empty h2 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
}

.trend-empty p {
    margin: 0 auto 20px;
    max-width: 56ch;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text-2);
}

/* ---------- cards ---------- */

.trend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(370px, 1fr));
    gap: 14px;
    align-items: stretch;
}

.trend-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.trend-card-body {
    padding: 15px 17px 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.trend-card-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.trend-tag {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .01em;
}

.trend-tag.is-marketing { background: var(--primary-soft-2); color: var(--primary-dark); }
.trend-tag.is-ai_creative { background: var(--purple-soft); color: var(--purple); }
.trend-tag.is-news { background: var(--warning-soft); color: var(--warning); }

.trend-tag.is-place {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-3);
    font-weight: 700;
}

.trend-observed {
    margin-left: auto;
    font-size: 10px;
    color: var(--text-3);
}

.trend-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--text);
}

.trend-summary {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.65;
    color: var(--text-2);
}

.trend-matters {
    margin: 0;
    padding-left: 11px;
    border-left: 2px solid var(--border-strong);
    font-size: 12px;
    line-height: 1.6;
    color: var(--text);
}

.trend-source {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: max-content;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-decoration: none;
}

.trend-source:hover { color: var(--primary-dark); text-decoration: underline; }
.trend-source svg { width: 12px; height: 12px; }

/* ---------- "Your move": the part that turns a trend into work ---------- */

.trend-move {
    margin-top: auto;           /* pins the action to the card's foot, so a row
                                   of cards lines its buttons up */
    padding: 13px 17px 15px;
    border-top: 1px solid var(--border);
    background: var(--surface-soft);
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.trend-move-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--primary-dark);
}

.trend-move-head svg { width: 14px; height: 14px; }

.trend-idea {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.55;
    color: var(--text);
}

.trend-hook {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 9px 9px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary-soft);
}

.trend-hook-text {
    flex: 1;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-2);
}

.trend-copy {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
}

.trend-go {
    width: 100%;
    justify-content: center;
    margin-top: 2px;
}

@media (max-width: 720px) {
    .trend-grid { grid-template-columns: 1fr; }
    .trend-refreshed { align-items: flex-start; }
    .trend-empty { padding: 30px 18px; }
    .trend-filters { gap: 10px; }
    .trend-filters .filter { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .trend-spinner { animation: none; }
}
