/* Best Info Crypto - Professional Crypto News Site */
/* Design inspired by Cointelegraph, CoinDesk, Decrypt - optimized for readability & SEO */

:root {
  --color-bg: #0a0a0f;
  --color-surface: #12121a;
  --color-surface-hover: #1a1a24;
  --color-text: #f0f0f5;
  --color-text-muted: #a0a0b0;
  --color-accent: #f7931a;
  --color-accent-hover: #ffa726;
  --color-border: #2a2a35;
  --color-success: #22c55e;
  --color-error: #ef4444;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --max-width: 1200px;
  --radius: 8px;
  --transition: 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  font-size: 17px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

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

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero / Featured */
.hero-featured {
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.hero-main a {
  display: block;
}

.hero-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-category {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.hero-main h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hero-excerpt {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.hero-meta {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.hero-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-sidebar-item {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.hero-sidebar-item:last-child {
  border-bottom: none;
}

.sidebar-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--color-accent);
}

.hero-sidebar-item h3 {
  font-size: 1rem;
  margin: 0.25rem 0;
  line-height: 1.3;
}

.sidebar-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Latest News */
.latest-news {
  padding: 3rem 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.5rem;
}

.view-all {
  color: var(--color-accent);
  font-weight: 500;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.news-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.news-card a {
  display: block;
}

.news-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card-content {
  padding: 1.25rem;
}

.news-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.news-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.news-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.news-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Category Sections */
.category-sections {
  padding: 3rem 0;
  background: var(--color-surface);
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.category-panel h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
}

.category-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.category-item:last-of-type {
  border-bottom: none;
}

.category-item h3 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.category-item span {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.category-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--color-accent);
  font-weight: 500;
}

/* Newsletter */
.newsletter {
  padding: 3rem 0;
}

.newsletter-box {
  background: linear-gradient(135deg, var(--color-surface) 0%, #1a1a2e 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
}

.newsletter-box h2 {
  margin-bottom: 0.5rem;
}

.newsletter-box p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  max-width: 400px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
}

.newsletter-form button {
  padding: 0.75rem 1.5rem;
  background: var(--color-accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}

.newsletter-form button:hover {
  background: var(--color-accent-hover);
}

/* Article Page */
.article-header {
  padding: 2rem 0 1rem;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.breadcrumb a:hover {
  color: var(--color-accent);
}

.article-category {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.article-header h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.article-hero-image {
  margin-bottom: 2rem;
}

.article-hero-image img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

.article-content {
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.article-content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.article-content h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
}

.article-content p {
  margin-bottom: 1rem;
}

.article-content ul, .article-content ol {
  margin: 1rem 0 1rem 1.5rem;
}

.article-content blockquote {
  border-left: 4px solid var(--color-accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--color-text-muted);
}

.article-share {
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
}

.article-share a {
  margin-right: 1rem;
  color: var(--color-accent);
}

.related-posts {
  padding: 3rem 0;
  background: var(--color-surface);
}

.related-posts h2 {
  margin-bottom: 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.related-grid article a h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.related-grid article a span {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* List Page */
.page-header {
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-border);
}

.page-header--category,
.page-header--section {
  padding: 2.5rem 0;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-border);
}

.page-header__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-bg);
  margin-bottom: 0.75rem;
}

.category-bitcoin .page-header__badge { background: #f7931a; color: #0a0a0f; }
.category-ethereum .page-header__badge { background: #627eea; color: #fff; }
.category-defi .page-header__badge { background: #00d395; color: #0a0a0f; }
.category-markets .page-header__badge { background: #22c55e; color: #0a0a0f; }
.category-policy .page-header__badge { background: #8b5cf6; color: #fff; }
.category-technology .page-header__badge { background: #06b6d4; color: #0a0a0f; }
.category-guides .page-header__badge,
.section-guides .page-header__badge { background: #f59e0b; color: #0a0a0f; }
.section-prices .page-header__badge { background: #22c55e; color: #0a0a0f; }

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.page-description {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 42rem;
}

.term-count {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

.content-list {
  padding: 2rem 0;
}

/* Card grid layout for category/section pages */
.content-list--cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.list-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.list-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.list-card__link {
  display: block;
}

.list-card__image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.list-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.list-card:hover .list-card__image img {
  transform: scale(1.03);
}

.list-card__content {
  padding: 1.25rem;
}

.list-card__category {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
  display: block;
}

.list-card__title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.list-card__summary {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.list-card__meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Legacy list-item (fallback) */
.list-item {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--radius);
}

.list-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-item-content .list-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.list-item h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.list-item p {
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.list-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 0;
}

.pagination-prev, .pagination-next {
  padding: 0.5rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-accent);
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition);
}

.pagination-prev:hover, .pagination-next:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-accent);
}

.pagination-info {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand strong {
  display: block;
  font-size: 1.25rem;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.footer-brand p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.footer-links h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  color: var(--color-text-muted);
}

.footer-links a {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-muted);
}

.footer-links a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer-bottom p {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .main-nav {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .hero-grid {
    grid-template-columns: 1fr;
  }
  
  .category-tabs {
    grid-template-columns: 1fr;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
  
  .content-list--cards {
    grid-template-columns: 1fr;
  }
  
  .list-item {
    grid-template-columns: 1fr;
  }
  
  .list-item-image,
  .list-card__image {
    max-height: 200px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* Visually hidden - for screen readers only */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Prices page - improved readability */
.prices-page {
  --prices-text: #f5f5fa;
  --prices-muted: #b0b0c0;
  --prices-surface: #16161f;
  --prices-border: #353545;
}

.prices-page .page-header h1,
.prices-page .page-description {
  color: var(--prices-text);
}

.prices-page .page-description {
  font-size: 1.15rem;
  line-height: 1.6;
}

.prices-page .prices-widget {
  padding: 2rem 0;
  min-height: 400px;
}

.prices-page .page-header--section {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.12) 0%, var(--color-bg) 100%);
}

.prices-page .prices-content {
  padding: 2.5rem 0;
  border-top: 1px solid var(--prices-border);
  font-size: 1.05rem;
  line-height: 1.75;
}

.prices-page .prices-content,
.prices-page .prices-content p {
  color: var(--prices-text);
}

.prices-page .prices-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--prices-text);
}

.prices-page .prices-content h2:first-child {
  margin-top: 0;
}

.prices-page .prices-content h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  color: var(--prices-text);
}

.prices-page .prices-content ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.prices-page .prices-content p {
  margin-bottom: 1.25rem;
}

.prices-page .prices-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Price cards - clean card grid design */
.price-cards__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.price-card {
  background: #1c1c28;
  border: 1px solid #2e2e3e;
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.price-card:hover {
  border-color: #3e3e52;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.price-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.price-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.price-card__meta {
  flex: 1;
  min-width: 0;
}

.price-card__name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: #f5f5fa;
}

.price-card__symbol {
  font-size: 0.8rem;
  color: #9090a0;
}

.price-card__change {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  flex-shrink: 0;
}

.price-card__change--up {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.price-card__change--down {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.price-card__price {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.price-card__chart {
  height: 48px;
  margin-bottom: 0.5rem;
}

.price-card__chart .sparkline {
  display: block;
  width: 100%;
  height: 48px;
}

.price-card__mcap {
  font-size: 0.85rem;
  color: #9090a0;
}

/* Loading & error states */
.price-card--loading,
.price-card--error {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 2rem;
  color: #a0a0b0;
}

.price-card--loading {
  font-size: 1.1rem;
}

.price-card--error a {
  color: var(--color-accent);
  font-weight: 600;
}

.loading-dots::after {
  content: '';
  animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

@media (max-width: 640px) {
  .price-cards__grid {
    grid-template-columns: 1fr;
  }
}

.prices-attribution {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  color: #a0a0b0 !important;
}

.prices-attribution a {
  color: var(--color-accent);
  font-weight: 600;
}
