/* Comprehensive $100 Invested Growth Chart Styling */
.invested-chart-container {
    max-width: 100%;
    margin: 30px 0;
    padding: 35px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    position: relative;
    overflow: hidden;
}

.invested-chart-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.invested-chart-header {
    text-align: center;
    margin-bottom: 35px;
}

.invested-chart-title {
    font-size: 32px;
    font-weight: 800;
    color: #1a202c;
    margin: 0 0 12px 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.invested-chart-subtitle {
    font-size: 18px;
    color: #4a5568;
    margin: 0 0 20px 0;
    font-weight: 500;
    line-height: 1.4;
}

.invested-chart-period {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.invested-chart-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.chart-period-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #4a5568;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-period-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.chart-period-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.invested-chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    border-radius: 12px;
    border: 1px solid #e6f0ff;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 12px;
    color: #718096;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #1a202c;
    margin: 0;
}

.stat-change {
    font-size: 12px;
    font-weight: 600;
    margin-top: 5px;
}

.stat-change.positive {
    color: #10b981;
}

.stat-change.negative {
    color: #ef4444;
}

.invested-chart-bars {
    margin: 0 0 30px 0;
    padding: 0;
    list-style: none;
}

.invested-chart-bar {
    margin-bottom: 25px;
    position: relative;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: all 0.4s ease;
}

.invested-chart-bar:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
    border-color: #cbd5e0;
}

.invested-chart-bar:last-child {
    margin-bottom: 0;
}

.invested-bar-content {
    position: relative;
    z-index: 2;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invested-bar-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.invested-bar-label {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 5px 0;
    position: relative;
    z-index: 3;
}

.invested-bar-details {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.invested-bar-values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.invested-bar-value {
    font-size: 28px;
    font-weight: 800;
    color: #1a202c;
    margin: 0 0 5px 0;
    position: relative;
    z-index: 3;
}

.invested-bar-growth {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.invested-bar-growth.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.invested-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 12px;
    transition: width 2.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.08;
    z-index: 1;
}

/* Enhanced colors for different assets */
.invested-chart-bar[data-asset*="S&P"] .invested-bar-fill,
.invested-chart-bar[data-asset*="Stock"] .invested-bar-fill {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.invested-chart-bar[data-asset*="Gold"] .invested-bar-fill {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.invested-chart-bar[data-asset*="Bond"] .invested-bar-fill {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.invested-chart-bar[data-asset*="Cash"] .invested-bar-fill {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.invested-chart-bar[data-asset*="Real Estate"] .invested-bar-fill,
.invested-chart-bar[data-asset*="REIT"] .invested-bar-fill {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.invested-chart-bar[data-asset*="Bitcoin"] .invested-bar-fill,
.invested-chart-bar[data-asset*="Crypto"] .invested-bar-fill {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.invested-chart-bar[data-asset*="Oil"] .invested-bar-fill,
.invested-chart-bar[data-asset*="Commodity"] .invested-bar-fill {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

/* Asset-specific label colors */
.invested-chart-bar[data-asset*="S&P"] .invested-bar-label,
.invested-chart-bar[data-asset*="Stock"] .invested-bar-label {
    color: #065f46;
}

.invested-chart-bar[data-asset*="Gold"] .invested-bar-label {
    color: #92400e;
}

.invested-chart-bar[data-asset*="Bond"] .invested-bar-label {
    color: #1e40af;
}

.invested-chart-bar[data-asset*="Cash"] .invested-bar-label {
    color: #374151;
}

.invested-chart-bar[data-asset*="Real Estate"] .invested-bar-label,
.invested-chart-bar[data-asset*="REIT"] .invested-bar-label {
    color: #5b21b6;
}

.invested-chart-bar[data-asset*="Bitcoin"] .invested-bar-label,
.invested-chart-bar[data-asset*="Crypto"] .invested-bar-label {
    color: #c2410c;
}

.invested-chart-footer {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #e2e8f0;
}

.invested-chart-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.insight-card {
    padding: 20px;
    background: linear-gradient(135deg, #fef7ff 0%, #f3f0ff 100%);
    border-radius: 12px;
    border: 1px solid #e9d5ff;
}

.insight-title {
    font-size: 16px;
    font-weight: 700;
    color: #6b46c1;
    margin: 0 0 10px 0;
}

.insight-text {
    font-size: 14px;
    color: #4c1d95;
    line-height: 1.5;
    margin: 0;
}

.invested-chart-note {
    font-size: 15px;
    color: #4a5568;
    font-weight: 500;
    margin: 0 0 15px 0;
    line-height: 1.6;
    text-align: center;
}

.invested-chart-disclaimer {
    font-size: 13px;
    color: #718096;
    margin: 0;
    line-height: 1.5;
    text-align: center;
    font-style: italic;
}

/* Loading and animation states */
.invested-chart-loading {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.chart-updating {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Responsive design */
@media (max-width: 768px) {
    .invested-chart-container {
        padding: 25px 20px;
        margin: 20px 0;
    }

    .invested-chart-title {
        font-size: 26px;
    }

    .invested-chart-subtitle {
        font-size: 16px;
    }

    .invested-chart-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
        padding: 15px;
    }

    .stat-value {
        font-size: 20px;
    }

    .invested-bar-content {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .invested-bar-values {
        align-items: flex-start;
        text-align: left;
    }

    .invested-bar-label {
        font-size: 18px;
    }

    .invested-bar-value {
        font-size: 24px;
    }

    .invested-chart-insights {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .invested-chart-container {
        padding: 20px 15px;
        margin: 15px 0;
    }

    .invested-chart-title {
        font-size: 22px;
    }

    .invested-bar-content {
        padding: 15px;
    }

    .invested-bar-label {
        font-size: 16px;
    }

    .invested-bar-value {
        font-size: 20px;
    }

    .chart-period-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

.invested-chart-header {
    text-align: center;
    margin-bottom: 30px;
}

.invested-chart-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.invested-chart-subtitle {
    font-size: 16px;
    color: #718096;
    margin: 0 0 20px 0;
    font-weight: 400;
}

.invested-chart-period {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.invested-chart-bars {
    margin: 0;
    padding: 0;
    list-style: none;
}

.invested-chart-bar {
    margin-bottom: 20px;
    position: relative;
    background: #f8fafc;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.invested-chart-bar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.invested-chart-bar:last-child {
    margin-bottom: 0;
}

.invested-bar-content {
    position: relative;
    z-index: 2;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invested-bar-label {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
    position: relative;
    z-index: 3;
}

.invested-bar-value {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    position: relative;
    z-index: 3;
}

.invested-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 10px;
    transition: width 2s ease-out;
    opacity: 0.15;
    z-index: 1;
}

/* Different colors for each asset */
.invested-chart-bar[data-asset="S&P 500"] .invested-bar-fill {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.invested-chart-bar[data-asset="Gold"] .invested-bar-fill {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.invested-chart-bar[data-asset="Bonds"] .invested-bar-fill {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.invested-chart-bar[data-asset="Cash"] .invested-bar-fill {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

/* Asset-specific label colors */
.invested-chart-bar[data-asset="S&P 500"] .invested-bar-label {
    color: #065f46;
}

.invested-chart-bar[data-asset="Gold"] .invested-bar-label {
    color: #92400e;
}

.invested-chart-bar[data-asset="Bonds"] .invested-bar-label {
    color: #1e40af;
}

.invested-chart-bar[data-asset="Cash"] .invested-bar-label {
    color: #374151;
}

.invested-chart-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.invested-chart-note {
    font-size: 14px;
    color: #718096;
    font-style: italic;
    margin: 0;
    line-height: 1.5;
}

.invested-chart-disclaimer {
    font-size: 12px;
    color: #a0aec0;
    margin: 10px 0 0 0;
    line-height: 1.4;
}

/* Loading state */
.invested-chart-loading {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.invested-chart-loading::after {
    content: "Loading chart data...";
    display: block;
    margin-top: 10px;
    font-size: 16px;
}

/* Responsive design */
@media (max-width: 768px) {
    .invested-chart-container {
        padding: 20px;
        margin: 20px 0;
    }

    .invested-chart-title {
        font-size: 24px;
    }

    .invested-chart-subtitle {
        font-size: 14px;
    }

    .invested-bar-content {
        padding: 15px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .invested-bar-label {
        font-size: 16px;
    }

    .invested-bar-value {
        font-size: 20px;
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .invested-chart-container {
        padding: 15px;
        margin: 15px 0;
    }

    .invested-chart-title {
        font-size: 20px;
    }

    .invested-bar-content {
        padding: 12px 15px;
    }

    .invested-bar-label {
        font-size: 15px;
    }

    .invested-bar-value {
        font-size: 18px;
    }

    .invested-chart-period {
        font-size: 12px;
        padding: 6px 12px;
    }
}
