/* Chart Captions - Styles for caption functionality */

.chart-caption-container {
    margin-top: 8px;
    padding: 0 8px;
}

/* Constrain caption width for square charts */
#ai-discovery-wrapper .chart-caption-container {
    max-width: 500px;
}

.chart-caption-summary {
    font-size: 13px;
    color: #a1a1aa;
    line-height: 1.5;
    margin: 0;
}

.chart-caption-toggle {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

.chart-caption-toggle:hover {
    color: #2563eb;
}

.chart-caption-toggle::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform 0.2s;
}

.chart-caption-toggle.expanded::after {
    transform: rotate(180deg);
}

.chart-caption-full {
    font-size: 13px;
    color: #d4d4d8;
    line-height: 1.6;
    margin: 8px 0 0 0;
    padding: 12px;
    background: #27272a;
    border-radius: 6px;
    display: none;
}

.chart-caption-full.visible {
    display: block;
}

/* Methodology page styles - Dark theme */
.methodology-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.methodology-header {
    text-align: center;
    margin-bottom: 40px;
}

.methodology-header h1 {
    font-size: 2rem;
    color: #e4e4e7;
    margin-bottom: 8px;
}

.methodology-header .subtitle {
    color: #a1a1aa;
    font-size: 1rem;
}

.methodology-section {
    margin-bottom: 32px;
}

.methodology-section h2 {
    font-size: 1.25rem;
    color: #e4e4e7;
    border-bottom: 2px solid #27272a;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.methodology-section h3 {
    font-size: 1rem;
    color: #d4d4d8;
    margin: 16px 0 8px 0;
}

.methodology-section p,
.methodology-section li {
    color: #a1a1aa;
    line-height: 1.7;
}

.methodology-section ul,
.methodology-section ol {
    padding-left: 24px;
}

.methodology-section li {
    margin-bottom: 8px;
}

.methodology-section code {
    background: #27272a;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #06b6d4;
}

.methodology-section strong {
    color: #e4e4e7;
}

.pipeline-diagram {
    background: #1a1a25;
    border-radius: 8px;
    padding: 20px;
    margin: 16px 0;
    font-family: monospace;
    font-size: 14px;
    overflow-x: auto;
    color: #e4e4e7;
}

.pipeline-layer {
    display: flex;
    align-items: center;
    margin: 12px 0;
}

.pipeline-layer .layer-num {
    background: #3b82f6;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.pipeline-layer .layer-content {
    flex: 1;
}

.pipeline-layer .layer-arrow {
    color: #a1a1aa;
    margin: 0 8px;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.verified-badge::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2322c55e'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E") no-repeat center;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.stats-table th,
.stats-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #27272a;
}

.stats-table th {
    background: #1a1a25;
    font-weight: 600;
    color: #e4e4e7;
}

.stats-table td {
    color: #a1a1aa;
}

.stats-table tr:hover td {
    background: #1a1a25;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #3b82f6;
    text-decoration: none;
    margin-bottom: 20px;
}

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

.back-link::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%233b82f6'%3E%3Cpath d='M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z'/%3E%3C/svg%3E") no-repeat center;
}

/* ========================================
   Export Buttons - inline with Methodology
   ======================================== */

.chart-export-buttons {
    display: inline-flex;
    gap: 8px;
    margin-left: 16px;
    vertical-align: middle;
}

.chart-export-btn {
    background: none;
    border: 1px solid #3f3f46;
    color: #a1a1aa;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.chart-export-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.chart-export-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chart-export-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.chart-export-btn svg.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
