/* Global Styles & Design System */
:root {
  /* Color Palette */
  --primary: #1e3a5f; /* Dark Blue */
  --primary-light: #2d5a8c;
  --primary-dark: #132749;
  --accent: #10b981; /* Accent Green */
  --accent-light: #34d399;
  --danger: #ef4444; /* Red for losses */
  --danger-light: #f87171;

  /* Neutrals */
  --bg-dark: #0f172a; /* Very dark background */
  --bg-secondary: #1a2638; /* Secondary background */
  --surface: #243447; /* Card/Surface background */
  --border: #3f4f63; /* Border color */
  --text-primary: #f8fafc; /* Primary text (white) */
  --text-secondary: #cbd5e1; /* Secondary text (light gray) */
  --text-tertiary: #94a3b8; /* Tertiary text (muted gray) */

  /* Spacing & Typography */
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Monaco", "Courier New", monospace;
  --radius: 0.5rem;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
}

/* Disclaimer Banner */
.disclaimer-banner {
  background-color: #dc2626;
  color: white;
  padding: 1rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  z-index: 100;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

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

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  font-size: 2rem;
}

.nav {
  display: flex;
  gap: 2rem;
  flex: 1;
  justify-content: center;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

.cta-button {
  background-color: var(--primary);
  color: var(--text-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.cta-button:hover {
  background-color: var(--primary-light);
}

/* Ticker Bar */
.ticker-bar {
  background-color: var(--bg-secondary);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.ticker-container {
  display: flex;
  gap: 2rem;
  animation: scroll 30s linear infinite;
  padding: 0 var(--container, 2rem);
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background-color: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-item.down {
  background-color: rgba(239, 68, 68, 0.1);
}

.ticker-symbol {
  font-weight: 700;
  color: var(--text-primary);
}

.ticker-price {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.ticker-change {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--accent);
  font-weight: 600;
}

.ticker-item.down .ticker-change {
  color: var(--danger);
}

.ticker-icon {
  font-size: 0.85rem;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 6rem 0;
  text-align: center;
}

.hero-content {
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.email-signup {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 500px;
}

.email-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius);
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 1rem;
}

.email-input::placeholder {
  color: var(--text-tertiary);
}

/* Buttons */
.btn {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-dark);
}

.btn-primary:hover {
  background-color: var(--accent-light);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--primary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--primary-light);
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Markets Section */
.markets {
  padding: 5rem 0;
  background-color: var(--bg-dark);
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.market-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.market-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
}

.market-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.market-card-title {
  flex: 1;
}

.asset-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.asset-symbol {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.market-card-price {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.price {
  font-size: 1.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.change {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--accent);
}

.market-card.down .change {
  color: var(--danger);
}

.sparkline-container {
  margin: 1rem 0;
  height: 80px;
  background-color: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius);
  padding: 0.5rem;
}

.market-card.down .sparkline-container {
  background-color: rgba(239, 68, 68, 0.1);
}

.market-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.view-details-btn {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--primary);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 1rem;
}

.view-details-btn:hover {
  background-color: var(--primary-light);
}

/* Insights Section */
.insights {
  padding: 5rem 0;
  background-color: var(--bg-secondary);
}

.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1.5rem;
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--accent);
  color: var(--bg-dark);
  border-color: var(--accent);
}

.news-feed {
  display: grid;
  gap: 1.5rem;
}

.news-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.news-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.news-category {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--accent);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
}

.news-item.crypto .news-category {
  background-color: rgba(16, 185, 129, 0.2);
  color: var(--accent);
}

.news-item.stocks .news-category {
  background-color: rgba(45, 90, 140, 0.2);
  color: var(--primary-light);
}

.news-item.analysis .news-category {
  background-color: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
}

.news-time {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.news-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.news-excerpt {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
}

.news-item.hidden {
  display: none;
}

/* Portfolio Section */
.portfolio {
  padding: 5rem 0;
  background-color: var(--bg-dark);
}

.portfolio-container {
  display: grid;
  gap: 3rem;
}

.portfolio-input {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.portfolio-input h3 {
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent);
}

.portfolio-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.summary-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}

.summary-card label {
  display: block;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.summary-card .value {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
}

.portfolio-holdings {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.holding {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.holding:last-child {
  border-bottom: none;
}

.holding-label {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  font-weight: 600;
}

.holding-value {
  color: var(--text-primary);
  font-weight: 600;
}

.remove-holding {
  padding: 0.5rem 1rem;
  background-color: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.remove-holding:hover {
  background-color: var(--danger-light);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--accent);
}

.modal-header {
  margin-bottom: 2rem;
}

.modal-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.modal-header p {
  color: var(--text-tertiary);
}

.chart-canvas {
  width: 100%;
  height: 350px;
  margin-bottom: 2rem;
}

.chart-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.chart-btn {
  padding: 0.5rem 1.5rem;
  background-color: var(--primary);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.chart-btn.active {
  background-color: var(--accent);
  color: var(--bg-dark);
}

.asset-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
}

.detail-item {
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: var(--radius);
}

.detail-label {
  color: var(--text-tertiary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.detail-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

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

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-section p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: var(--surface);
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.25rem;
}

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

.footer-bottom p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.footer-links {
  margin-top: 1rem;
  font-size: 0.9rem;
}

.footer-links a {
  color: var(--text-secondary);
  margin: 0 0.5rem;
  text-decoration: none;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .nav {
    gap: 1rem;
    font-size: 0.95rem;
  }

  .email-signup {
    flex-direction: column;
  }

  .market-grid {
    grid-template-columns: 1fr;
  }

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

  .ticker-container {
    gap: 1rem;
    padding: 0 1rem;
  }

  .ticker-item {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
  }

  .portfolio-summary {
    grid-template-columns: 1fr;
  }

  .header-content {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .hero {
    padding: 3rem 0;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

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

  .market-card-price {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-content {
    width: 95%;
    padding: 1.5rem;
  }

  .filters {
    flex-direction: column;
  }

  .filter-btn {
    width: 100%;
  }
}
