/* 
 * BBC Portfolio Strategy Tabs Styles 
 */

:root {
    --bbc-gold: #D4AF37;
    /* Gold color from design */
    --bbc-blue: #4A90E2;
    --bbc-grey: #666666;
    --bbc-dark-bg: #0A0A0A;
    --bbc-darker-bg: #000000;
    --bbc-text-muted: #888888;
    --bbc-text-light: #ffffff;
    --bbc-font-serif: "Mirella";
    --bbc-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --bbc-transition: all 0.3s ease-in-out;
}

.bbc-portfolio-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 450px), 1fr));
    align-items: center;
    gap: clamp(1rem, 0.6359rem + 1.5534vw, 2.5rem);
    font-family: var(--bbc-font-sans);
    color: var(--bbc-text-light);
}

/* Sidebar / Tabs */
.bbc-portfolio-sidebar {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bbc-tab-item {
    background-color: var(--bbc-dark-bg);
    border-radius: 10px;
    padding: 24px 20px;
    cursor: pointer;
    border: 1px solid transparent;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-30px);
    transition: background-color 0.3s ease-in-out, border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out, opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.bbc-tab-item:hover {
    background-color: #141414;
}

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

.bbc-tab-title {
    margin: 0;
    font-family: var(--bbc-font-serif);
    font-size: 20px;

    color: #E2B967;
    transition: var(--bbc-transition);
    padding-bottom: 0px;
    font-weight: 400;
    line-height: 110%;
}

.bbc-tab-percentage {
    color: #7C7C7C;
    transition: var(--bbc-transition);

    font-family: "JetBrains Mono";
    font-size: 20px;
    font-weight: 700;
    line-height: 1.5;
}

.bbc-tab-subtitle {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease;
}

.bbc-tab-subtitle p {
    margin: 0;

    color: #7C7C7C;
    font-family: "Inter Display";
    font-size: 15px;
    font-weight: 400;
    line-height: 1.2;
}

/* Active Tab State */
.bbc-tab-item.bbc-active {
    background-color: var(--bbc-darker-bg);
    border-color: #222;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.bbc-tab-item.bbc-active .bbc-tab-title,
.bbc-tab-item.bbc-active .bbc-tab-percentage {
    color: var(--bbc-gold);
}

.bbc-tab-item.bbc-active .bbc-tab-subtitle {
    max-height: 100px;
    opacity: 1;
    margin-top: 8px;
}

/* Content Area */
.bbc-portfolio-content-area {
    flex: 1;
    position: relative;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.bbc-tab-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.bbc-tab-content.bbc-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.bbc-tab-content-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Top Chart (Donut Chart) */
.bbc-tab-top-chart {
    text-align: center;
    width: 150px;
    margin: 0 auto;
}

.bbc-donut-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
}

.bbc-donut-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    /* Start at top */
}

.bbc-donut-bg {
    fill: none;
    stroke: #7C7C7C;
    opacity: 0.2;
    /* Light grey track from design */
    stroke-width: 3.8;
}

.bbc-donut-fill {
    fill: none;
    stroke: var(--bbc-gold);
    stroke-width: 3.8;
    stroke-linecap: square;
    transition: stroke-dasharray 1.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.bbc-donut-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bbc-donut-val {
    font-family: var(--bbc-font-serif);
    font-size: 36px;
    color: var(--bbc-gold);
    font-weight: 400;
    line-height: 1;
}

.bbc-donut-label {
    color: #5A5046;
    font-family: "Inter Display";
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
}

@keyframes scaleIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Example Box */
.bbc-example-box {
    padding: 24px;
    width: 100%;

    border-radius: 10px;
    border: 1px solid #2F2F2F;
    background: #000;
    box-shadow: 0 24px 64px 0 rgba(0, 0, 0, 0.65), 0 1px 0 0 rgba(255, 255, 255, 0.04) inset;
}

.bbc-example-heading {
    text-transform: uppercase;
    margin: 0 0 16px 0;

    color: #BFBFBF;

    /* Number Text */
    font-family: "JetBrains Mono";
    font-size: 14px;
    font-weight: 400;
    line-height: 18px;
}

.bbc-example-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bbc-example-bar-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bbc-example-bar-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.bbc-bar-name {
    color: #7C7C7C;
    font-family: "Inter Display";
    font-size: 15px;
    font-weight: 400;
    line-height: 1.2;
}

.bbc-bar-values {
    color: #D4AF37;
    font-family: "JetBrains Mono";
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

.bbc-bar-separator {
    color: var(--bbc-text-muted);
    margin: 0 6px;
}

.bbc-example-bar-track {
    width: 100%;
    height: 6px;
    background-color: #1a1a1a;
    border-radius: 3px;
    overflow: hidden;
}

.bbc-example-bar-fill {
    height: 100%;
    border-radius: 3px;
    width: 0;
    /* Animated via JS */
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Responsive */
@media (max-width: 768px) {
    .bbc-portfolio-sidebar {
        flex: 1 1 100%;
    }

    .bbc-tab-item {
        transform: translateY(20px);
    }

    .bbc-portfolio-content-area {
        flex: 1 1 100%;
        transform: translateY(20px);
    }
}

/* ==========================================================================
   Animations — Viewport Entry
   ========================================================================== */
.bbc-tab-item.bbc-in-view {
    opacity: 1;
    transform: translate(0);
}

.bbc-portfolio-content-area.bbc-in-view {
    opacity: 1;
    transform: translate(0);
}