/*  - Minimal, monospace, black and white */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #000;
    background: #fff;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 60px;
    padding-bottom: 80px; /* Space for footer */
}

/* Header */
.header {
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.back-link {
    font-size: 12px;
    margin-top: 5px;
}

.back-link a {
    color: #000;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

.page-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    text-transform: uppercase;
}

/* Running News Ticker */
.news-ticker {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #000;
    padding: 8px 0;
    z-index: 1000;
    overflow: hidden;
    white-space: nowrap;
}

.ticker-content {
    display: inline-block;
    animation: ticker 60s linear infinite;
    white-space: nowrap;
}

.ticker-content.paused {
    animation-play-state: paused;
}

.tldr-item {
    display: inline-block;
    margin-right: 30px;
    cursor: pointer;
    transition: text-decoration 0.2s;
}

.tldr-item:hover {
    text-decoration: underline;
}

.tldr-separator {
    margin: 0 15px;
    color: #666;
}

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

/* Main Tabs */
.main-tabs {
    margin-bottom: 40px;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #000;
    margin-bottom: 20px;
}

.tab-button {
    background: none;
    border: none;
    padding: 10px 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.tab-button:hover {
    border-bottom-color: #ccc;
}

.tab-button.active {
    border-bottom-color: #000;
    font-weight: bold;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Timeline Container */
.timeline-container {
    margin-bottom: 40px;
}

.graph-header {
    margin-bottom: 20px;
}

.graph-title {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.graph-subtitle {
    font-size: 12px;
    color: #666;
}

.graph-wrapper {
    position: relative;
    height: 1000px; /* Significantly increased height for better chart display */
    margin-top: 20px;
    overflow: hidden; /* Changed from auto to hidden for infinite canvas effect */
    border: 1px solid #ccc;
    background: #f9f9f9;
    cursor: grab; /* Indicate draggable area */
}

.graph-wrapper:active {
    cursor: grabbing; /* Indicate dragging state */
}

.graph-wrapper svg {
    position: relative;
    z-index: 1;
    cursor: grab;
}

.graph-wrapper svg.dragging {
    cursor: grabbing;
}

.graph-wrapper .minimap-container {
    z-index: 1000;
}

/* Alternate timeline specific graph wrapper with increased height */
#alternate-tab .graph-wrapper {
    height: 1200px; /* Significantly increased height for better chart display */
}

/* Minimap styles */
.minimap-container {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
    z-index: 1000;
    pointer-events: none; /* Don't interfere with main canvas */
}

.minimap-container svg {
    width: 100%;
    height: 100%;
}

.minimap-node {
    pointer-events: none;
}

.viewport-rect {
    pointer-events: none;
}

/* Sticky month axis styles */
.sticky-month-axis {
    pointer-events: none;
}

.sticky-month-axis text {
    font-family: 'Courier New', monospace;
    font-size: 10px;
}

.sticky-month-axis line {
    stroke: #000;
    stroke-width: 1px;
}

.sticky-month-axis path {
    stroke: #000;
    stroke-width: 1px;
}

.sticky-axis-label {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    pointer-events: none;
}

/* Month header styles */
.month-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid #ccc;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.month-header .month-label {
    flex: 1;
    text-align: center;
}

/* Month background stripes for alternate timelines */
.month-background {
    fill: #f0f0f0;
}

.month-background:nth-child(even) {
    fill: #e0e0e0;
}

/* Alternate timeline specific styles */
.alternate-timeline {
    margin-bottom: 20px;
}

.alternate-timeline-title {
    font-size: 14px;
    font-weight: bold;
    display: none;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: #333;
}

/* Summary Section */
.summary-section {
    margin-bottom: 30px;
    padding: 15px;
    border: 1px solid #000;
    background: #f9f9f9;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.stat-item {
    font-size: 12px;
}

.stat-label {
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 3px;
}

.stat-value {
    color: #666;
}

/* Categories Section */
.categories-section {
    margin-bottom: 40px;
}

.categories-section h2 {
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 20px;
}

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

.category-card {
    border: 1px solid #000;
    padding: 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: #000;
}

.category-card:hover {
    background: #f0f0f0;
}

.category-card h3 {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.category-card .category-description {
    font-size: 12px;
    display:none;
    color: #666;
    margin-bottom: 10px;
}

.category-card .category-stats {
    font-size: 11px;
    color: #999;
}

/* Placeholder Content */
.placeholder-content {
    padding: 40px;
    text-align: center;
}

.placeholder-content h2 {
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.placeholder-box {
    border: 2px dashed #ccc;
    padding: 60px 20px;
    margin-top: 20px;
}

.placeholder-text {
    font-size: 14px;
    color: #999;
    text-transform: uppercase;
}

/* Markets and Articles Section */
.markets-articles-section {
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.markets-articles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.markets-section, .articles-section {
    border: 1px solid #000;
    padding: 20px;
    background: #f9f9f9;
}

.markets-section h3, .articles-section h3 {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.market-item, .article-item {
    border-bottom: 1px solid #ccc;
    padding: 15px 0;
}

.clickable {
    cursor: pointer;
    transition: background-color 0.2s ease;
    padding: 15px;
    margin: 0 -15px;
    border-radius: 4px;
}

.clickable:hover {
    background-color: #f0f0f0;
}

.clickable:active {
    background-color: #e0e0e0;
}

.clickable .market-title::after,
.clickable .article-title::after {
    content: " ↗";
    font-size: 10px;
    color: #666;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.clickable:hover .market-title::after,
.clickable:hover .article-title::after {
    opacity: 1;
}

.market-item:last-child, .article-item:last-child {
    border-bottom: none;
}

.market-title, .article-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
}

.market-price, .article-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.market-sparkline {
    height: 40px;
    background: #fff;
    border: 1px solid #ccc;
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.market-sparkline svg {
    width: 100%;
    height: 100%;
}

.article-summary {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
}

/* Timeline Legend */
.timeline-legend {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ccc;
    background: #f9f9f9;
}

.timeline-legend h3 {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

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

.legend-color {
    width: 12px;
    height: 12px;
    border: 1px solid #000;
}

/* Node Styles */
.node {
    cursor: pointer;
}

.node circle {
    fill: #fff;
    stroke: #000;
    stroke-width: 2px;
    cursor: pointer;
}

.node text {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    text-anchor: middle;
    pointer-events: none;
}

.node:hover circle {
    fill: #f0f0f0;
}

.link {
    fill: none;
    stroke: #000;
    stroke-width: 1px;
    pointer-events: none;
}

/* Node Details Panel */
.node-details {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 2px solid #000;
    padding: 20px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.node-details h3 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.node-details .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #000;
    color: #fff;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

.node-details .detail-item {
    margin-bottom: 10px;
}

.node-details .detail-label {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 11px;
    margin-bottom: 3px;
}

.node-details .detail-value {
    font-size: 12px;
    color: #333;
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #000;
    padding: 10px 20px;
    text-align: center;
    font-size: 10px!important;
    z-index: 1000;
}

.footer a {
    color: #000;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px;
        font-size: 13px;
        padding-top: 50px;
    }

    .header h1 {
        font-size: 20px;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .markets-articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .summary-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .legend-items {
        grid-template-columns: 1fr;
    }

    .node-details {
        max-width: 90vw;
        max-height: 70vh;
    }

    .graph-wrapper {
        height: 1000px; /* Increased height for mobile */
    }
}

/* General Summary Content Styles */
.general-summary-content {
    max-width: 100%;
    line-height: 1.6;
}

.summary-container {
    padding: 30px;
    background: #fff;
    border: 2px solid #000;
    margin-bottom: 30px;
}

.summary-header {
    margin-bottom: 25px;
    border-bottom: 1px solid #000;
    padding-bottom: 15px;
}

.summary-header h2 {
    font-size: 22px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.summary-subtitle {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.summary-description {
    margin-bottom: 25px;
}

.summary-description p {
    font-size: 14px;
    line-height: 1.7;
    text-align: left;
    margin-bottom: 20px;
}

.summary-section {
    margin-bottom: 20px;
}

.summary-section h3 {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: #333;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.summary-section ul {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
}

.summary-section li {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

.summary-section li:before {
    content: "•";
    position: absolute;
    left: 0;
    font-weight: bold;
}

.summary-meta {
    border-top: 1px solid #000;
    padding-top: 20px;
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    font-size: 12px;
}

.meta-item {
    padding: 10px;
    background: #f0f0f0;
    border: 1px solid #ccc;
}

.meta-item strong {
    text-transform: uppercase;
    font-size: 11px;
}

/* Responsive adjustments for general summary */
@media (max-width: 768px) {
    .summary-container {
        padding: 20px;
    }
    
    .summary-section {
        margin-bottom: 15px;
    }
    
    .summary-section h3 {
        font-size: 14px;
    }
    
    .summary-section li {
        font-size: 12px;
    }
    
    .summary-meta {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .summary-description p {
        font-size: 13px;
    }
}

/* About Page Styles */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.about-content h2 {
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 30px;
    text-align: center;
}

.about-section {
    margin-bottom: 40px;
    padding: 20px;
    border: 1px solid #000;
    background: #fff;
}

.about-section h3 {
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #ccc;
    padding-bottom: 8px;
}

.about-section p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.about-section ul {
    list-style: none;
    padding: 0;
}

.about-section li {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
}

.about-section li:before {
    content: "•";
    position: absolute;
    left: 0;
    font-weight: bold;
}

.process-steps {
    margin-top: 20px;
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
    padding: 15px;
    border: 1px solid #ccc;
    background: #f9f9f9;
}

.step-number {
    width: 40px;
    height: 40px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-right: 20px;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: #333;
}

.step-content p {
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.visualization-guide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.viz-item {
    padding: 15px;
    border: 1px solid #ccc;
    background: #f9f9f9;
}

.viz-item h4 {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: #333;
}

.viz-item p {
    font-size: 12px;
    margin-bottom: 10px;
}

.viz-item ul {
    font-size: 11px;
}

/* Read More/Less Styles */
.read-more-container {
    position: relative;
    margin-bottom: 20px;
}

.read-more-text {
    position: relative;
    overflow: hidden;
    line-height: 1.6;
}

.read-more-text.collapsed {
    max-height: 4.8em; /* 3 lines of text */
    overflow: hidden;
}

.read-more-text.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2em;
    background: linear-gradient(transparent, #fff);
    pointer-events: none;
}

.read-more-button {
    background: none;
    border: 1px solid #000;
    padding: 5px 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
    text-transform: uppercase;
    transition: background-color 0.2s;
}

.read-more-button:hover {
    background: #f0f0f0;
}

/* Mobile placeholder styles */
.mobile-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 8px;
    text-align: center;
    padding: 40px 20px;
}

.show-anyway-btn {
    background: #000;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s;
}

.show-anyway-btn:hover {
    background: #333;
}



/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .about-section {
        padding: 15px;
        margin-bottom: 30px;
    }
    
    .about-section h3 {
        font-size: 16px;
    }
    
    .about-section p {
        font-size: 13px;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin-right: 0;
        margin-bottom: 15px;
        align-self: center;
    }
    
    .visualization-guide {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .force-graph-container {
        height: 400px;
    }
}
