/* Tesla-Inspired Design System */
/* Principles: No shadows, no gradients, single accent, 4px radius, 0.33s transitions */

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

:root {
  /* Tesla Colors */
  --electric-blue: #3E6AE1;
  --electric-blue-hover: #3560CC;
  --pure-white: #FFFFFF;
  --light-ash: #F4F4F4;
  --carbon-dark: #171A20;
  --graphite: #393C41;
  --pewter: #5C5E62;
  --silver-fog: #8E8E8E;
  --cloud-gray: #EEEEEE;
  --pale-silver: #D0D1D2;
  --frosted-glass: rgba(255, 255, 255, 0.75);

  /* Semantic */
  --bg-primary: var(--pure-white);
  --bg-secondary: var(--light-ash);
  --text-primary: var(--carbon-dark);
  --text-secondary: var(--graphite);
  --text-tertiary: var(--pewter);
  --accent: var(--electric-blue);
  --accent-hover: var(--electric-blue-hover);
  --border-color: var(--cloud-gray);

  /* Radius */
  --radius-btn: 4px;
  --radius-card: 12px;

  /* Font */
  --font: 'Inter', -apple-system, Arial, sans-serif;

  /* Transition */
  --transition: 0.33s cubic-bezier(0.5, 0, 0, 0.75);
}

/* Dark Mode */
.dark-mode {
  --bg-primary: #171A20;
  --bg-secondary: #1E2127;
  --text-primary: #E8E8E8;
  --text-secondary: #B0B2B5;
  --text-tertiary: #8E8E8E;
  --accent: #4A78F0;
  --accent-hover: #5A88FF;
  --border-color: #2A2D33;
  --frosted-glass: rgba(23, 26, 32, 0.75);
}

body {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 40px;
}

.content {
  flex: 1;
  min-width: 0;
}

/* Header - Frosted Glass */
.header {
  background: transparent;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background var(--transition);
}

.header--scrolled {
  background: var(--frosted-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav a {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  padding: 4px 16px;
  border-radius: var(--radius-btn);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition), background-color var(--transition);
}

.nav a:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
}

.hamburger svg {
  width: 24px;
  height: 24px;
}

/* Hero - Full Viewport */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--carbon-dark);
  text-align: center;
  padding: 0 24px;
}

.hero h1 {
  font-family: var(--font);
  font-size: 40px;
  font-weight: 500;
  line-height: 48px;
  color: var(--pure-white);
  margin-bottom: 8px;
  letter-spacing: normal;
}

.hero p {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  line-height: 20px;
  margin-bottom: 32px;
}

.hero .btn-hero {
  display: inline-block;
  padding: 8px 32px;
  border: 2px solid var(--pure-white);
  border-radius: var(--radius-btn);
  color: var(--pure-white);
  font-size: 14px;
  font-weight: 500;
  min-height: 40px;
  line-height: 24px;
  transition: background-color var(--transition), color var(--transition);
}

.hero .btn-hero:hover {
  background: var(--pure-white);
  color: var(--carbon-dark);
  text-decoration: none;
}

/* Page Header (category pages) */
.page-header {
  background: var(--carbon-dark);
  color: var(--pure-white);
  padding: 60px 24px 40px;
  text-align: center;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 8px;
}

.page-header p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.page-header .breadcrumb ol {
  justify-content: center;
}

.page-header .breadcrumb a {
  color: rgba(255, 255, 255, 0.7);
}

.page-header .breadcrumb a:hover {
  color: var(--pure-white);
}

.page-header .breadcrumb span[aria-current="page"] {
  color: var(--pure-white);
}

.page-header .breadcrumb li:not(:last-child)::after {
  color: rgba(255, 255, 255, 0.4);
}

/* Section */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* Category Filter */
.category-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.category-filter button {
  padding: 4px 16px;
  border: none;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  min-height: 32px;
  transition: color var(--transition), background-color var(--transition);
}

.category-filter button:hover {
  background: var(--bg-secondary);
}

.category-filter button.active {
  background: var(--accent);
  color: var(--pure-white);
}

/* Last Updated */
.last-updated {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-tertiary);
}

.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.news-card {
  background: transparent;
  border-radius: 0;
  overflow: hidden;
  transition: background-color var(--transition);
}

.news-card:hover {
  background: var(--bg-secondary);
}

.news-card-content {
  padding: 20px 16px;
}

.news-card-meta {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  font-weight: 400;
}

.news-card h2,
.news-card h3 {
  font-size: 17px;
  font-weight: 500;
  line-height: 20px;
  margin-bottom: 8px;
  letter-spacing: normal;
}

.news-card h2 a,
.news-card h3 a {
  color: var(--text-primary);
}

.news-card h2 a:hover,
.news-card h3 a:hover {
  color: var(--accent);
}

.news-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
}

/* Category Badge */
.category-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-btn);
  font-size: 12px;
  font-weight: 500;
  text-transform: lowercase;
  letter-spacing: normal;
  margin-bottom: 12px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.category-badge.stocks,
.category-badge.forex,
.category-badge.crypto,
.category-badge.economy {
  background: rgba(62, 106, 225, 0.1);
  color: var(--accent);
}

/* Sidebar */
.sidebar {
  width: 320px;
  flex-shrink: 0;
}

.trending {
  background: transparent;
  padding: 0;
  margin-bottom: 24px;
}

.trending h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trending ul {
  list-style: none;
}

.trending li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.trending li:last-child {
  border-bottom: none;
}

.trending li a {
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 400;
  transition: color var(--transition);
}

.trending li a:hover {
  color: var(--text-primary);
}

/* Promo Banner - Tesla Restraint */
.promo-banner {
  background: var(--bg-primary);
  border-left: 3px solid var(--accent);
  padding: 24px;
  margin: 0 0 24px;
}

.sidebar-promo { margin-bottom: 24px; }
.sidebar-promo .promo-header { margin-bottom: 16px; }
.sidebar-promo .promo-icon { font-size: 2rem; }
.sidebar-promo .promo-title h2 { font-size: 16px; font-weight: 500; }
.sidebar-promo .promo-subtitle { font-size: 14px; color: var(--text-secondary); }
.sidebar-promo .promo-reasons { grid-template-columns: 1fr; gap: 8px; margin-bottom: 16px; }
.sidebar-promo .reason-card { padding: 8px 12px; border: none; background: var(--bg-secondary); border-radius: var(--radius-btn); }
.sidebar-promo .reason-text { font-size: 14px; color: var(--text-primary); font-weight: 400; }
.sidebar-promo .promo-cta { flex-direction: column; gap: 12px; margin-bottom: 12px; }
.sidebar-promo .promo-code { font-size: 14px; }
.sidebar-promo .promo-code code { font-size: 16px; padding: 6px 12px; }
.sidebar-promo .promo-btn { width: 100%; }
.sidebar-promo .promo-disclaimer { font-size: 12px; margin-top: 12px; }

.promo-content { max-width: 900px; margin: 0 auto; }
.promo-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.promo-icon { font-size: 2.5rem; line-height: 1; }
.promo-title h2 { font-size: 17px; font-weight: 500; color: var(--text-primary); margin-bottom: 4px; }
.promo-subtitle { font-size: 14px; color: var(--text-secondary); }
.promo-subtitle .highlight { color: var(--accent); font-weight: 500; }

.promo-reasons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.reason-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  border: none;
}

.reason-icon { font-size: 1.25rem; line-height: 1; }
.reason-text { font-size: 14px; color: var(--text-primary); font-weight: 400; }

.promo-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.promo-code {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.promo-code code {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.promo-buttons { display: flex; gap: 8px; }

.promo-btn {
  display: inline-block;
  padding: 8px 24px;
  border-radius: var(--radius-btn);
  font-weight: 500;
  font-size: 14px;
  text-align: center;
  min-height: 40px;
  line-height: 24px;
  transition: background-color var(--transition), color var(--transition);
}

.promo-btn.primary {
  background: var(--accent);
  color: var(--pure-white);
  border: 3px solid transparent;
}

.promo-btn.primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
  color: var(--pure-white);
}

.promo-btn.secondary {
  background: var(--pure-white);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.promo-btn.secondary:hover {
  background: var(--bg-secondary);
  text-decoration: none;
}

.promo-disclaimer {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* Ad Container */
.ad-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-btn);
  padding: 20px;
  margin: 30px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.sidebar-ad-container {
  min-height: 600px;
  margin-bottom: 24px;
}

/* Breadcrumb */
.breadcrumb { margin-bottom: 20px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; list-style: none; font-size: 14px; }
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li:not(:last-child)::after { content: '/'; margin-left: 8px; color: var(--text-tertiary); }
.breadcrumb a { color: var(--text-tertiary); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb span[aria-current="page"] { color: var(--text-primary); font-weight: 500; }

/* Footer */
.footer {
  background: var(--bg-primary);
  color: var(--text-tertiary);
  padding: 40px 0;
  margin-top: 80px;
  border-top: 1px solid var(--border-color);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.footer p { font-size: 12px; color: var(--silver-fog); margin-bottom: 12px; }
.footer-nav { display: flex; justify-content: center; gap: 24px; margin-top: 16px; }
.footer-nav a { color: var(--text-tertiary); font-size: 14px; }
.footer-nav a:hover { color: var(--text-primary); }

/* Article Page */
.article {
  background: var(--bg-primary);
  padding: 40px;
}

.article-header {
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.article-meta { color: var(--text-tertiary); font-size: 14px; }
.reading-time { color: var(--accent); font-weight: 500; }

.article-body {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-body p { margin-bottom: 20px; }

.read-full {
  display: inline-block;
  background: var(--accent);
  color: var(--pure-white);
  padding: 8px 24px;
  border-radius: var(--radius-btn);
  min-height: 40px;
  line-height: 24px;
  margin: 20px 0;
  font-weight: 500;
  font-size: 14px;
  transition: background-color var(--transition);
}

.read-full:hover { background: var(--accent-hover); text-decoration: none; color: var(--pure-white); }

.affiliate-cta {
  background: var(--bg-secondary);
  padding: 30px;
  border-radius: var(--radius-btn);
  margin-top: 30px;
  text-align: center;
}

.affiliate-cta h3 { margin-bottom: 12px; color: var(--text-primary); font-weight: 500; }

.affiliate-btn {
  display: inline-block;
  background: var(--accent);
  color: var(--pure-white);
  padding: 8px 24px;
  border-radius: var(--radius-btn);
  min-height: 40px;
  line-height: 24px;
  margin: 6px;
  font-weight: 500;
  font-size: 14px;
  transition: background-color var(--transition);
}

.affiliate-btn:hover { background: var(--accent-hover); text-decoration: none; color: var(--pure-white); }

.related { margin-top: 48px; }
.related h2 { font-size: 17px; font-weight: 500; margin-bottom: 24px; color: var(--text-primary); }

/* Search */
.search-bar {
  background: var(--bg-primary);
  padding: 24px;
  position: sticky;
  top: 56px;
  z-index: 99;
  border-bottom: 1px solid var(--border-color);
}

.search-container { max-width: 1200px; margin: 0 auto; display: flex; gap: 12px; }

.search-input {
  flex: 1;
  padding: 8px 16px;
  border: 1px solid var(--pale-silver);
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
  min-height: 40px;
}

.search-input:focus { border-color: var(--accent); }

.search-btn {
  background: var(--accent);
  color: var(--pure-white);
  border: none;
  padding: 8px 24px;
  border-radius: var(--radius-btn);
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  min-height: 40px;
  transition: background-color var(--transition);
}

.search-btn:hover { background: var(--accent-hover); }

.search-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 8px 12px;
  color: var(--text-tertiary);
}

.search-close:hover { color: var(--text-primary); }

.search-results { max-width: 1200px; margin: 16px auto 0; padding: 16px 0; }
.search-result-item { padding: 16px 0; border-bottom: 1px solid var(--border-color); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item a { display: block; color: var(--text-primary); }
.search-result-title { font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.search-result-meta { font-size: 14px; color: var(--text-tertiary); }
.search-no-results { text-align: center; color: var(--text-tertiary); padding: 30px; }

/* Dark Mode Toggle */
.dark-mode-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: color var(--transition);
}

.dark-mode-toggle:hover { color: var(--text-secondary); }
.dark-mode-toggle svg { width: 20px; height: 20px; }

/* Scroll to Top */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--pure-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
  z-index: 100;
}

.scroll-top:hover { background: var(--accent-hover); }

/* 404 Page */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.error-content { text-align: center; max-width: 600px; }
.error-content h1 { font-size: 5rem; color: var(--text-primary); margin-bottom: 10px; line-height: 1; font-weight: 500; }
.error-content h2 { font-size: 17px; color: var(--text-primary); margin-bottom: 16px; font-weight: 500; }
.error-content p { font-size: 14px; color: var(--text-secondary); margin-bottom: 30px; }

.error-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }

.error-btn {
  display: inline-block;
  padding: 8px 24px;
  border-radius: var(--radius-btn);
  font-weight: 500;
  font-size: 14px;
  min-height: 40px;
  line-height: 24px;
  transition: background-color var(--transition), color var(--transition);
}

.error-btn.primary { background: var(--accent); color: var(--pure-white); }
.error-btn.primary:hover { background: var(--accent-hover); text-decoration: none; color: var(--pure-white); }
.error-btn.secondary { background: var(--bg-secondary); color: var(--text-primary); }
.error-btn.secondary:hover { background: var(--border-color); text-decoration: none; }

.error-tips {
  background: var(--bg-secondary);
  padding: 24px;
  border-radius: var(--radius-btn);
  text-align: left;
}

.error-tips h3 { margin-bottom: 12px; color: var(--text-primary); font-weight: 500; }
.error-tips ul { margin-left: 20px; color: var(--text-secondary); }
.error-tips li { margin-bottom: 8px; }

.view-all { display: inline-block; margin-top: 20px; font-weight: 500; color: var(--accent); }
.view-all:hover { color: var(--accent-hover); }

/* Dark mode overrides */
.dark-mode .hero { background: #0D0F13; }
.dark-mode .page-header { background: #0D0F13; }
.dark-mode .news-card:hover { background: #1E2127; }
.dark-mode .category-badge { background: #1E2127; color: #B0B2B5; }
.dark-mode .category-badge.stocks,
.dark-mode .category-badge.forex,
.dark-mode .category-badge.crypto,
.dark-mode .category-badge.economy { background: rgba(74, 120, 240, 0.15); color: var(--accent); }
.dark-mode .promo-banner { background: #1E2127; border-left-color: var(--accent); }
.dark-mode .reason-card { background: #1E2127; }

/* Mobile Responsive */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
    padding: 0 16px;
  }

  .sidebar { width: 100%; }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    padding: 16px;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border-color);
  }

  .nav.active { display: flex; }

  .nav a {
    padding: 12px 16px;
    width: 100%;
  }

  .hamburger { display: flex; }

  .hero h1 { font-size: 28px; line-height: 34px; }
}

@media (max-width: 600px) {
  .hero { min-height: 80vh; }
  .hero h1 { font-size: 24px; line-height: 30px; }

  .news-grid { grid-template-columns: 1fr; }
  .article { padding: 24px; }
  .article-header h1 { font-size: 22px; }

  .promo-reasons { grid-template-columns: 1fr; }
  .promo-cta { flex-direction: column; align-items: stretch; }
  .promo-buttons { flex-direction: column; }
  .promo-btn { width: 100%; }
}
