/* Performance Section Styles */
.performance {
    background-color: #0a0a0a;
    color: #fff;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.performance::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(65, 150, 191, 0.3), transparent);
}

.performance h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.performance h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #4196bf, transparent);
}

.performance-subtitle {
    text-align: center;
    color: #a0a0a0;
    font-size: 1.1rem;
    margin-bottom: 3rem;
    font-weight: 300;
}

.performance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 20px;
}

.performance-card {
    background: rgba(20, 20, 20, 0.8);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.performance-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header i {
    font-size: 1.8rem;
    margin-right: 15px;
    color: #4196bf;
}

.card-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #fff;
}

.metric-row {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.year {
    width: 60px;
    color: #a0a0a0;
    font-weight: 500;
    font-size: 0.95rem;
}

.metric-bar {
    flex: 1;
    height: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.y-axis {
    display: none; /* Hide the entire y-axis container */
}

.metric-fill {
    height: 100%;
    border-radius: 15px;
    position: relative;
    transition: width 1s ease-in-out;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 15px;
    box-sizing: border-box;
    overflow: hidden;
}

.metric-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    z-index: 1;
}

/* Crypto card specific styles */
.crypto-card .metric-fill {
    background: rgba(65, 150, 191, 0.7);
}

/* Stock card specific styles */
.stock-card .metric-fill {
    background: rgba(65, 191, 150, 0.7);
}

/* Benchmark card specific styles */
.benchmark-card .metric-fill {
    background: rgba(150, 150, 150, 0.7);
    min-width: 100px;
    justify-content: flex-start;
    padding-left: 15px;
}

.metric-value {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    display: inline-block;
    padding: 0 10px;
    background: transparent;
    position: relative;
    z-index: 2;
}

.metric-avg {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    color: #a0a0a0;
}

.avg-value {
    color: #fff;
    font-weight: 600;
    font-size: 1.1rem;
}

.performance-note {
    text-align: center;
    margin-top: 40px;
    color: #666;
    font-size: 0.9rem;
}

.performance-note i {
    margin-right: 8px;
    color: #4196bf;
}

/* New Performance Section Styles */
.performance-simple-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 0 auto 40px;
    max-width: 1200px;
}

.performance-simple-card {
    background: rgba(20, 20, 20, 0.8);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.performance-simple-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.simple-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.simple-card-header i {
    font-size: 1.8rem;
    margin-right: 15px;
    color: #4196bf;
}

.simple-card-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
}

.simple-metrics {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.simple-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.simple-metric:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(5px);
}

.simple-metric.current {
    background: rgba(65, 150, 191, 0.1);
    border-left: 3px solid #4196bf;
}

.simple-metric .year {
    color: #a0a0a0;
    font-weight: 500;
    font-size: 0.95rem;
}

.simple-metric .value {
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
}

.simple-metric .value.positive {
    color: #4caf50;
}

.simple-metric .value.negative {
    color: #f44336;
}

.simple-metric .note {
    position: absolute;
    right: 15px;
    bottom: -20px;
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
}



.cta-box {
    text-align: center;
    background: rgba(65, 150, 191, 0.1);
    padding: 30px;
    border-radius: 12px;
    margin-top: 40px;
    border: 1px dashed rgba(65, 150, 191, 0.3);
}

.cta-box h3 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.cta-box p {
    color: #a0a0a0;
    margin-bottom: 20px;
    font-size: 1rem;
}

.cta-box .btn {
    font-size: 1.1rem;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-box .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Performance Visualization Section */
.performance-viz {
    background: linear-gradient(135deg, #0a0e17 0%, #131a2b 100%);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

.performance-viz::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4196bf, transparent);
    opacity: 0.3;
}

.viz-header {
    text-align: center;
    margin-bottom: 60px;
}

.viz-header h2 {
    font-size: 2.8rem;
    color: #ffffff;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    background: linear-gradient(135deg, #ffffff, #4196bf);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.viz-header h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #4196bf, #00a8ff);
    border-radius: 2px;
}

.viz-header p {
    color: #b3b3b3;
    font-size: 1.2rem;
    margin-top: 20px;
    font-weight: 400;
}

/* Chart Wrapper */
.performance-chart-wrapper {
    background: rgba(15, 15, 20, 0.9);
    border-radius: 20px;
    padding: 40px;
    margin: 0 auto;
    max-width: 1000px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(65, 150, 191, 0.2);
    backdrop-filter: blur(15px);
    position: relative;
    overflow: visible; /* Prevent clipping of rightmost labels/glow on desktop */
    width: 100%;
    box-sizing: border-box;
}

.performance-chart-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(65, 150, 191, 0.05), transparent);
    border-radius: 20px;
    pointer-events: none;
}

/* Legend */
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.legend-item.crypto .legend-color {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);  /* Blue for crypto */
}

.legend-item.stocks .legend-color {
    background: linear-gradient(135deg, #06b6d4, #0891b2);  /* Cyan blue for stocks */
}

.legend-item.benchmark .legend-color {
    background: linear-gradient(135deg, #6b7280, #4b5563);  /* Grey for S&P 500 */
}

/* Chart Bars */
.chart-bars {
    display: flex;
    justify-content: space-evenly; /* Even spacing on ends and between */
    align-items: flex-end;
    height: 600px;
    position: relative;
    padding: 60px 40px 160px 40px; /* Reduced side padding for better distribution */
    margin: 40px auto; /* Center the entire chart */
    box-sizing: border-box;
    overflow: visible; /* Let labels and shadows extend beyond bars */
    max-width: 1200px; /* Added max-width for better control */
    width: 100%;
}

.year-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1; /* Allow equal distribution */
    height: 100%;
    position: relative;
    margin: 0; /* Spacing handled by space-evenly on parent */
    max-width: 350px; /* Prevent year groups from getting too wide */
}

.year-label {
    position: absolute;
    bottom: -120px; /* Position below the bars */
    left: 50%;
    transform: translateX(-50%); /* Center the label */
    font-size: 1.1rem;
    font-weight: 600;
    color: #9ca3af;
    text-align: center;
    white-space: nowrap;
    z-index: 10; /* Ensure labels stay on top */
    line-height: 1.3; /* Better line spacing for multi-line labels */
    width: 100%; /* Ensure full width for centering */
    padding: 0 5px; /* Minimal padding for better centering */
}

.year-date {
    font-size: 0.8rem;
    font-weight: 400;
    color: #6b7280;
    opacity: 0.8;
}

/* Allow wrapping for multi-line year labels */
.year-group.multi-line .year-label {
    white-space: normal;
    bottom: -125px; /* Adjust positioning for multi-line to align with single-line labels */
}

.bars-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    height: 100%;
    justify-content: center;
    position: relative;
    padding: 0;
    box-sizing: border-box;
    width: fit-content; /* Shrink-wrap around bars */
    margin: 0 auto;     /* Precisely center within year group */
}

/* Add a subtle baseline for zero reference */
.bars-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

/* Removed baseline */

.bar {
    width: 45px;
    height: 100%;
    position: relative;
    border-radius: 8px 8px 0 0;
    overflow: visible;  /* Ensure value labels are fully shown */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    margin: 0;          /* Use gap for spacing; avoid edge bias */
    transform: translateY(0);
}

.bar:hover {
    transform: translateY(-3px) scale(1.02);
    filter: brightness(1.15);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.bar-fill {
    width: 100%;
    position: absolute;
    bottom: 0;
    border-radius: 8px 8px 0 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    animation: growBar 1.5s ease-out;
}

@keyframes growBar {
    from { height: 0; }
    to { height: var(--final-height); }
}

/* Bar Colors */
.bar.crypto .bar-fill {
    background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);  /* Blue for crypto */
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.bar.stocks .bar-fill {
    background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%);  /* Cyan blue for stocks */
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
}

.bar.benchmark .bar-fill {
    background: linear-gradient(180deg, #6b7280 0%, #4b5563 100%);  /* Grey for S&P 500 */
    box-shadow: 0 4px 20px rgba(107, 114, 128, 0.4);
}

/* Negative bars */
.bar.negative .bar-fill {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    border-radius: 0 0 8px 8px;
    position: absolute;
    top: 100%;
    width: 100%;
    transform-origin: top;
}

/* Remove duplicate negative fill styling - handled above */

/* Bar Values */
.bar-value {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;  /* Slightly larger font */
    font-weight: 600;   /* Bolder text */
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    padding: 4px 8px;   /* More padding for better visibility */
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.95);  /* Darker background for better contrast */
    backdrop-filter: blur(8px);
    white-space: nowrap;
    z-index: 100;  /* Much higher z-index to ensure values stay on top */
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.6);
    min-width: 60px;    /* Ensure minimum width for better readability */
    text-align: center;
    pointer-events: none;  /* Ensure no interference with hover effects */
}

.bar:not(.negative) .bar-value {
    bottom: calc(100% + 12px);  /* Increased spacing above bars */
}

.bar.negative .bar-value {
    top: calc(100% + 12px);
    color: #ffffff;
    background: rgba(15, 15, 15, 0.9);
    z-index: 10;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Y-axis */
.y-axis {
    position: absolute;
    left: 20px;
    top: 180px;
    bottom: 130px;  /* Extended to accommodate negative values */
    width: 40px;
}

.y-label {
    display: none; /* Hide all y-axis labels */
}

.y-label.zero-line {
    color: #ffffff;
    font-weight: 700;
    background: rgba(65, 150, 191, 0.9);
    bottom: 0;
    transform: translateY(50%);
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.y-label.negative {
    color: #ef4444;
    font-weight: 600;
    bottom: 0;
    transform: translateY(calc(100% + 10px));
    z-index: 3;
}

/* Removed y-axis line */

/* Removed zero line marker */

/* Performance Disclaimer */
.performance-disclaimer {
    text-align: center;
    margin-top: 50px;
    padding: 0;
}

.performance-disclaimer p {
    display: inline-block;
    color: #9ca3af;
    font-size: 1rem;
    font-style: italic;
    padding: 15px 25px;
    border-radius: 10px;
    background: rgba(65, 150, 191, 0.08);
    border: 1px solid rgba(65, 150, 191, 0.15);
    margin: 0;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.performance-disclaimer p:hover {
    background: rgba(65, 150, 191, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.performance-disclaimer i {
    color: #4196bf;
    margin-right: 8px;
}

/* Performance chart mobile improvements */
@media (max-width: 1024px) {
    .performance-viz {
        padding: 80px 0;
    }
    
    .viz-header h2 {
        font-size: 2.4rem;
    }
    
    .viz-header p {
        font-size: 1.1rem;
        padding: 0 20px;
    }
    
    .performance-chart-wrapper {
        padding: 30px 20px;
        max-width: 900px;
        margin: 0 15px;
        overflow: visible;
    }
    
    .chart-legend {
        gap: 25px;
        margin-bottom: 35px;
    }
    
    .legend-item {
        font-size: 1rem;
        padding: 8px 16px;
    }
    
    .legend-color {
        width: 14px;
        height: 14px;
    }
    
    .chart-bars {
        padding: 60px 20px 150px 20px;
        height: 500px;
        overflow: visible;
        justify-content: space-between;
    }
    
    .bar {
        width: 35px;
        margin: 0; /* Use gap for spacing */
    }
    
    .bars-container {
        gap: 8px;
        width: fit-content;
        margin: 0 auto;
    }
    
    .bar-value {
        font-size: 0.7rem;
        padding: 3px 6px;
        min-width: 45px;
        background: rgba(0, 0, 0, 0.95);
        border-radius: 4px;
        font-weight: 600;
        z-index: 100;  /* Ensure high z-index on tablet */
        border: 1px solid rgba(255, 255, 255, 0.25);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
        pointer-events: none;
    }
    
    .year-label {
        font-size: 1rem;
        bottom: -110px;
        font-weight: 600;
    }
}

@media (max-width: 768px) {
    .performance-viz {
        padding: 60px 0;
    }
    
    .viz-header h2 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 15px;
    }
    
    .viz-header p {
        font-size: 1rem;
        padding: 0 15px;
        margin-bottom: 30px;
    }
    
    .performance-chart-wrapper {
        padding: 20px 15px;
        border-radius: 16px;
        margin: 0 10px;
        overflow: visible;
        max-width: calc(100vw - 20px);
        width: 100%;
        box-sizing: border-box;
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(65, 150, 191, 0.08);
    }
    
    .chart-legend {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 30px;
    }
    
    .legend-item {
        font-size: 0.85rem;
        padding: 8px 12px;
        justify-content: center;
        max-width: none;  /* Remove max-width restriction */
        width: auto;      /* Allow natural width expansion */
        margin: 0 auto;
        border-radius: 20px;
        white-space: nowrap;  /* Prevent text wrapping */
    }
    
    .legend-color {
        width: 12px;
        height: 12px;
    }
    
    .chart-bars {
        padding: 20px 10px 120px 10px;
        height: 400px;
        overflow: visible;
        width: 100%;
        box-sizing: border-box;
        position: relative;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
    }
    
    .year-group {
        min-width: 90px;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
    }
    
    .bars-container {
        gap: 14px;  /* Increased from 12px to 14px for even better horizontal spacing */
        width: fit-content;
        justify-content: center;
        display: flex;
        align-items: flex-end;
        margin: 0 auto;
    }
    
    .bar {
        width: 22px;
        margin: 0;
        min-width: 22px;
        flex: 0 0 22px;
    }
    
    .bar-value {
        font-size: 0.48rem;  /* Reduced for better fit */
        padding: 1px 2px;    /* Reduced padding for more compact labels */
        min-width: 22px;     /* Reduced width to prevent overlap */
        white-space: nowrap;
        transform: translateX(-50%);
        left: 50%;
        background: rgba(0, 0, 0, 0.96);
        border-radius: 4px;
        font-weight: 700;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.35);
        z-index: 100;  /* Ensure high z-index on mobile */
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
        pointer-events: none;
        bottom: calc(100% + 16px);  /* Increased from default 12px to 16px for more Y-axis spacing */
    }
    
    .year-label {
        font-size: 0.85rem;
        bottom: -100px;
        transform: translateX(-50%);
        left: 50%;
        width: 80px;
        text-align: center;
        line-height: 1.3;
        font-weight: 600;
    }
    
    .year-group.multi-line .year-label {
        bottom: -105px;
    }
    
    .year-date {
        font-size: 0.72rem;
    }
    
    .y-label {
        display: none;
    }
    
    .y-axis {
        display: none;
    }
    
    .performance-disclaimer p {
        font-size: 0.9rem;
        padding: 12px 15px;
    }
}

@media (max-width: 576px) {
    .performance-viz {
        padding: 50px 0;
    }
    
    .viz-header h2 {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 15px;
        padding: 0 15px;
    }
    
    .viz-header p {
        font-size: 1rem;
        padding: 0 20px;
        margin-bottom: 35px;
        line-height: 1.5;
    }
    
    .performance-chart-wrapper {
        padding: 20px 12px;
        margin: 0 8px;
        border-radius: 16px;
        overflow: visible;
        max-width: calc(100vw - 16px);
        width: 100%;
        box-sizing: border-box;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(65, 150, 191, 0.1);
    }
    
    .chart-legend {
        gap: 10px;
        margin-bottom: 35px;
        justify-content: center;
        flex-wrap: wrap;
        max-width: 350px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .legend-item {
        font-size: 0.8rem;
        padding: 10px 14px;
        max-width: none;  /* Remove max-width restriction */
        border-radius: 20px;
        font-weight: 500;
        letter-spacing: 0.3px;
        flex: 0 1 auto;
        min-width: 140px;
        justify-content: center;
        text-align: center;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        white-space: nowrap;  /* Prevent text wrapping */
        width: auto;  /* Allow natural width expansion */
    }
    
    .legend-color {
        width: 12px;
        height: 12px;
        margin-right: 8px;
    }
    
    .chart-bars {
        padding: 25px 10px 140px 10px;
        height: 380px;
        overflow: visible;
        width: 100%;
        box-sizing: border-box;
        position: relative;
        margin: 0 auto;
        display: flex;
        justify-content: space-evenly;
        align-items: flex-end;
    }
    
    .year-group {
        min-width: 80px;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
    }
    
    .bars-container {
        gap: 14px;  /* Increased from 12px to 14px for even better horizontal spacing */
        width: fit-content;
        justify-content: center;
        display: flex;
        align-items: flex-end;
        margin: 0 auto;
    }
    
    .bar {
        width: 22px;
        margin: 0;
        min-width: 22px;
        flex: 0 0 22px;
        border-radius: 3px 3px 0 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .bar-value {
        font-size: 0.48rem;  /* Reduced for better fit */
        padding: 1px 2px;    /* Reduced padding for more compact labels */
        min-width: 22px;     /* Reduced width to prevent overlap */
        white-space: nowrap;
        transform: translateX(-50%);
        left: 50%;
        background: rgba(0, 0, 0, 0.96);
        border-radius: 6px;
        font-weight: 700;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.35);
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.7);
        letter-spacing: 0.2px;
        z-index: 100;  /* Ensure high z-index on smallest mobile */
        pointer-events: none;
        bottom: calc(100% + 16px);  /* Increased Y-axis spacing to prevent overlapping */
    }
    
    .year-label {
        font-size: 0.85rem;
        bottom: -115px;
        transform: translateX(-50%);
        left: 50%;
        width: 80px;
        text-align: center;
        line-height: 1.3;
        font-weight: 600;
        letter-spacing: 0.5px;
        color: #e0e0e0;
    }
    
    .year-group.multi-line .year-label {
        bottom: -115px;
    }
    
    /* Ensure specific order for legend items on mobile */
    .legend-item.crypto {
        order: 1;
    }
    
    .legend-item.stocks {
        order: 2;
    }
    
    .legend-item.benchmark {
        order: 3;
    }
    
    .year-date {
        font-size: 0.68rem;
    }
    
    .performance-disclaimer p {
        font-size: 0.8rem;
        padding: 10px 12px;
        line-height: 1.4;
    }
}

/* Extra small mobile optimizations for legend clarity */
@media (max-width: 400px) {
    .chart-legend {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        max-width: 280px;
    }
    
    .legend-item {
        width: auto;  /* Allow natural width expansion */
        max-width: none;  /* Remove max-width restriction */
        justify-content: center;
        padding: 12px 16px;
        font-size: 0.85rem;
        border-radius: 22px;
        text-align: center;
        white-space: nowrap;  /* Prevent text wrapping */
    }
    
    .legend-color {
        width: 14px;
        height: 14px;
        margin-right: 10px;
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .performance-simple-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .performance-simple-grid {
        grid-template-columns: 1fr;
    }
    
    .performance-notes {
        flex-direction: column;
        align-items: center;
    }
    
    .note-item {
        width: 100%;
        justify-content: center;
    }
}

/* Card specific styles */
.crypto-card .simple-card-header i {
    color: #8a5cf6; /* Purple for crypto */
}

.stock-card .simple-card-header i {
    color: #10b981; /* Green for stocks */
}

.benchmark-card .simple-card-header i {
    color: #f59e0b; /* Yellow for benchmark */
}

.crypto-card .simple-metric.current {
    border-left-color: #8a5cf6;
    background: rgba(138, 92, 246, 0.1);
}

.stock-card .simple-metric.current {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .performance-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
    
    .performance-card {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .performance {
        padding: 60px 0;
    }
    
    .performance h2 {
        font-size: 2rem;
    }
    
    .performance-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .metric-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .year {
        margin-bottom: 8px;
        width: 100%;
    }
    
    .metric-bar {
        width: 100%;
    }
}

/* Performance CTA Button */
.performance-cta {
    text-align: center;
    margin: 40px 0 30px 0;
    padding: 0 20px;
}

.performance-cta .btn {
    font-size: 1.1rem;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(65, 150, 191, 0.3);
}

.performance-cta .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(65, 150, 191, 0.4);
}

/* Mobile adjustments for the CTA button */
@media (max-width: 768px) {
    .performance-cta {
        margin: 30px 0 25px 0;
        padding: 0 15px;
    }
    
    .performance-cta .btn {
        font-size: 1rem;
        padding: 14px 28px;
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 576px) {
    .performance-cta {
        margin: 25px 0 20px 0;
    }
    
    .performance-cta .btn {
        font-size: 0.95rem;
        padding: 12px 24px;
    }
}
