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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff4757, #5f27cd, #00d2d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.1em;
    color: #a0a0a0;
    margin-bottom: 15px;
}

.update-info {
    margin-top: 15px;
}

.update-time {
    font-size: 0.9em;
    color: #707070;
    margin-bottom: 5px;
}

.data-freshness {
    font-size: 0.85em;
    padding: 5px 12px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 500;
}

.data-freshness.fresh {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.data-freshness.stale {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* Introduction Section */
.intro-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px 40px;
    margin-bottom: 40px;
    border-left: 4px solid #00d2d3;
}

.intro-section h2 {
    font-size: 1.6em;
    margin-bottom: 20px;
    color: #00d2d3;
    text-align: center;
}

.intro-text {
    font-size: 1.05em;
    line-height: 1.8;
    color: #e0e0e0;
    text-align: center;
    margin-bottom: 30px;
}

.intro-text strong {
    color: #ffffff;
}

.fear-text {
    color: #ff4757;
    font-weight: 600;
}

.greed-text {
    color: #2ed573;
    font-weight: 600;
}

.formula-box {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
}

.formula-box h3 {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #ffffff;
    text-align: center;
}

.formula-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
}

.formula-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(0, 210, 211, 0.3);
}

.formula-label {
    font-size: 0.9em;
    color: #a0a0a0;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.formula-math {
    font-family: 'Courier New', monospace;
    font-size: 1.05em;
    color: #00d2d3;
    font-weight: 600;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.chart-explanation {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 20px;
}

.chart-explanation p {
    margin: 8px 0;
    color: #e0e0e0;
    line-height: 1.7;
}

.chart-explanation strong {
    color: #ffc107;
}

.fear-marker {
    color: #ff4757;
    font-weight: 600;
}

.greed-marker {
    color: #2ed573;
    font-weight: 600;
}

/* Calendar Heatmap (GitHub Style) */
.calendar-heatmap-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
}

.calendar-heatmap-section h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #e0e0e0;
    text-align: center;
}

.calendar-subtitle {
    text-align: center;
    color: #a0a0a0;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.calendar-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow-x: auto;
}

.calendar-year {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-year-header {
    font-size: 1.1em;
    font-weight: 600;
    color: #00d2d3;
    margin-bottom: 3px;
}

.calendar-months {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-start;
}

.calendar-month {
    width: 180px;
    flex-shrink: 0;
}

.calendar-month-header {
    font-size: 0.85em;
    font-weight: 600;
    color: #a0a0a0;
    margin-bottom: 5px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
}

.calendar-day:hover {
    transform: scale(1.5);
    z-index: 10;
    box-shadow: 0 0 6px rgba(0, 210, 211, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.calendar-day.fear {
    background: #ff4757;
}

.calendar-day.greed {
    background: #2ed573;
}

.calendar-day.empty {
    background: rgba(255, 255, 255, 0.08);
}

.calendar-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    color: #e0e0e0;
}

.legend-color {
    width: 11px;
    height: 11px;
    border-radius: 2px;
}

/* Current Regime Card */
.current-regime {
    margin-bottom: 40px;
}

.regime-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.regime-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.regime-icon {
    font-size: 4em;
    line-height: 1;
}

.regime-label {
    font-size: 3em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.regime-card.fear .regime-icon,
.regime-card.fear .regime-label {
    color: #ff4757;
}

.regime-card.greed .regime-icon,
.regime-card.greed .regime-label {
    color: #2ed573;
}

.regime-confidence {
    font-size: 1.2em;
    color: #a0a0a0;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.metric-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: transform 0.2s, background 0.2s;
}

.metric-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.metric-label {
    font-size: 0.9em;
    color: #a0a0a0;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #00d2d3;
}

.last-switch {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    color: #ffc107;
}

/* Period Statistics */
.period-stats {
    margin-bottom: 40px;
}

.period-stats h2 {
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #e0e0e0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
}

.stat-card h3 {
    font-size: 1.2em;
    margin-bottom: 20px;
    color: #e0e0e0;
    text-align: center;
}

.stat-bar {
    height: 40px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    margin-bottom: 15px;
}

.bar-fear {
    background: linear-gradient(90deg, #ff4757, #ff6348);
    transition: width 0.5s ease;
}

.bar-greed {
    background: linear-gradient(90deg, #2ed573, #7bed9f);
    transition: width 0.5s ease;
}

.stat-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.95em;
    margin-bottom: 10px;
}

.fear-label {
    color: #ff4757;
}

.greed-label {
    color: #2ed573;
}

.stat-switches {
    text-align: center;
    color: #a0a0a0;
    font-size: 0.9em;
}

/* Regime Duration Statistics */
.regime-stats {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
}

.regime-stats h2 {
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #e0e0e0;
    text-align: center;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stats-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.stats-card.fear-themed {
    border-left: 4px solid #ff4757;
}

.stats-card.greed-themed {
    border-left: 4px solid #2ed573;
}

.stats-card.neutral-themed {
    border-left: 4px solid #00d2d3;
}

.stats-card.current-themed {
    border-left: 4px solid #ffc107;
}

.stats-icon {
    font-size: 2.5em;
    line-height: 1;
    flex-shrink: 0;
}

.stats-content {
    flex: 1;
}

.stats-label {
    font-size: 0.9em;
    color: #a0a0a0;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-value {
    font-size: 2.2em;
    font-weight: bold;
    color: #ffffff;
    line-height: 1;
    margin-bottom: 5px;
}

.stats-unit {
    font-size: 0.85em;
    color: #707070;
}

/* Timeline Chart */
.timeline-chart {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
}

.timeline-chart h2 {
    font-size: 1.8em;
    margin-bottom: 30px;
    color: #e0e0e0;
}

#timelineChart7d,
#timelineChart30d,
#timelineChart100d,
#timelineChart365d {
    max-height: 400px;
}

/* Historical Events Section */
.events-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
}

.events-section h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #e0e0e0;
    text-align: center;
}

.events-intro {
    text-align: center;
    color: #a0a0a0;
    margin-bottom: 20px;
    font-size: 1.05em;
}

.accuracy-badge {
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 30px;
    background: rgba(46, 213, 115, 0.1);
    border: 2px solid rgba(46, 213, 115, 0.3);
    color: #2ed573;
}

.events-table-container {
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
}

.events-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.events-table thead {
    background: rgba(255, 255, 255, 0.1);
}

.events-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #00d2d3;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.events-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.events-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.events-table td {
    padding: 15px 12px;
    color: #e0e0e0;
}

.event-name {
    font-weight: 600;
    color: #ffffff;
}

.event-description {
    font-size: 0.9em;
    color: #a0a0a0;
}

.regime-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.regime-badge.fear {
    background: rgba(255, 71, 87, 0.2);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.4);
}

.regime-badge.greed {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.4);
}

.confidence-value {
    font-weight: 600;
    color: #00d2d3;
}

.result-icon {
    font-size: 1.5em;
    text-align: center;
}

.result-icon.match {
    color: #2ed573;
}

.result-icon.mismatch {
    color: #ff4757;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: #707070;
    font-size: 0.9em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer p {
    margin: 10px 0;
}

footer a {
    color: #00d2d3;
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: #2ed573;
}

.github-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.separator {
    color: #505050;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
    }
    
    .regime-label {
        font-size: 2em;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
