/* ============================================================
   MELQAI Crypto — main.css
   ============================================================ */

/* 1. CSS Variables */
:root {
  --bg: #0a0e1a;
  --bg-card: #111827;
  --bg-hover: #1a2236;
  --border: #1e2d45;
  --text: #e2e8f0;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --purple: #8b5cf6;
  --radius: 12px;
  --sidebar-w: 240px;
}

/* 2. Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 3. Base */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* 4. Layout */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 5. Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}

.nav-brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  color: #fff;
}

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

.nav-links a {
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-hover);
}

/* 6. Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-hover); }

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

/* 7. Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.metric-card .metric-icon {
  font-size: 24px;
  line-height: 1;
}

.metric-card .metric-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card .metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.metric-card .metric-change {
  font-size: 12px;
  font-weight: 600;
}

/* 8. Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* 9. Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(30, 45, 69, 0.5);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--bg-hover);
  cursor: pointer;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* 10. Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}

.badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
}

.badge-yellow {
  background: rgba(245, 158, 11, 0.15);
  color: var(--yellow);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}

.badge-purple {
  background: rgba(139, 92, 246, 0.15);
  color: var(--purple);
}

/* 11. Change indicators */
.change-up { color: var(--green); font-weight: 600; }
.change-down { color: var(--red); font-weight: 600; }

/* 12. Fear & Greed gauge */
.fg-gauge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.fg-gauge {
  position: relative;
  width: 160px;
  height: 90px;
  overflow: visible;
}

.fg-gauge svg {
  width: 160px;
  height: 90px;
  overflow: visible;
}

.fg-value-label {
  text-align: center;
}

.fg-value-label .fg-number {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.fg-value-label .fg-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 13. Sparkline */
.sparkline {
  display: inline-block;
  vertical-align: middle;
}

.sparkline svg {
  display: block;
}

/* 14. Sidebar */
.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px 4px;
  margin-top: 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.sidebar-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent);
}

.sidebar-item .sidebar-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

/* 15. Main content */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: 60px;
  padding: 24px;
  min-height: calc(100vh - 60px);
}

/* 16. Auth card */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 24px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 420px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* 17. Form elements */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group select,
.form-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-input:focus {
  border-color: var(--accent);
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.input-error {
  border-color: var(--red) !important;
}

.form-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 4px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 18. Landing — hero */
.hero {
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent);
  border-radius: 9999px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  max-width: 700px;
  margin: 0 auto 20px;
  letter-spacing: -0.02em;
}

.hero-title span {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

/* Dashboard mockup behind hero */
.hero-mockup {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  filter: blur(1px);
  opacity: 0.5;
  pointer-events: none;
  position: relative;
}

.hero-mockup::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--bg) 90%);
  border-radius: 16px;
  pointer-events: none;
}

.hero-mockup-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.hero-mockup-bar div {
  height: 60px;
  flex: 1;
  background: var(--bg-hover);
  border-radius: 8px;
}

.hero-mockup-chart {
  height: 120px;
  background: var(--bg-hover);
  border-radius: 8px;
  margin-bottom: 16px;
}

.hero-mockup-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-mockup-rows div {
  height: 36px;
  background: var(--bg-hover);
  border-radius: 6px;
  opacity: 0.7;
}

/* 19. Ticker bar */
.ticker-bar {
  background: rgba(17, 24, 39, 0.9);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-track {
  display: inline-flex;
  gap: 32px;
  animation: ticker-scroll 40s linear infinite;
}

.ticker-track:hover { animation-play-state: paused; }

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

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

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

.ticker-price {
  color: var(--text-muted);
}

/* 20. Features section */
.section {
  padding: 80px 0;
}

.section-label {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  text-align: center;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.section-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto 48px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 14px;
}

.feature-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 21. Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 780px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.pricing-card.featured {
  border-color: var(--accent);
  position: relative;
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.05) 0%, var(--bg-card) 100%);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 4px;
}

.pricing-price span {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.pricing-features {
  list-style: none;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pricing-features li {
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-features li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  font-size: 13px;
}

/* 22. Coin row */
.coin-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coin-row img,
.coin-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.coin-name {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.coin-symbol {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
}

/* 23. Portfolio summary */
.portfolio-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.portfolio-summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portfolio-summary-item .ps-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portfolio-summary-item .ps-value {
  font-size: 22px;
  font-weight: 700;
}

/* 24. Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, rgba(30, 45, 69, 0.8) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
  color: transparent;
  pointer-events: none;
  user-select: none;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 25. Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.modal-close:hover { background: var(--bg-hover); color: var(--text); }

/* 26. Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  animation: toast-in 0.3s ease;
}

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-out {
  animation: toast-out 0.3s ease forwards;
}

@keyframes toast-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

.toast-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

.toast-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.toast-info {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

/* 27. View sections in app */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.view-title {
  font-size: 22px;
  font-weight: 700;
}

.view-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 2px;
}

/* 28. Search input */
.search-wrap {
  position: relative;
  max-width: 320px;
}

.search-wrap input {
  padding-left: 36px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 9px 12px 9px 36px;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

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

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}

/* 29. Alert rows */
.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(30, 45, 69, 0.5);
}

.alert-row:last-child { border-bottom: none; }

.alert-row:hover { background: var(--bg-hover); }

/* 30. Trending row */
.trending-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.trending-coin {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.trending-coin:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.trending-rank {
  font-size: 11px;
  color: var(--text-muted);
}

.trending-name {
  font-size: 14px;
  font-weight: 600;
}

/* 31. News card */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s;
  cursor: pointer;
}

.news-card:hover { border-color: var(--accent); }

.news-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.news-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
}

/* 32. Calendar events */
.event-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.event-date {
  min-width: 60px;
  text-align: center;
  background: var(--bg-hover);
  border-radius: 8px;
  padding: 8px;
}

.event-date .ed-month {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.event-date .ed-day {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.event-info { flex: 1; }
.event-title { font-weight: 600; margin-bottom: 4px; }

/* 33. Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.pagination button {
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}

.pagination button:hover,
.pagination button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* 34. Footer */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* 35. Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* 36. Section heading */
.section-heading {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 37. Tab bar (in-app) */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}

.tab-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab-btn.active {
  background: var(--bg-hover);
  color: var(--text);
}

/* 38. Utility */
.text-muted { color: var(--text-muted); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-accent { color: var(--accent); }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }

/* 39. Coin detail modal chart */
.chart-wrap {
  width: 100%;
  height: 200px;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.chart-wrap canvas,
.chart-wrap svg {
  width: 100%;
  height: 100%;
}

/* 40. Responsive */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
    z-index: 150;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .portfolio-summary { grid-template-columns: repeat(2, 1fr); }

  .nav-links .nav-hide { display: none; }

  .hero-title { font-size: 28px; }
  .hero-sub { font-size: 15px; }

  .hamburger {
    display: flex;
  }
}

/* Hamburger (mobile only) */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Plan badges */
.plan-free { background: rgba(100, 116, 139, 0.2); color: var(--text-muted); }
.plan-pro { background: rgba(139, 92, 246, 0.15); color: var(--purple); }

/* Overflow helpers */
.table-wrap {
  overflow-x: auto;
  width: 100%;
}

.no-data {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 14px;
}

/* Perps page */
.perps-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.perps-search { flex: 1; min-width: 200px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; color: var(--text); font-size: 14px; font-family: inherit; }
.perps-search:focus { outline: none; border-color: var(--accent); }
.filter-tabs { display: flex; gap: 4px; }
.filter-tab { padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; font-size: 13px; font-family: inherit; transition: background 0.15s, color 0.15s; }
.filter-tab.active { background: var(--accent); color: white; border-color: var(--accent); }
.star-btn { background: none; border: none; cursor: pointer; font-size: 16px; padding: 2px 6px; transition: transform 0.1s; line-height: 1; }
.star-btn:hover { transform: scale(1.2); }
.funding-positive { color: var(--red); font-weight: 600; }
.funding-negative { color: var(--green); font-weight: 600; }
.funding-neutral { color: var(--yellow); font-weight: 600; }
.perps-count { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.detail-panel { position: fixed; right: 0; top: 0; height: 100vh; width: 320px; background: var(--bg-card); border-left: 1px solid var(--border); z-index: 200; padding: 24px; transform: translateX(100%); transition: transform 0.25s ease; overflow-y: auto; }
.detail-panel.open { transform: translateX(0); }
.detail-panel-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; line-height: 1; }
.countdown { font-variant-numeric: tabular-nums; font-family: monospace; }
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--text); }
.th-sort.sorted { color: var(--accent); }
.watchlist-btn { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); cursor: pointer; font-size: 12px; transition: background 0.15s, color 0.15s; font-family: inherit; }
.watchlist-btn.active { background: rgba(245, 158, 11, 0.15); color: var(--yellow); border-color: var(--yellow); }
.symbol-base { font-weight: 700; color: var(--text); }
.symbol-quote { color: var(--text-muted); font-size: 12px; }

/* AI Summary */
.ai-summary-card { border-left: 3px solid var(--accent); margin-bottom: 20px; }
.ai-summary-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 600; }
.ai-summary-text { color: var(--text-muted); line-height: 1.6; font-size: 14px; }
.ai-summary-footer { margin-top: 8px; }

/* ── Heatmap ──────────────────────────────────────────────── */
.heatmap-canvas-wrap { border-radius: var(--radius); overflow: hidden; padding: 0; line-height: 0; }
.heatmap-canvas-wrap canvas { display: block; cursor: pointer; border-radius: var(--radius); }
.heatmap-legend { margin-top: 12px; padding: 0 4px; }
.heatmap-legend-bar {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, #7f1d1d, #dc2626, #374151, #065f46, #064e3b);
  margin: 6px 0 2px;
}
.heatmap-tooltip {
  display: none;
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  pointer-events: none;
  z-index: 50;
  min-width: 170px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  font-size: 13px;
  line-height: 1.5;
}

/* ── Screener ─────────────────────────────────────────────── */
.screener-controls { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; padding: 16px 20px; }
.screener-control-group { display: flex; flex-direction: column; gap: 6px; min-width: 120px; }
.screener-control-group label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.screener-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.15s;
  cursor: pointer;
}
.screener-select:focus { border-color: var(--accent); }

/* Signal badges */
.signal-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.signal-heated  { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.signal-cool    { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.signal-volatile{ background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.signal-trending{ background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }

/* ── Analytics ────────────────────────────────────────────── */
.analytics-strip {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-wrap: wrap;
}
.analytics-metric {
  flex: 1;
  min-width: 130px;
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}
.analytics-metric:last-child { border-right: none; }
.analytics-metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.analytics-metric-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

/* Correlation matrix */
.corr-table { border-collapse: collapse; font-size: 12px; }
.corr-table th { padding: 6px 10px; color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; white-space: nowrap; }
.corr-cell { width: 70px; text-align: center; padding: 8px 10px; font-size: 13px; font-weight: 600; border: 1px solid rgba(30,45,69,0.4); }
