/* Crypto Pulse Visual Redesign — Bitcoin DeFi style
   Additive overrides only; all functionality CSS lives in styles.css */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Enhanced design tokens ─── */
:root {
  --bg-void: #070b14;
  --bg-card: #0d1422;
  --border-hairline: rgba(255, 255, 255, 0.07);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-card-hover:
    0 20px 40px -8px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(245, 158, 11, 0.25),
    0 0 28px rgba(245, 158, 11, 0.07);
  --font-heading: 'Orbitron', 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --card-radius: 16px;
  --easing: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Body background ─── */
body {
  background: var(--bg-void) !important;
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(245, 158, 11, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 30% at 85% 100%, rgba(139, 92, 246, 0.04) 0%, transparent 50%) !important;
  background-attachment: fixed !important;
}

body.light-mode {
  background: #f0f4f8 !important;
  background-image: none !important;
}

/* ─── Typography ─── */
h1,
h2,
h3,
h4,
h5,
h6,
.article-title,
.trending-label,
.subtitle {
  font-family: var(--font-heading);
}

/* ─── Header ─── */
header {
  background: rgba(7, 11, 20, 0.9) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-hairline) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 32px rgba(0, 0, 0, 0.5) !important;
  padding: 2rem 1rem !important;
}

header::before {
  background-image: none !important;
  background:
    radial-gradient(ellipse 55% 100% at 15% 60%, rgba(245, 158, 11, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 80% at 82% 15%, rgba(139, 92, 246, 0.22) 0%, transparent 55%) !important;
  opacity: 1 !important;
}

header::after {
  background: linear-gradient(to bottom, rgba(7, 11, 20, 0.25) 0%, transparent 100%) !important;
}

.subtitle {
  font-size: 0.9rem !important;
  font-weight: 500;
  letter-spacing: 0.4px;
  opacity: 0.7;
}

body.light-mode header {
  background: rgba(248, 250, 252, 0.92) !important;
}

body.light-mode .subtitle {
  color: #475569 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

/* ─── Theme toggle ─── */
#theme-toggle {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--border-hairline) !important;
  border-radius: 8px !important;
  width: 36px !important;
  height: 36px !important;
  transition: background 150ms ease, border-color 150ms ease, transform 200ms var(--easing) !important;
}

#theme-toggle:hover {
  background: rgba(245, 158, 11, 0.12) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  transform: rotate(15deg) !important;
}

/* ─── Search bar ─── */
.search-container {
  background: rgba(10, 15, 25, 0.7) !important;
  border-bottom: 1px solid var(--border-hairline) !important;
  padding: 0.875rem 1.5rem !important;
}

body.light-mode .search-container {
  background: rgba(248, 250, 252, 0.85) !important;
}

#search-input,
.search-input {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 12px !important;
  font-size: 0.9rem !important;
  transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease !important;
}

#search-input:focus,
.search-input:focus {
  border-color: var(--primary) !important;
  background: rgba(245, 158, 11, 0.03) !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12) !important;
}

body.light-mode #search-input,
body.light-mode .search-input {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

/* ─── Crypto ticker ─── */
.crypto-ticker-container {
  background: rgba(10, 16, 26, 0.85) !important;
  border-bottom: 1px solid var(--border-hairline) !important;
  border-top: 1px solid var(--border-hairline) !important;
}

body.light-mode .crypto-ticker-container {
  background: rgba(226, 232, 240, 0.8) !important;
}

.crypto-item {
  font-family: var(--font-mono) !important;
  font-size: 0.78rem !important;
}

.crypto-name {
  font-family: var(--font-heading) !important;
  font-size: 0.8rem !important;
  font-weight: 600;
}

.crypto-symbol {
  font-family: var(--font-mono) !important;
  font-size: 0.68rem !important;
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.crypto-price {
  font-family: var(--font-mono) !important;
  font-weight: 500;
}

/* ─── Filter / trending bar ─── */
.filter-bar {
  background: rgba(7, 11, 20, 0.65) !important;
  border-bottom: 1px solid var(--border-hairline) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.light-mode .filter-bar {
  background: rgba(241, 245, 249, 0.9) !important;
}

.trending-label {
  font-size: 0.7rem !important;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  opacity: 0.45;
}

/* ─── News grid ─── */
.news-grid {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
  gap: 1.25rem !important;
  padding: 1.5rem !important;
  max-width: 1440px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr !important;
    padding: 0.875rem !important;
    gap: 0.875rem !important;
  }
}

/* ─── Article cards ─── */
.article-card {
  background: var(--bg-card) !important;
  border-radius: var(--card-radius) !important;
  border: 1px solid var(--border-hairline) !important;
  box-shadow: var(--shadow-card) !important;
  padding: 1.25rem !important;
  transition:
    transform 250ms var(--easing),
    box-shadow 250ms var(--easing),
    border-color 250ms var(--easing) !important;
}

.article-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: var(--shadow-card-hover) !important;
  border-color: rgba(245, 158, 11, 0.28) !important;
}

.article-card:active {
  transform: translateY(-1px) scale(0.997) !important;
}

.article-card::after {
  height: 2px !important;
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 50%, #8b5cf6 100%) !important;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
}

body.light-mode .article-card {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

body.light-mode .article-card:hover {
  border-color: rgba(217, 119, 6, 0.35) !important;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(217, 119, 6, 0.15) !important;
}

/* ─── Article title ─── */
.article-title {
  font-size: 1rem !important;
  font-weight: 600;
  line-height: 1.5 !important;
  margin-bottom: 0.625rem !important;
}

/* ─── Snippet ─── */
.article-snippet {
  font-size: 0.84rem !important;
  line-height: 1.65 !important;
  -webkit-line-clamp: 2 !important;
}

/* ─── Source badge ─── */
.source-badge {
  background: rgba(255, 255, 255, 0.12) !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
}

.source-badge:hover {
  background: rgba(245, 158, 11, 0.18) !important;
  color: var(--primary) !important;
  transform: none !important;
}

.source-badge.active {
  background: rgba(245, 158, 11, 0.22) !important;
  color: var(--primary) !important;
}

body.light-mode .source-badge {
  background: rgba(0, 0, 0, 0.07) !important;
}

body.light-mode .source-badge:hover {
  background: rgba(217, 119, 6, 0.12) !important;
  color: var(--primary) !important;
}

body.light-mode .source-badge.active {
  color: var(--primary) !important;
}

/* ─── Tags ─── */
.tag {
  border-radius: 999px !important;
  font-size: 0.7rem !important;
  font-weight: 600;
  padding: 0.2rem 0.55rem !important;
  letter-spacing: 0.2px;
  transition: opacity 150ms ease, transform 150ms ease !important;
}

.tag:hover {
  opacity: 0.82;
  transform: translateY(-1px);
}

/* ─── Article meta ─── */
.article-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem !important;
  color: var(--muted) !important;
  border-top: 1px solid var(--border-hairline);
  padding-top: 0.75rem;
  margin-top: 0.75rem !important;
}

body.light-mode .article-meta {
  border-top-color: rgba(0, 0, 0, 0.06);
}

/* ─── Action buttons ─── */
.bookmark-icon,
.share-icon {
  opacity: 0.45;
  transition: opacity 150ms ease, color 150ms ease !important;
  border-radius: 6px !important;
}

.bookmark-icon:hover,
.share-icon:hover,
.bookmark-icon.bookmarked {
  opacity: 1 !important;
  color: var(--primary) !important;
}

/* ─── Skeleton cards ─── */
.skeleton-card {
  background: var(--bg-card) !important;
  border-radius: var(--card-radius) !important;
  border: 1px solid var(--border-hairline) !important;
}

/* ─── Touch optimisation ─── */
button,
.tag,
.source-badge,
.bookmark-icon,
.share-icon,
#theme-toggle,
.exclude-button,
.include-only-button {
  touch-action: manipulation;
}

/* Expand exclude button hit area on touch devices */
@media (pointer: coarse) {
  .tag .exclude-button,
  .source-actions button {
    min-width: 44px;
    min-height: 44px;
  }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .article-card,
  .source-badge,
  .tag,
  #theme-toggle,
  .bookmark-icon,
  .share-icon,
  #search-input,
  .search-input {
    transition: none !important;
  }

  .article-card:hover,
  .tag:hover {
    transform: none !important;
  }

  #theme-toggle:hover {
    transform: none !important;
  }
}
