/* ============================================================
   ai-trends.css — Knowledgxchange AI Trends
   Inspired by Stride Insights: editorial, clean, magazine grid
   All rules scoped under .trends-page
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500;600&display=swap');

.trends-page {
  --cp-bg:       #FFFFFF;
  --cp-surface:  #F8F7F4;
  --cp-border:   #E8E6E1;
  --cp-text:     #1C1917;
  --cp-muted:    #78716C;
  --cp-accent:   #1D4ED8;
  --cp-tag-bg:   #EEF2FF;
  --cp-tag-text: #1E40AF;
  --r:           8px;
  font-family: 'Inter', sans-serif;
  background: var(--cp-bg);
  color: var(--cp-text);
}

/* ── HERO — Stride-style: white bg, left-aligned, editorial ── */
.trends-hero {
  border-bottom: 1px solid var(--cp-border);
  padding: 3rem 0 2.5rem;
  background: var(--cp-bg);
}

.trends-hero__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 2rem;
}

.trends-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cp-accent);
  margin-bottom: 1rem;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  animation: livePulse 2s ease-in-out infinite;
  display: inline-block;
  flex-shrink: 0;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50%       { opacity: 0.7; box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

.trends-hero__title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  color: var(--cp-text);
  line-height: 1.15;
  margin: 0 0 1rem;
  max-width: 640px;
}

.trends-hero__title em {
  font-style: italic;
  color: var(--cp-accent);
}

.trends-hero__desc {
  font-size: 15px;
  color: var(--cp-muted);
  line-height: 1.65;
  max-width: 500px;
  margin: 0;
}

/* ── BODY ────────────────────────────────────────────────────── */
.trends-body {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}

/* ── FILTER BAR — Stride pill tabs ───────────────────────────── */
.trends-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--cp-border);
}

.trends-filters__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cp-muted);
  margin-right: 6px;
}

.tfilter {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--cp-border);
  background: var(--cp-bg);
  color: var(--cp-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.tfilter:hover:not(.active) {
  border-color: #C7C3BC;
  color: var(--cp-text);
  background: var(--cp-surface);
}

.tfilter.active {
  background: var(--cp-text);
  border-color: var(--cp-text);
  color: #FFFFFF;
}

/* ── LOADING ─────────────────────────────────────────────────── */
.trends-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 6rem 1rem;
  color: var(--cp-muted);
  font-size: 14px;
}

.trends-loading__spinner {
  width: 30px;
  height: 30px;
  border: 2px solid var(--cp-border);
  border-top-color: var(--cp-accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* ── INDUSTRY LANES ──────────────────────────────────────────── */
.industry-lanes {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

/* Lane header — Stride-style horizontal rule with title */
.lane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--cp-text);
}

.lane-header__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lane-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.lane-dot--tech    { background: #4F46E5; }
.lane-dot--finance { background: #0D9488; }
.lane-dot--finserv { background: #D97706; }
.lane-dot--health  { background: #DB2777; }

.lane-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cp-text);
  margin: 0;
  letter-spacing: -0.01em;
}

.lane-meta {
  font-size: 12px;
  color: var(--cp-muted);
  margin: 0;
}

/* ── HORIZONTAL SCROLL ───────────────────────────────────────── */
.lane-scroll {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: #D6D3CE transparent;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.lane-scroll::-webkit-scrollbar { height: 3px; }
.lane-scroll::-webkit-scrollbar-thumb { background: #D6D3CE; border-radius: 2px; }

.lane-cards {
  display: flex;
  gap: 20px;
  width: max-content;
}

/* ── TREND CARDS — Stride editorial style ────────────────────── */
.tcard {
  width: 300px;
  flex-shrink: 0;
  background: var(--cp-bg);
  border: 1px solid var(--cp-border);
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  animation: cardIn 0.4s ease both;
  text-decoration: none;
  color: inherit;
}

.tcard:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.09);
  transform: translateY(-3px);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Card image — Stride uses 16:9 images */
.tcard__img-wrap {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: var(--cp-surface);
  flex-shrink: 0;
}

.tcard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.tcard:hover .tcard__img { transform: scale(1.04); }

.tcard__img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, transparent 50%, rgba(0,0,0,0.18) 100%);
}

/* Tag floated over image — Stride style */
.tcard__img-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Card body */
.tcard__body {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.tcard__top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.impact {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.impact--high  { background: #FEE2E2; color: #991B1B; }
.impact--med   { background: #FEF3C7; color: #92400E; }
.impact--watch { background: #DBEAFE; color: #1E3A8A; }

.tcard__title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--cp-text);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tcard__summary {
  font-size: 12.5px;
  color: var(--cp-muted);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tcard__stat {
  font-size: 12px;
  font-weight: 600;
  color: var(--cp-accent);
  background: var(--cp-tag-bg);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}

.tcard__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--cp-border);
}

.tcard__source-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--cp-muted);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
  transition: color 0.15s;
  letter-spacing: 0.01em;
}

.tcard__source-link:hover { color: var(--cp-accent); }

.tcard__time {
  font-size: 11px;
  color: #A8A29E;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Tag colours — Stride uses muted pastels */
.ttag--breakthrough { background: rgba(139,92,246,0.12); color: #5B21B6; }
.ttag--research     { background: rgba(59,130,246,0.12); color: #1E40AF; }
.ttag--regulation   { background: rgba(239,68,68,0.12);  color: #991B1B; }
.ttag--adoption     { background: rgba(34,197,94,0.12);  color: #14532D; }
.ttag--product      { background: rgba(20,184,166,0.12); color: #134E4A; }
.ttag--investment   { background: rgba(245,158,11,0.12); color: #78350F; }

.lane-error {
  font-size: 13px;
  color: var(--cp-muted);
  padding: 1rem 0;
  line-height: 1.6;
}

/* ── PAGE FOOTER ─────────────────────────────────────────────── */
.trends-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--cp-border);
  flex-wrap: wrap;
  gap: 8px;
}

.trends-footer__note {
  font-size: 12px;
  color: #A8A29E;
}

.trends-refresh {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 22px;
  border-radius: 6px;
  border: 1px solid var(--cp-border);
  background: var(--cp-bg);
  color: var(--cp-muted);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trends-refresh:hover:not(:disabled) {
  background: var(--cp-text);
  border-color: var(--cp-text);
  color: #FFF;
}

.trends-refresh:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 700px) {
  .trends-hero { padding: 2rem 0 1.75rem; }
  .trends-body { padding: 1.75rem 1rem 3rem; }
  .tcard { width: 260px; }
  .tcard__img-wrap { height: 130px; }
  .trends-hero__title { font-size: 1.75rem; }
}
