/* Case Study Specific Styles */
:root {
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-blue: #4f46e5;
    --accent-red: #ef4444;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
}

body {
    background-color: var(--bg-light);
}

/* Hero Section */
.case-study-hero {
    padding: 180px 0 100px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.case-study-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.15) 0%, transparent 70%);
}

.case-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(79, 70, 229, 0.2);
    border: 1px solid rgba(79, 70, 229, 0.4);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #818cf8;
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.case-study-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.scroll-indicator {
    margin-top: 60px;
    opacity: 0.8;
    animation: bounce 2s infinite;
}

.scroll-indicator span {
    display: block;
    margin-bottom: 10px;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.arrow-down {
    font-size: 1.5rem;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Scrollytelling Layout */
.scrolly-container {
    display: flex;
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

.narrative-pane {
    width: 40%;
    padding: 0 40px 100px;
    z-index: 10;
}

.visual-pane {
    width: 60%;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-left: 1px solid #e2e8f0;
    overflow: hidden;
}

.diagram-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#structure-svg {
    max-height: 85vh;
    width: auto;
}

/* Narrative Steps */
.step {
    min-height: 80vh;
    /* Ensures scroll space */
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0.3;
    transition: opacity 0.5s ease;
    padding: 40px 0;
}

.step.active {
    opacity: 1;
}

.step-marker {
    display: inline-block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--accent-blue);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.step h2 {
    font-size: 2.25rem;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.step p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.step p.text-muted {
    font-size: 1rem;
    color: #94a3b8;
    font-style: italic;
    margin-top: -12px;
}

.step p strong {
    color: var(--text-primary);
    font-weight: 600;
}

.highlight-box {
    padding: 24px;
    border-radius: 12px;
    margin: 24px 0;
    border-left: 4px solid;
}

.highlight-box.warning {
    background: #fef2f2;
    border-color: var(--accent-red);
}

.highlight-box.warning strong {
    color: #991b1b;
}

.highlight-box.conclusion {
    background: #f0fdf4;
    border-color: #16a34a;
}

/* Animation Utilities */
.hidden-initially {
    opacity: 0;
    visibility: hidden;
}

.box {
    fill: #ffffff;
    stroke: #94a3b8;
    stroke-width: 2;
    transition: all 0.3s ease;
}

.box-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
    fill: var(--text-primary);
}

.small-label {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    fill: #64748b;
    text-anchor: middle;
}

.conn-line {
    fill: none;
    stroke: #cbd5e1;
    stroke-width: 2;
}

.ownership-tag {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    fill: var(--accent-blue);
    text-anchor: middle;
}

/* Interactive Elements */
.box.lux-box:hover {
    cursor: pointer;
    /* Red hover state handled by JS/Logic visually */
    filter: drop-shadow(0 4px 6px rgba(239, 68, 68, 0.2));
}

.visual-controls {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: white;
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.slider {
    width: 40px;
    height: 20px;
    background: #cbd5e1;
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
    margin-right: 12px;
}

.slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

input:checked+.slider {
    background: var(--accent-blue);
}

input:checked+.slider::before {
    transform: translateX(20px);
}

.label-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Tooltip */
#tooltip-group {
    transition: opacity 0.2s;
}

/* Bank Box Overrides */
.bank-box {
    fill: #1e293b;
    stroke: #4f46e5;
    stroke-width: 2;
}

.bank-text {
    fill: #ffffff;
}

.bank-subtext {
    fill: #94a3b8;
    font-size: 14px;
}

/* Control lines from bank */
.control-line {
    stroke: #4f46e5;
    stroke-width: 2;
    fill: none;
}

/* Luxembourg "29" label styling */
.lux-label {
    font-weight: 500;
    transition: fill 0.3s ease, font-weight 0.3s ease;
}

/* Family container styling */
.family-container {
    fill: #ffffff;
}

/* Icon boxes for family branches */
.icon-box {
    fill: #f8fafc;
    stroke: #e2e8f0;
    stroke-width: 1.5;
}

.icon-label {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    fill: #475569;
    font-weight: 500;
}

/* Flow line animation base */
.flow-line {
    stroke-linecap: round;
    filter: drop-shadow(0 1px 2px rgba(34, 197, 94, 0.3));
}

/* Choke point styling */
.choke-point {
    filter: drop-shadow(0 2px 6px rgba(239, 68, 68, 0.5));
}

/* Blocked label styling */
.blocked-label {
    font-family: 'Plus Jakarta Sans', sans-serif;
    filter: drop-shadow(0 1px 2px rgba(239, 68, 68, 0.3));
}

/* Public company box */
.public-co {
    fill: #f0f9ff;
    stroke: #0284c7;
    stroke-width: 2;
}

/* Holding vehicle box */
.holding-vehicle {
    fill: #fefce8;
    stroke: #ca8a04;
    stroke-width: 2;
}

/* SRL boxes */
.srl-box {
    fill: #f8fafc;
    stroke: #94a3b8;
    stroke-width: 1.5;
}

/* LUX boxes (before highlight) */
.lux-box {
    fill: #faf5ff;
    stroke: #a855f7;
    stroke-width: 1.5;
    transition: all 0.3s ease;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .scrolly-container {
        flex-direction: column-reverse;
    }

    .visual-pane {
        position: sticky;
        /* Or static depending on preference */
        width: 100%;
        height: 50vh;
        top: 80px;
        /* Header offset */
        z-index: 5;
    }

    .narrative-pane {
        width: 100%;
        padding: 20px;
    }

    .step {
        min-height: 50vh;
        opacity: 1;
        /* Always visible on mobile to avoid confusion */
    }
}