:root {
  --bg-body: #ffffff;
  --text-main: #111827;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --border-color: #e4e4e7;
  --border-dark: #27272a;
  --color-up: #16a34a;
  --color-down: #dc2626;
  --color-accent: #2563eb;
  --font-serif: "Playfair Display", serif;
  --font-sans: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

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

body {
  margin: 0;
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.navbar {
  border-bottom: 2px solid var(--text-main);
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: var(--text-main);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  border-radius: 0;
}

.brand-text {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.6rem 2rem;
}


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

  .navbar {
    padding: 0.8rem 1rem;
  }
}

.content-frame {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 3rem;
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  align-items: stretch;
}

@media (max-width: 1024px) {
  .content-frame {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.25rem;
  }
}

.main-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.status-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  overflow-x: auto;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.status-bar::-webkit-scrollbar {
  display: none;
}

.status-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-right: 8px;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.controls {
    padding: 20px 30px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.refresh-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.refresh-btn:active {
    transform: translateY(0);
}

.icon {
    font-size: 18px;
}

.status {
    font-size: 14px;
    color: #666;
}

.content {
    padding: 5px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* Chart Info */
.chart-info {
    font-family: var(--font-serif);
    text-align: center;
    margin-bottom: 20px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.chart-info p {
    font-size: 18px;
    color: #666;
}

.chart-info strong {
    color: #333;
}

/* Canvas Container */
.main-container {
    font-family: "Playfair Display", serif;
    display: flex;
    justify-content: center;
    margin: 20px 0;
    overflow-x: auto;
}

.chart-container {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 25px;
    margin-bottom: 30px;
    position: relative;
    min-height: 500px;
}

.chart-wrapper {
    position: relative;
    height: 400px;
    width: 100%;
}

/* Canvas Container */
.canvas-container {
    font-family: "Playfair Display", serif;
    display: flex;
    justify-content: center;
    margin: 20px 0;
    overflow-x: auto;
    gap: 12px;
}

canvas {
    font-family: "Playfair Display", serif;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Legend */
.legend {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.legend-title {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 16px;
    color: #333;
}

#legendItems {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.legend-label {
    font-size: 14px;
    color: #666;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table, th, td {
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 15px;
    font-size: 14px;
    color: #333;
}

td:nth-child(4), td:nth-child(5) {
    font-weight: 600;
    color: #667eea;
}

/* Loading and Error */
.loading, .error {
    display: none;
    text-align: center;
    padding: 40px;
    font-family: "Playfair Display", serif;
    font-size: 14px;
}

.loading {
    color: #667eea;
}

.loading.show {
    display: block;
}

.error {
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    margin: 20px;
}

.error.show {
    display: block;
}

/* fix logo size */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo-img {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain;
  border-radius: 6px;
  flex: 0 0 auto;
}

/* donate footer */
.donate-footer {
  width: 100%;
  text-align: center;
  margin: 24px 0 28px;
  padding: 0;
  color: #6b7280;
  font-size: 14px;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.donate-footer .donate-address {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }

    .controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-btn {
        text-align: left;
    }

    canvas {
        max-width: 100%;
        height: auto;
    }
}

/* page tabs */
.page { display: none; }
.page.active { display: block; }

.nav-link.active {
  color: var(--text-main);
  text-decoration: underline;
  text-underline-offset: 6px;
}

.hot-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.hot-tab {
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
}

.hot-tab.active {
  border-color: var(--text-main);
  background: #f4f4f5;
  color: var(--text-main);
  font-weight: 600;
}

.hot-layout {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1200px) {
  .hot-layout {
    grid-template-columns: 1fr;
  }
}

.hot-right {
  position: sticky;
  top: 96px;
}

.hot-side-card {
  border: 1px solid var(--border-color);
  background: #ffffff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
}

.hot-side-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.hot-side-meta {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}

.hot-side-section {
  border-top: 1px dashed var(--border-color);
  padding-top: 12px;
}

.hot-side-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.hot-side-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.hot-side-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  padding-bottom: 6px;
}

.hot-side-row span:first-child {
  font-family: var(--font-mono);
  color: var(--text-main);
}

.hot-side-row span:last-child {
  font-weight: 600;
}

.hot-ai-card {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hot-ai-title {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.hot-ai-title span:last-child {
  font-family: var(--font-mono);
}

.hot-ai-reason {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.data-summary {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-bottom: 30px;
    gap: 15px;
}

.summary-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    padding: 20px;
    text-align: center;
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.summary-card h3 {
    color: #657786;
    font-size: 1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.summary-value {
    font-size: 2.2rem;
    font-weight: 700;
}

.tweets-summary .summary-value {
    color: #1da1f2;
}

.estimated-summary .summary-value {
    color: #17bf63;
}

.daysleft-summary .summary-value {
    color: #794bc4;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    background-color: #1da1f2;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: #0d8ddc;
    transform: translateY(-2px);
}

.btn.active {
    background-color: #0d8ddc;
    box-shadow: 0 4px 8px rgba(29, 161, 242, 0.3);
}

.data-table {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    width: 100%;
    border-collapse: collapse;
    margin-top: 30px;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.data-table th {
    background-color: #f5f8fa;
    color: #657786;
    font-weight: 600;
    text-align: center;
    padding: 15px;
    border-bottom: 1px solid #e1e8ed;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e1e8ed;
    text-align: center;
}

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

.data-table tr:hover {
    background-color: #f5f8fa;
}

.date-cell {
    font-weight: 600;
    color: #14171a;
}

.tweets-cell {
    color: #1da1f2;
    font-weight: 600;
}

.replies-cell {
    color: #17bf63;
    font-weight: 600;
}
