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

/* Color palette + sizing variables */
:root {
  --bg: #020712;
  --bg-elevated: #070d1b;
  --bg-card: #0b1224;
  --bg-card-alt: #0f1629;
  --border-subtle: rgba(255, 255, 255, 0.05);

  --accent: #4f8bff;
  --accent-soft: rgba(79, 139, 255, 0.16);
  --accent-strong: #79a9ff;

  --text-main: #f8fafc;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;

  --font-sans: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;

  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-soft: 0 22px 45px rgba(0, 0, 0, 0.65);
}

/* Page layout */
html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at top, #121a38 0, var(--bg) 55%);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  padding: 20px 16px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Constrain content width for big screens */
.hero,
.content {
  width: 100%;
  max-width: 1120px;
}

/* Hero Section */
.hero__inner {
  background: radial-gradient(
    circle at top left,
    #152042 0,
    #050814 45%,
    #020712 100%
  );
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  padding: 28px 18px 26px;
}

.hero__title {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  color: var(--accent-strong);
}

.hero__tagline {
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  font-weight: 600;
  text-align: center;
  margin-top: 4px;
  margin-bottom: 20px;
  color: var(--text-main);
  padding: 6px 10px;
}

.hero__subtitle {
  text-align: center;
  font-size: 1rem;
  color: var(--text-soft);
  max-width: 800px;
  margin: 0 auto 22px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding-bottom: 16px;
}

/* Stat Cards */
.hero__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-card-alt));
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--accent);
  box-shadow: 0 0 5px var(--accent-strong);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(79, 139, 255, 0.14),
    transparent 55%
  );
  opacity: 0.7;
  pointer-events: none;
}

.stat-card__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.stat-card__value {
  font-size: 1.1rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.golden-card {
  border: 1px solid rgb(185, 159, 14);
  box-shadow: 0 0 5px rgb(185, 159, 14);
}

.golden-card .stat-card__label {
  color: gold;
}

.green-card {
  border: 1px solid #1c9e4c;
  box-shadow: 0 0 5px #1c9e4c;
}

.green-card .stat-card__label {
  color: #22c55e;
}

/* Content / Chart Section */
.content {
  margin-top: 20px;
  margin-bottom: 24px;
}

.chart-section {
  background: linear-gradient(155deg, #050814 0, #050814 55%, #040915 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  padding: 18px 14px 20px;
  box-shadow: var(--shadow-soft);
}

/* Header + buttons in one row */
.chart-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.chart-section__header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 0;
}

/* Arrow indicators */
.arrow-icon {
  font-weight: 700;
  margin-right: 6px;
}

.arrow-up {
  color: #ef4444;
}

.arrow-down {
  color: #22c55e;
}

.arrow-none {
  color: #aaaf9c;
}

/* Chart controls (buttons) */
.chart-section__controls {
  display: inline-flex;
  gap: 8px;
  padding: 5px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.12);
  margin-bottom: 14px;
}

.chart-toggle {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.16s ease-out, color 0.16s ease-out,
    transform 0.1s ease-out;
  white-space: nowrap;
}

.chart-toggle:hover {
  color: var(--text-main);
  transform: translateY(-1px);
}

.chart-toggle--active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* Placeholder for future chart */
.chart-placeholder {
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: radial-gradient(
    circle at top,
    rgba(15, 23, 42, 0.9) 0,
    #020617 60%
  );
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.chart-placeholder__text {
  font-size: 0.8rem;
  color: var(--text-soft);
  text-align: center;
}

.chart-placeholder {
  margin-top: 1.5rem;
  border-radius: 18px;
  background: #050816;
  padding: 1rem;
}

#price-chart {
  width: 100%;
  height: 480px;
}

/* Footer */
.footer {
  margin-top: auto;
  padding-top: 12px;
  font-size: 0.75rem;
  color: var(--text-soft);
  text-align: center;
}

.table-section {
  margin-top: 3rem;
  padding: 2rem;
  background: #0b0f1c;
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
}

.table-section h2 {
  font-size: 1.6rem;
  margin-bottom: 1.2rem;
  color: #e2e8f0;
  font-weight: 600;
}

.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #0f1629;
}

#recent-rates-table {
  width: 100%;
  border-collapse: collapse;
}

#recent-rates-table thead {
  background: rgba(255, 255, 255, 0.04);
}

#recent-rates-table th,
#recent-rates-table td {
  padding: 0.9rem 1rem;
  text-align: left;
  font-size: 0.92rem;
  color: #cbd5e1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

#recent-rates-table tbody tr:last-child td {
  border-bottom: none;
}

#recent-rates-table th {
  text-transform: uppercase;
  font-size: 0.75rem;
}

/* Dataset Info Cards Section */
.dataset-info {
  margin-top: 3rem;
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
}

.info-card {
  background: linear-gradient(145deg, var(--bg-card), var(--bg-card-alt));
  border-radius: var(--radius-xl);
  padding: 1.6rem 1.4rem;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
}

.info-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--accent-strong);
}

.info-card ul {
  list-style: none;
  display: grid;
  gap: 0.8rem;
  margin-top: 0.7rem;
  margin-bottom: 20px;
}

.info-card ul li::before {
  content: "►";
  margin-right: 0.4rem;
  color: var(--accent);
}

.info-card p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.info-card {
  display: flex;
  flex-direction: column;
}

.info-card .btn-outline,
.info-card .btn-primary {
  margin-top: auto;
}

.btn-outline,
.btn-primary {
  display: block;
  text-align: center;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  margin-top: 0.7rem;
  text-decoration: none;
  font-weight: 600;
  transition: 0.18s ease-in-out;
}

.btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-main);
  margin-top: 1rem;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-primary {
  background: #16a34a;
  color: #fff;
  margin-top: 1rem;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.info-card span {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.8rem 0;
}

/* Responsive layout */
@media (min-width: 860px) {
  .dataset-info {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Custom Scrollbar for Table */
.table-container::-webkit-scrollbar {
  height: 8px;
  /* horizontal scrollbar */
  width: 8px;
  /* vertical scrollbar */
}

.table-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb {
  background: var(--accent-soft);
  border-radius: 10px;
  border: 1px solid var(--accent);
  /* subtle outline glow */
  transition: background 0.2s ease-in-out;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-strong);
}

/* Firefox */
.table-container {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.05);
}

/* Responsive breakpoints  */

/* Medium screens and up */
@media (min-width: 640px) {
  .page {
    padding: 28px 24px 36px;
  }

  .hero__inner {
    padding: 32px 26px 26px;
  }

  .hero__stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .stat-card {
    padding: 16px 16px 14px;
  }

  .chart-section {
    padding: 22px 18px 22px;
  }

  .chart-placeholder {
    min-height: 320px;
  }
}

/* Large screens */
@media (min-width: 960px) {
  .page {
    padding-top: 36px;
  }

  .hero__title {
    font-size: 2.2rem;
  }

  .hero__subtitle {
    font-size: 0.9rem;
  }

  .chart-section__header h2 {
    font-size: 1.25rem;
  }

  .chart-section {
    padding: 26px 24px 26px;
  }

  .chart-placeholder {
    min-height: 360px;
  }
}

/* Model Performance Section */
.model-performance {
  margin-top: 2.4rem;
  margin-bottom: 2.4rem;
  padding: 1.8rem 1.4rem;
  background: linear-gradient(155deg, #050814 0, #050814 55%, #040915 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

.model-performance h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-strong);
  margin-bottom: 1.4rem;
  letter-spacing: 0.03em;
}

/* Grid of metrics */
.model-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.4rem;
}

.model-metric {
  padding: 1rem 1.2rem;
  background: linear-gradient(145deg, var(--bg-card), var(--bg-card-alt));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--accent);
  box-shadow: 0 0 5px var(--accent-strong);
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.metric-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.model-performance .golden-card {
  border: 1px solid rgb(185, 159, 14);
  box-shadow: 0 0 5px rgb(185, 159, 14);
}

.model-performance .golden-card .metric-label {
  color: gold;
}

/* Larger screens → more columns */
@media (min-width: 700px) {
  .model-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1000px) {
  .model-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
