@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto+Mono:wght@500&display=swap');

html { scroll-behavior: smooth; }

:root {
  /* M3 Dark Theme Surface Colors */
  --md-sys-color-background: #121212;
  --md-sys-color-surface: #1E1E1E;
  --md-sys-color-surface-container: #282828;
  --md-sys-color-surface-container-high: #333333;
  
  /* Text & Accents */
  --md-sys-color-on-background: #E3E3E3;
  --md-sys-color-on-surface-variant: #C4C7C5;
  --md-sys-color-primary: #58a6ff; 
  --md-sys-color-primary-hover: #79b8ff;
  --md-sys-color-outline: #444746;
  
  /* Ticker specifics & Legacy Variables */
  --ticker-bg: #0A0A0A;
  --bg: #1b1b1b; 
  --panel: #212121; 
  --ink: #f2f2f2; 
  --muted: #bdbdbd;
  --accent: #58a6ff; 
  --border: #2a2a2a; 
  --ink-weak: #d6d6d6;
  --ticker-border: #222;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; 
  background: var(--md-sys-color-background); 
  color: var(--md-sys-color-on-background);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
}

/* === Custom Scrollbar === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--md-sys-color-background); }
::-webkit-scrollbar-thumb { background: var(--md-sys-color-outline); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--md-sys-color-primary); }

/* === Typography & Structure === */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }
.mono-text { font-family: 'Roboto Mono', monospace; }

.card {
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline);
  padding: 24px; 
  border-radius: 16px; 
  margin-bottom: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.muted { color: var(--muted); }

/* === Inputs & Buttons === */
input[type="text"] {
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-background);
  border: 1px solid var(--md-sys-color-outline);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2);
}

.btn-sliced {
  position: relative;
  background: transparent;
  color: var(--md-sys-color-primary);
  font-family: 'Roboto Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 24px;
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.2s ease;
}

.btn-sliced::before,
.btn-sliced::after {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1; transition: transform 0.3s cubic-bezier(0.86, 0, 0.07, 1);
}

.btn-sliced::before {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-primary);
  transform: skewX(-15deg);
}

.btn-sliced::after {
  background: var(--md-sys-color-primary);
  transform: skewX(-15deg) scaleX(0);
  transform-origin: right;
}

.btn-sliced:hover { color: #121212; }
.btn-sliced:hover::after { transform: skewX(-15deg) scaleX(1); transform-origin: left; }
.btn-sliced:disabled { opacity: 0.5; cursor: not-allowed; }

/* === Tickers === */
.ticker {
  position: sticky; z-index: 1100;
  background: var(--ticker-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ticker-border);
  overflow: hidden; white-space: nowrap;
  height: 40px; display: flex; align-items: center;
}

.ticker-bull { top: 0; }
.ticker-bear { top: 40px; border-bottom: 1px solid #3a1111; background: #0a0000; }

.ticker__track {
  display: inline-flex; gap: 20px; align-items: center;
  animation: ticker-scroll 26s linear infinite;
  will-change: transform; padding-left: 100%;
}

.ticker-bear .ticker__track { animation-duration: 30s; }

.ticker__item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: #161616;
  font-weight: 600; font-size: 14px;
}

.ticker-bear .ticker__item { border-color: #5c1818; background: #240a0a; }
.ticker-bear .ticker__label { color: #ff9999; }
.ticker__item img { width: 18px; height: 18px; display: block; }
.ticker__label { color: var(--muted); font-weight: 500; margin-left: 2px; }

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

/* === Layout & Navigation === */
header {
  position: sticky; top: 80px; z-index: 1000;
  background: #111; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
}

header .brand { display: flex; gap: 10px; align-items: center; }
header .brand h1 { font-size: 18px; margin: 0; font-weight: 600; }
nav a { margin-left: 16px; font-weight: 600; color: var(--ink-weak); text-decoration: none; }
nav a:hover { color: var(--accent); }

main { max-width: 1150px; margin: 0 auto; padding: 22px; }

.intro-section { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.intro-text { flex: 1 1 420px; }
.intro-logo img { width: 140px; height: auto; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,0.25); }

.quicklinks { display: flex; flex-wrap: wrap; gap: 10px; }
.quicklinks a {
  border: 1px solid var(--border); background: var(--panel);
  padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-weak);
}
.quicklinks a:hover { border-color: var(--accent); }

a[href*="youtube.com"] { color: #ff4444; font-weight: 600; text-decoration: none; }
a[href*="youtube.com"]:hover { text-decoration: underline; }

/* === Content & Tables === */
.content :is(h1,h2,h3,h4) {
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px; margin-top: 28px;
}
.content h1 { font-size: 28px; }
.content h2 { font-size: 22px; }
.content h3 { font-size: 18px; }
.content :is(h1,h2,h3,h4)[id] { scroll-margin-top: 140px; }

/* The new, clean table styles */
.content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 16px 0;
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 12px;
    overflow: hidden;
    table-layout: auto; /* Reverted to auto to stop overflow */
}

.content th, .content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-on-background);
    /* Allow wrapping so full names are visible, but keep numbers on one line if possible */
    white-space: normal; 
    word-break: break-word; /* Prevents extremely long unbroken strings from blowing out the table */
}

/* Specifically keep links/numbers on one line if you prefer */
.content td a {
    white-space: nowrap; 
}
/* Subtle, classy highlight color instead of that bright blue */
/* Lighter, cooler hover state */
/* Subtle, classy highlight color instead of that bright blue */
/* Make hover visually override the zebra striping smoothly */
.content tr:hover td {
    background: rgba(88, 166, 255, 0.08) !important; 
    transition: background 0.1s ease-in-out;
}

/* Keep Header locked at top while scrolling */
.content thead th { 
    position: sticky; 
    top: 140px; 
    z-index: 10; 
    background: var(--md-sys-color-surface-container-high); 
    color: var(--md-sys-color-primary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.content tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* The new link styles */
.content a { color: #8ab4f8; text-decoration: none; font-weight: 500; transition: font-weight 0.2s ease; }
.content a:hover { font-weight: 700; }
.content a:visited, .content a:active { color: #8ab4f8; text-decoration: none; }

.table-wrap { overflow-x: auto; }
.content table { min-width: 640px; }
.content table {
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Overrides for hardcoded markdown inline styles */
.content [style*="color: black"] { color: var(--ink) !important; }
.content [style*="background-color: black"] { background-color: transparent !important; }
.content [style*="border: 1px solid white"] { border: 1px solid var(--border) !important; }

.content tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.04);
}
.content thead { position: sticky; top: 140px; z-index: 10; }
/* === Widget Grid === */
.widget-dashboard {
  max-width: 1150px; margin: 30px auto 0; padding: 0 20px;
  display: grid; grid-template-columns: 2fr 1fr; gap: 25px;
}

.widget-window {
  position: relative; width: 100%; height: 350px; 
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.widget-label {
  position: absolute; top: 12px; left: 15px; z-index: 10;
  background: rgba(0, 0, 0, 0.7); color: var(--accent);
  font-size: 13px; font-weight: 700; padding: 4px 10px;
  border-radius: 4px; pointer-events: none; border: 1px solid #333;
}

.perfect-iframe { width: 100%; height: 100%; border: none; background: black; }
.full-width-widget { grid-column: 1 / -1; height: 600px; }

/* === Footer & Back to Top === */
footer {
  border-top: 1px solid var(--border);
  text-align: center; padding: 24px; color: var(--muted);
}

#topBtn {
  position: fixed; right: 24px; bottom: 24px; display: none;
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 10px 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.25); z-index: 2000;
}
#topBtn:hover { opacity: .9; }

/* === Animations === */
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}

.ai-processing {
  animation: pulse 1.5s infinite ease-in-out;
  color: var(--md-sys-color-primary);
}

/* === Responsive === */
@media (max-width: 768px) {
  .widget-dashboard { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .intro-section { flex-direction: column-reverse; text-align: center; }
  .intro-logo img { width: 120px; margin-bottom: 12px; }
}




