/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background-color: #ffffff;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    width: auto;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #475569;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #1e3a8a;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #1e3a8a, #d97706);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-text {
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Main Content */
.main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.dashboard-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.dashboard-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

/* View Navigation Styles */
.view-navigation {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.view-tab {
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid transparent;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.view-tab:hover {
    background: #e2e8f0;
    color: #475569;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.view-tab.active {
    background: #2563eb;
    color: white;
    border-color: #1d4ed8;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

/* Portfolio Snapshot Report Styles */
.portfolio-snapshot-report {
    display: none;
    margin: 0;
    padding: 0;
    background: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.snapshot-report-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}


/* Individual Pages */
.snapshot-page {
    min-height: 11in;
    padding: 2rem;
    page-break-after: always;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.snapshot-page:last-child {
    border-bottom: none;
}

/* Page Headers */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
}

/* Pages without headers still need spacing */
.snapshot-page:not(:first-child) .page-content:first-child {
    margin-top: 1rem;
}

.report-title {
    color: #1e293b;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    padding: 1rem 2rem;
    color: white;
    border-radius: 8px;
}

.client-name {
    color: #64748b;
    font-size: 1.2rem;
    font-weight: 500;
    margin: 1rem 0 0 0;
}

/* Page Content */
.page-content {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
}

/* Fix for Page 5 performance table container */
#snapshot-page-5 .page-content {
    display: block;
}

/* Fix for Pages 3-4 style box layout */
#snapshot-page-3 .page-content,
#snapshot-page-4 .page-content {
    display: block;
}

.performance-table-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.page-content h3 {
    color: #1e293b;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
    background: #f8fafc;
    padding: 0.75rem;
    border-left: 4px solid #2563eb;
}

/* Layout Sections */
.allocation-section, .allocation-detail-section {
    margin-bottom: 3rem;
}

.dual-chart-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.chart-section {
    text-align: center;
}

.chart-section h3 {
    margin-bottom: 1rem;
    background: none;
    padding: 0.5rem;
    border-left: 3px solid #10b981;
}

/* Snapshot Tables */
.snapshot-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.snapshot-detail-table thead {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
}

.snapshot-detail-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.snapshot-detail-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

.snapshot-detail-table tbody tr:hover {
    background: #f8fafc;
}

.snapshot-detail-table tbody tr:last-child {
    border-bottom: none;
}

.snapshot-detail-table td {
    padding: 1rem;
    font-size: 0.9rem;
    vertical-align: middle;
}

.snapshot-detail-table .strategy-name {
    font-weight: 500;
    color: #1e293b;
    max-width: 300px;
}

.snapshot-detail-table .size-factor {
    color: #059669;
    font-weight: 500;
    text-align: center;
}

.snapshot-detail-table .style-factor {
    color: #dc2626;
    font-weight: 500;
    text-align: center;
}

.snapshot-detail-table .market-value {
    color: #1e293b;
    font-weight: 600;
    text-align: right;
    font-family: 'Courier New', monospace;
}

/* Chart containers */
.allocation-chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
}

#snapshot-allocation-chart {
    max-width: 500px;
    max-height: 400px;
}

/* Page 2 Chart Styles */
#asset-allocation-chart {
    max-width: 350px;
    max-height: 350px;
}

#sector-allocation-chart {
    max-width: 350px;
    max-height: 450px;
}

#snapshot-allocation-chart {
    max-width: 350px;
    max-height: 450px;
}

.chart-section .chart-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Sector detail table specific styling */
.sector-name {
    font-weight: 500;
    color: #1e293b;
}

.sector-percentage {
    color: #059669;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.sector-value {
    color: #1e293b;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Container elements - clean styling for content */
.chart-placeholder, .table-placeholder {
    display: block;
    width: 100%;
}

.style-box-placeholder {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Page Footers */
.page-footer {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Print Styles */
@media print {
    .portfolio-snapshot-report {
        box-shadow: none;
        border: none;
    }
    
    .snapshot-page {
        page-break-after: always;
        margin: 0;
        box-shadow: none;
    }
    
    .page-footer {
        position: fixed;
        bottom: 1cm;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .snapshot-report-container {
        max-width: 100%;
        margin: 0;
    }
    
    .snapshot-page {
        padding: 1rem;
        min-height: auto;
    }
    
    .dual-chart-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.dashboard-subtitle {
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 400;
}

/* Portfolio Overview Section */
.portfolio-overview {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 3rem auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2.5rem;
}

.allocation-chart {
    height: fit-content;
    position: relative;
    overflow: hidden;
}

.allocation-chart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.02) 0%, rgba(217, 119, 6, 0.02) 100%);
    border-radius: 16px;
    pointer-events: none;
    z-index: 1;
}

.allocation-chart .chart-wrapper {
    height: 400px;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.allocation-chart:hover .chart-wrapper {
    transform: scale(1.02);
}

.allocation-chart .chart-header {
    position: relative;
    z-index: 2;
}

/* Summary Cards in Right Column */
.portfolio-overview .summary-cards {
    display: flex;
    flex-direction: row;
    gap: 2.5rem;
    justify-content: center;
    margin-bottom: 2.5rem;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.portfolio-overview .summary-cards .card {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    padding: 1.5rem;
    flex: 1 1 0;
    min-width: 220px;
    max-width: 400px;
}

.portfolio-overview .summary-cards .card .card-value {
    font-size: 1.8rem;
    margin-bottom: 0.3rem;
}

.portfolio-overview .summary-cards .card .card-title {
    font-size: 0.9rem;
}

.portfolio-overview .summary-cards .card .card-change {
    font-size: 0.8rem;
}

/* Performance Section */
.performance-section {
    margin-bottom: 4rem;
}

.performance-section .chart-container {
    max-width: 100%;
}

/* Charts Section - Remove old styles */
.charts-section {
    display: none;
}

.chart-container {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1), 
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(30, 58, 138, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
    position: relative;
    transition: all 0.3s ease;
}

.chart-container:hover {
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1), 
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(30, 58, 138, 0.1);
    transform: translateY(-2px);
}

.chart-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.01) 0%, rgba(217, 119, 6, 0.01) 100%);
    border-radius: 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chart-container:hover::after {
    opacity: 1;
}

.chart-header {
    margin-bottom: 2rem;
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.chart-subtitle {
    color: #64748b;
    font-size: 0.9rem;
}

.chart-wrapper {
    height: 300px;
    position: relative;
}

/* Storyboard Section */
.storyboard-section {
    margin-bottom: 4rem;
}

.storyboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: #64748b;
    font-size: 1rem;
}

.storyboard-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.story-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    border-left: 4px solid transparent;
    background-image: linear-gradient(white, white), linear-gradient(135deg, #1e3a8a, #d97706);
    background-origin: border-box;
    background-clip: content-box, border-box;
    transition: transform 0.3s ease;
}

.story-card:hover {
    transform: translateY(-2px);
}

.story-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.story-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.story-date {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
}

.story-content p {
    color: #475569;
    line-height: 1.6;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #475569;
}

.card-icon {
    font-size: 1.5rem;
}

.card-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.card-change {
    font-size: 0.9rem;
    font-weight: 500;
}

.risk-toggle-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.risk-toggle-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.risk-method {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.card-change.positive {
    color: #166534;
}

.card-change.negative {
    color: #991b1b;
}

.card-change.neutral {
    color: #374151;
}

/* Footer */
.footer {
    background: white;
    color: #000000;
    padding: 2rem 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 2rem;
}

.footer .container {
    text-align: center;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 400;
}

/* Year Commentary Section */
.year-commentary-section {
    margin-bottom: 4rem;
}

.year-tabs {
    margin-bottom: 2rem;
}

.tab-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.year-tab {
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 60px;
}

.year-tab:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.year-tab.active {
    background: #1e3a8a;
    border-color: #1e40af;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.3);
}

.commentary-area {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.commentary-area:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.commentary-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

.commentary-title span {
    color: #1e3a8a;
}

.commentary-text {
    color: #475569;
    line-height: 1.7;
}

.commentary-text p {
    margin-bottom: 1rem;
}

.commentary-text p:last-child {
    margin-bottom: 0;
}

/* Quarterly Commentary Tabs */
.quarterly-tabs {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.quarterly-tab-container {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.quarterly-tab-container::-webkit-scrollbar {
    display: none;
}

.quarterly-tab {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    position: relative;
}

.quarterly-tab:hover {
    background: #f8fafc;
    color: #1e3a8a;
    border-bottom-color: #bfdbfe;
}

.quarterly-tab.active {
    color: #1e3a8a;
    background: #f1f5f9;
    border-bottom-color: #1e3a8a;
    font-weight: 600;
}

.quarterly-tab:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.1);
}

.quarterly-tab:first-child {
    border-top-left-radius: 8px;
}

.quarterly-tab:last-child {
    border-top-right-radius: 8px;
}

/* Blog Thumbnails Section */
.blog-thumbnails-section {
    margin: 3rem 0 2rem 0;
}

.blog-thumbnails {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.blog-thumbnail {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 12px 0 rgba(30, 41, 59, 0.07);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    width: 320px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e2e8f0;
}

.blog-thumbnail:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 24px 0 rgba(30, 41, 59, 0.13);
    border-color: #a5b4fc;
}

.blog-thumb-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f1f5f9;
}

.blog-thumb-content {
    padding: 1.25rem 1.25rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-thumb-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.7rem;
    color: #1e293b;
}

.blog-thumb-desc {
    font-size: 0.98rem;
    color: #475569;
    line-height: 1.6;
}

.blog-thumbnails-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 0.01em;
}

@media (max-width: 900px) {
    .blog-thumbnails {
        gap: 1rem;
    }
    .blog-thumbnail {
        width: 100%;
        max-width: 400px;
    }

    .summary-cards {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
        max-width: 100%;
    }
    .portfolio-overview {
        gap: 1.5rem;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-list {
        gap: 1rem;
    }

    .dashboard-title {
        font-size: 2rem;
    }

    .portfolio-overview {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .allocation-chart .chart-wrapper {
        height: 300px;
    }

    .tab-container {
        gap: 0.3rem;
        padding: 0.75rem;
    }

    .year-tab {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        min-width: 50px;
    }

    .commentary-area {
        padding: 1.5rem;
    }

    .commentary-title {
        font-size: 1.2rem;
    }
    
    .quarterly-tab-container {
        gap: 0;
        justify-content: flex-start;
    }
    
    .quarterly-tab {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
        min-width: auto;
        flex: none;
    }

    .storyboard-content {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .card {
        padding: 1.5rem;
    }

    .chart-container {
        padding: 1.5rem;
    }

    .story-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .main {
        padding: 1rem 0;
    }

    .card,
    .chart-container,
    .story-card {
        padding: 1.5rem;
    }

    .chart-wrapper {
        height: 250px;
    }

    .allocation-chart .chart-wrapper {
        height: 250px;
    }
    
    .right-chart {
        height: 250px;
    }
    
    .right-chart #drilldown-bar-container {
        height: 110px;
    }
    
    .right-chart #cagr-bar-container {
        height: 110px;
    }
    
    .right-chart #drilldown-bar-container canvas,
    .right-chart #cagr-bar-container canvas {
        height: 110px !important;
    }

    .card-value {
        font-size: 1.75rem;
    }
}

/* Loading Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.chart-container,
.story-card {
    animation: fadeIn 0.6s ease-out;
}

/* Gradient Accents */
.gradient-text {
    background: linear-gradient(135deg, #1e3a8a, #d97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#drilldown-bar-container {
    transition: opacity 0.3s;
    opacity: 1;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
#drilldown-bar-container.hidden {
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

.drilldown-bar-placeholder {
    display: block;
    width: 100%;
    height: 260px;
    margin-bottom: 0.5rem;
}
.drilldown-bar-instruction {
    color: #64748b;
    font-size: 1.08rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-align: center;
    opacity: 0.85;
}

.allocation-charts-row {
    display: flex;
    flex-direction: row;
    gap: 2.5rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    align-items: flex-start;
}
.left-chart {
    flex: 1 1 0;
    min-width: 340px;
    max-width: 480px;
}
.right-chart {
    flex: 2 1 0;
    min-width: 340px;
    max-width: 700px;
}
@media (max-width: 1000px) {
    .allocation-charts-row {
        flex-direction: column;
        gap: 1.5rem;
    }
    .left-chart, .right-chart {
        max-width: 100%;
        min-width: 0;
    }
}

#cagr-bar-container {
    transition: opacity 0.3s;
    opacity: 1;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
#cagr-bar-container.hidden {
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

#drilldown-bar-container.inactive, #cagr-bar-container.inactive {
    opacity: 0.5;
    filter: grayscale(0.7);
    pointer-events: none;
    position: relative;
}
.bar-instruction {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #64748b;
    font-size: 1.08rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-align: center;
    background: rgba(255,255,255,0.85);
    padding: 1.2rem 2rem;
    border-radius: 10px;
    z-index: 2;
    pointer-events: none;
}

/* Recommended Reading Section */
.recommended-reading {
    margin: 3rem 0 2rem 0;
    padding: 2rem 0;
    border-top: 1px solid #e2e8f0;
    min-height: 600px; /* Reserve space to prevent layout jumping */
}

.recommended-reading .section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e3a8a;
    text-align: center;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.recommended-reading .section-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    color: #64748b;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-left: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Recommended Articles Grid */
.recommended-articles {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 400px; /* Reserve space for 3 article cards */
    align-content: flex-start; /* Align cards to top when loading */
    opacity: 1;
    transition: opacity 0.2s ease-in-out; /* Smooth fade transitions */
}

.recommended-article {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 12px 0 rgba(30, 41, 59, 0.07);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    width: 320px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e2e8f0;
    position: relative;
}

.recommended-article:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 24px 0 rgba(30, 41, 59, 0.13);
    border-color: #a5b4fc;
}

.recommended-article-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f1f5f9;
}

.recommended-article-content {
    padding: 1.25rem 1.25rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.recommended-article-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.7rem;
    color: #1e293b;
    line-height: 1.4;
}

.recommended-article-excerpt {
    font-size: 0.98rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.recommended-article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #64748b;
    border-top: 1px solid #f1f5f9;
    padding-top: 0.75rem;
}

.article-source {
    background: #eff6ff;
    color: #1e40af;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.recommendation-reason {
    font-style: italic;
    font-size: 0.8rem;
}

/* Error State */
.articles-error {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.articles-error p {
    font-size: 1rem;
    margin: 0;
}

/* Historical Performance Table (Page 5) */
.table-scroll-container {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    max-width: 100%;
    
    /* Smooth scrolling */
    scroll-behavior: smooth;
    
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.table-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Table Navigation Controls */
.table-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
}

.table-nav-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.table-nav-btn:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.table-nav-btn:active:not(:disabled) {
    transform: translateY(0);
}

.table-nav-btn:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.table-nav-info {
    color: #64748b;
    font-weight: 500;
    font-size: 0.8rem;
}

.historical-performance-table {
    width: auto;
    min-width: max-content;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    background: white;
}

.historical-performance-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    text-align: left;
    border: 1px solid #cbd5e1;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Sticky Strategy Column */
.historical-performance-table .sticky-column {
    position: sticky;
    left: 0;
    background: white;
    z-index: 2;
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.1);
}

.historical-performance-table th.sticky-column {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    z-index: 3;
}

.historical-performance-table .strategy-column {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    text-align: left;
}

.historical-performance-table .year-column {
    width: 75px;
    min-width: 75px;
    text-align: center;
}

.historical-performance-table td {
    padding: 0.6rem 0.5rem;
    border: 1px solid #e2e8f0;
    text-align: center;
    white-space: nowrap;
}

.historical-performance-table .strategy-name {
    text-align: left;
    font-weight: 500;
    color: #374151;
    font-size: 0.8rem;
}

.historical-performance-table .return-value {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    font-weight: 500;
    font-size: 0.8rem;
}

.historical-performance-table .positive-return {
    color: #059669;
    background-color: rgba(5, 150, 105, 0.05);
}

.historical-performance-table .negative-return {
    color: #dc2626;
    background-color: rgba(220, 38, 38, 0.05);
}

.historical-performance-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.historical-performance-table tbody tr:hover {
    background-color: #f1f5f9;
}

.performance-disclaimer {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 0 4px 4px 0;
}

.performance-disclaimer p {
    margin: 0;
    font-size: 0.85rem;
    color: #92400e;
    line-height: 1.5;
}

/* Responsive adjustments for historical table */
@media (max-width: 768px) {
    .historical-performance-table {
        font-size: 0.75rem;
    }
    
    .historical-performance-table .strategy-column {
        width: 140px;
        min-width: 120px;
    }
    
    .historical-performance-table .year-column {
        width: 45px;
    }
    
    .historical-performance-table th,
    .historical-performance-table td {
        padding: 0.5rem 0.3rem;
    }
}

/* Style Box Analysis (Pages 3-4) */
.style-boxes-container {
    display: block;
    width: 100%;
}

.style-box-placeholder {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.strategy-style-box {
    margin-bottom: 3rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
}

.strategy-title {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.style-box-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    padding: 1.5rem;
    align-items: start;
}

/* 9-Box Style Grid */
.style-box-grid-container h5,
.performance-table-container h5 {
    color: #374151;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    text-align: center;
}

.style-box-grid {
    display: grid;
    grid-template-columns: 80px 1fr 1fr 1fr;
    gap: 1px;
    background: #e2e8f0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.style-box-header {
    display: contents;
}

.empty-cell {
    background: #f8fafc;
}

.size-header,
.style-header {
    background: #f1f5f9;
    padding: 0.6rem 0.4rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
}

.style-header {
    text-align: center;
    justify-content: center;
    writing-mode: horizontal-tb;
}

.style-box-row {
    display: contents;
}

.style-cell {
    background: white;
    padding: 0.8rem 0.4rem;
    text-align: center;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    font-weight: 500;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Performance Summary Table */
.performance-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.performance-summary-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #1e293b;
    font-weight: 600;
    padding: 0.7rem;
    text-align: left;
    border: 1px solid #cbd5e1;
}

.performance-summary-table td {
    padding: 0.7rem;
    border: 1px solid #e2e8f0;
}


/* Backtested period styling for horizontal tables */
.backtested-period {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
}

/* Compliance disclaimer styling */
.compliance-disclaimer {
    color: #6b7280;
    font-size: 0.75rem;
    font-style: italic;
    margin: 0.75rem 0;
    text-align: center;
    padding: 0.5rem;
    background: rgba(107, 114, 128, 0.05);
    border-left: 3px solid #d1d5db;
    border-radius: 0 4px 4px 0;
    line-height: 1.4;
}


/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .style-box-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .style-box-grid {
        grid-template-columns: 60px 1fr 1fr 1fr;
    }
    
    .size-header,
    .style-header {
        font-size: 0.7rem;
        padding: 0.5rem 0.3rem;
    }
    
    .style-cell {
        padding: 0.6rem 0.3rem;
        font-size: 0.8rem;
    }
}
