/* 
 * SP500 Financial Dashboard CSS
 * Optimized for LCP/FCP and mobile devices
 */

/* ============================================
   CRITICAL CSS (Above the fold)
   ============================================ */

/* Base Variables */
:root {
    --primary-blue: #3b82f6;
    --primary-green: #10b981;
    --primary-purple: #8b5cf6;
    --primary-orange: #f59e0b;
    --primary-red: #ef4444;
    --primary-teal: #0d9488;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Critical layout styles */
.financial-dashboard-intro,
.financial-performance-container,
.financial-insights-dashboard,
.financial-leaders-dashboard.mobile-optimized,
.financial-visualizations {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--gray-800);
    line-height: 1.6;
    margin: 0 auto;
    max-width: 1400px;
}

/* Prevent layout shifts */
img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    max-width: 100%;
}

/* Content visibility optimizations */
.content-visibility-auto {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* ============================================
   FINANCIAL PERFORMANCE TABLE
   ============================================ */

.financial-performance-container {
    margin: 20px 0;
}

.fp-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 15px;
    background-color: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--primary-green);
}

.fp-control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fp-label {
    font-weight: 600;
    color: var(--primary-green);
    white-space: nowrap;
}

.fp-select {
    padding: 8px 12px;
    border: 2px solid var(--primary-green);
    border-radius: var(--radius-sm);
    background-color: white;
    color: var(--gray-800);
    min-width: 200px;
    font-size: 14px;
}

.fp-table-container {
    margin-top: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.fp-main-table-wrapper {
    max-height: 600px;
    overflow: auto;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
}

.fp-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
    font-size: 14px;
    min-width: 2000px;
}

.fp-table th {
    background-color: var(--primary-green);
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid #1e7e34;
    position: sticky;
    top: 0;
    z-index: 10;
}

.fp-table th.sl-no-column {
    position: sticky;
    left: 0;
    z-index: 20;
}

.fp-table td {
    padding: 8px;
    border-bottom: 1px solid var(--gray-300);
    border-right: 1px solid var(--gray-200);
    text-align: center;
}

.fp-table td.sl-no-column {
    position: sticky;
    left: 0;
    background-color: var(--primary-green);
    color: white;
    font-weight: 600;
    z-index: 5;
}

.fp-table tr:nth-child(even) {
    background-color: var(--gray-50);
}

.fp-table tr:nth-child(even) td.sl-no-column {
    background-color: var(--primary-green);
}

.fp-table tr:hover {
    background-color: var(--gray-100);
}

.fp-table tr:hover td.sl-no-column {
    background-color: #218838;
}

.fp-filter-table {
    background-color: #e8f5e8 !important;
    border: 2px solid var(--primary-green);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.hidden {
    display: none;
}

.positive {
    color: var(--primary-green);
    font-weight: 600;
}

.negative {
    color: var(--primary-red);
    font-weight: 600;
}

.sl-no-column {
    background-color: var(--primary-green);
    color: white;
    font-weight: 600;
    min-width: 60px;
}

.fp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.fp-pagination button {
    padding: 8px 15px;
    border: 1px solid var(--primary-green);
    background-color: white;
    color: var(--primary-green);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.fp-pagination button:hover:not(:disabled) {
    background-color: var(--primary-green);
    color: white;
}

.fp-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fp-pagination-info {
    color: var(--primary-green);
    font-weight: 600;
    margin: 0 10px;
}

/* ============================================
   DASHBOARD INTRO
   ============================================ */

/* Hero Section */
.intro-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.intro-hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.hero-icon {
    font-size: 3rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin: 0 0 2rem 0;
    font-weight: 300;
}

.hero-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Methodology Section */
.methodology-section {
    margin-bottom: 4rem;
}

.methodology-section h2 {
    font-size: 2rem;
    margin: 0 0 2rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    font-size: 2rem;
}

.methodology-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.methodology-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.methodology-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.methodology-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.methodology-card h3 {
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
    color: var(--gray-900);
}

.methodology-content {
    color: var(--gray-700);
}

.methodology-content ul,
.methodology-content ol {
    margin: 0.5rem 0 1rem 1.5rem;
}

.methodology-content li {
    margin-bottom: 0.25rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

/* Data Sources */
.data-sources {
    margin-top: 3rem;
}

.data-sources h3 {
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sources-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.source-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.source-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.source-logo {
    width: 60px;
    height: 60px;
    background: var(--gray-900);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sec-source .source-logo {
    background: linear-gradient(135deg, #1a237e 0%, #283593 100%);
}

.alpha-source .source-logo {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.source-header h4 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--gray-900);
}

.source-content {
    padding: 1.5rem;
}

.source-content p {
    margin: 0 0 1rem 0;
    color: var(--gray-700);
}

.source-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    margin-top: 1rem;
}

.source-link:hover {
    text-decoration: underline;
}

/* FAQ Section */
.faq-section {
    margin-bottom: 4rem;
}

.faq-section h2 {
    font-size: 2rem;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.faq-intro {
    color: var(--gray-600);
    margin: 0 0 2rem 0;
    font-size: 1.125rem;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.faq-question {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: white;
    border: none;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.faq-question:hover {
    background: var(--gray-50);
}

.faq-question[aria-expanded="true"] {
    background: var(--gray-50);
}

.faq-question[aria-expanded="true"] .faq-toggle {
    transform: rotate(45deg);
}

.faq-number {
    background: var(--primary-blue);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    margin-right: 1rem;
    flex-shrink: 0;
}

.faq-text {
    flex: 1;
    text-align: left;
}

.faq-toggle {
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
    color: var(--gray-500);
    margin-left: 1rem;
}

.faq-answer {
    padding: 1.5rem;
    background: white;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.faq-answer p {
    margin: 0 0 1rem 0;
}

.faq-answer ul,
.faq-answer ol {
    margin: 0.5rem 0 1rem 1.5rem;
}

.faq-answer li {
    margin-bottom: 0.5rem;
}

/* Support CTA */
.support-cta {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #1d4ed8 100%);
    color: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.support-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.support-icon {
    font-size: 3rem;
}

.support-text h3 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
}

.support-text p {
    opacity: 0.9;
    margin: 0 0 1.5rem 0;
}

.support-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.support-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid white;
    background: transparent;
    color: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.support-btn:hover {
    background: white;
    color: var(--primary-blue);
}

/* ============================================
   INSIGHTS DASHBOARD
   ============================================ */

.financial-insights-dashboard {
    margin: 40px 0;
}

.insights-section {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
}

.insights-section h2 {
    color: var(--gray-800);
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.insights-section h2 .icon {
    font-size: 1.4rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: var(--gray-50);
    padding: 20px;
    border-radius: var(--radius-md);
    border-left: 4px solid;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    background: var(--gray-100);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gray-800);
}

/* Commentary */
.commentary-content {
    line-height: 1.7;
    color: var(--gray-700);
    font-size: 1.05rem;
}

.commentary-content h3 {
    color: var(--gray-800);
    margin-top: 25px;
    margin-bottom: 15px;
}

.commentary-content ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.commentary-content li {
    margin-bottom: 8px;
}

.commentary-content strong {
    color: var(--gray-800);
}

/* Trends Grid */
.trends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.trend-card {
    background: var(--gray-50);
    padding: 25px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.trend-card h3 {
    color: var(--gray-800);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.performer-list {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.performer-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.performer-list li:last-child {
    border-bottom: none;
}

/* ============================================
   LEADERS DASHBOARD
   ============================================ */

/* Hero Section */
.dashboard-hero {
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.dashboard-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0 0 1.5rem 0;
}

.quick-stats {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stat-pill {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    backdrop-filter: blur(10px);
}

.stat-icon {
    font-size: 1rem;
}

/* Featured Leaders */
.featured-leaders {
    margin-bottom: 2rem;
}

.featured-leaders h2,
.comparison-tools h2,
.market-insights h2 {
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.featured-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.featured-rank {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--gray-100);
    color: var(--gray-700);
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.featured-ticker {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.featured-growth {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.featured-growth.positive {
    color: var(--primary-green);
}

.featured-growth.negative {
    color: var(--primary-red);
}

.trend-icon {
    font-size: 1.25rem;
}

.featured-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-700);
}

/* Leaderboard Tabs */
.leaderboard-tabs {
    display: flex;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    text-align: center;
}

.tab-btn.active {
    background: white;
    box-shadow: var(--shadow-sm);
}

/* Leaderboard Tables */
.leaderboard-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.leaderboard-section h3 {
    font-size: 1rem;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.leaderboard-table {
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.table-header {
    display: grid;
    grid-template-columns: 60px 1fr 100px 80px;
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

.table-row {
    display: grid;
    grid-template-columns: 60px 1fr 100px 80px;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.table-row:last-child {
    border-bottom: none;
}

.header-cell, .row-cell {
    display: flex;
    align-items: center;
}

.rank-badge {
    width: 1.75rem;
    height: 1.75rem;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Comparison Tools */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.comparison-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.comparison-card h3 {
    font-size: 1rem;
    margin: 0 0 1rem 0;
}

.comparison-item {
    text-align: center;
    margin-bottom: 1rem;
}

.comparison-top,
.comparison-bottom {
    margin: 0.5rem 0;
}

.comp-ticker {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.comparison-vs {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin: 0.5rem 0;
}

/* ============================================
   VISUALIZATIONS
   ============================================ */

/* Hero Section */
.viz-hero {
    margin-bottom: 3rem;
    text-align: center;
}

.viz-hero h2 {
    font-size: 1.75rem;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.viz-subtitle {
    color: var(--gray-700);
    margin: 0 0 2rem 0;
    font-size: 1.125rem;
}

.hero-chart-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: white;
}

.hero-chart-container svg {
    width: 100%;
    height: auto;
    display: block;
    background: white;
}

.chart-overlay {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-chart-container:hover .chart-overlay {
    opacity: 1;
}

.chart-action {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.chart-action:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Gallery Section */
.viz-gallery {
    margin-bottom: 3rem;
}

.gallery-header {
    margin-bottom: 2rem;
}

.gallery-header h3 {
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Chart Cards */
.chart-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.chart-header {
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.chart-badge {
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.chart-container {
    position: relative;
    height: 300px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.chart-container svg {
    width: 100%;
    height: 100%;
    max-height: 280px;
}

.chart-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-btn {
    padding: 0.375rem 0.75rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.chart-btn:hover {
    background: var(--gray-200);
}

.chart-stats,
.correlation-stats {
    font-size: 0.875rem;
    color: var(--gray-700);
}

.stat {
    margin-right: 1rem;
}

/* Insights Section */
.viz-insights h3 {
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.insights-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.insight-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.insight-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.insight-card h4 {
    font-size: 1.125rem;
    margin: 0 0 0.5rem 0;
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Performance Table */
    .fp-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .fp-control-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .fp-select {
        width: 100%;
        min-width: unset;
    }
    
    .fp-table {
        font-size: 12px;
    }
    
    .fp-table th,
    .fp-table td {
        padding: 6px 4px;
    }
    
    .fp-main-table-wrapper {
        max-height: 500px;
    }
    
    .fp-pagination {
        flex-direction: column;
        gap: 8px;
    }
    
    .sl-no-column {
        min-width: 50px;
    }
    
    /* Dashboard Intro */
    .intro-hero {
        padding: 2rem 1.5rem;
    }
    
    .intro-hero h2 {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .hero-icon {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .stat-item {
        min-width: 80px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .methodology-section h2,
    .faq-section h2 {
        font-size: 1.75rem;
    }
    
    .faq-question {
        padding: 1rem 1.25rem;
        font-size: 1rem;
    }
    
    .support-actions {
        flex-direction: column;
    }
    
    .support-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Insights */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .trends-grid {
        grid-template-columns: 1fr;
    }
    
    /* Leaders Dashboard */
    .dashboard-title {
        font-size: 1.5rem;
    }
    
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 50px 1fr 80px 70px;
        padding: 0.625rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-btn {
        padding: 0.625rem 0.375rem;
        font-size: 0.8125rem;
    }
    
    /* Visualizations */
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .insights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    /* Performance Table */
    .financial-performance-container {
        margin: 10px 0;
    }
    
    .fp-controls {
        padding: 10px;
    }
    
    .fp-table {
        font-size: 11px;
    }
    
    .fp-table th,
    .fp-table td {
        padding: 4px 2px;
    }
    
    /* Dashboard Intro */
    .intro-hero h2 {
        font-size: 1.75rem;
    }
    
    .hero-stats {
        gap: 1rem;
    }
    
    .stat-item {
        min-width: 70px;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .methodology-grid,
    .sources-grid {
        grid-template-columns: 1fr;
    }
    
    .support-cta {
        padding: 1.5rem;
    }
    
    /* Leaders Dashboard */
    .dashboard-hero {
        padding: 1.5rem 1rem;
    }
    
    .dashboard-title {
        font-size: 1.375rem;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-pill {
        width: 100%;
        justify-content: center;
    }
    
    /* Visualizations */
    .viz-hero h2 {
        font-size: 1.25rem;
    }
    
    .viz-subtitle {
        font-size: 1rem;
    }
    
    .insights-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet Breakpoints */
@media (min-width: 769px) and (max-width: 1024px) {
    .methodology-grid,
    .sources-grid,
    .gallery-grid,
    .leaderboard-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .insights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop Breakpoints */
@media (min-width: 1025px) {
    .methodology-grid,
    .sources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .leaderboard-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .insights-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   ACCESSIBILITY & PERFORMANCE OPTIMIZATIONS
   ============================================ */

/* Touch-friendly sizes */
.tab-btn,
.featured-card,
.fp-pagination button,
.chart-btn,
.filter-btn,
.support-btn {
    min-height: 44px;
}

.table-row {
    min-height: 52px;
}

/* Focus styles for accessibility */
.faq-question:focus,
.support-btn:focus,
.tab-btn:focus,
.chart-action:focus,
.filter-btn:focus,
.fp-pagination button:focus,
.chart-btn:focus {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .methodology-card,
    .faq-question,
    .support-btn,
    .tab-btn,
    .featured-card,
    .chart-action,
    .chart-btn,
    .filter-btn,
    .stat-card,
    .chart-card {
        transition: none;
    }
    
    .faq-toggle {
        transition: none;
    }
}

/* Print styles */
@media print {
    .fp-controls,
    .chart-action,
    .chart-btn,
    .filter-btn,
    .tab-btn,
    .support-actions {
        display: none !important;
    }
    
    .fp-main-table-wrapper {
        max-height: none !important;
        overflow: visible !important;
    }
    
    .fp-table th.sl-no-column,
    .fp-table td.sl-no-column {
        position: static !important;
    }
}

/* Content-visibility optimization for off-screen content */
.leaderboard-container,
.gallery-grid,
.trends-grid,
.insights-grid,
.faq-container {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* Lazy loading for images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}