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

/* CSS Variables */
:root {
    /* Colors */
    --bg-dark: #0a0e27;
    --bg-light: #1a1f3a;
    --for-green: #00ff88;
    --against-red: #ff4757;
    --warn-amber: #ffd93d;
    --text-light: #e8e8e8;
    --text-dim: #a0a0a0;
    --ocean: #0f1419;
    --land: #1e2a3a;
    --blast-orange: #ff6b35;
    --blast-yellow: #f7931e;

    /* Typography */
    --font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    --h1-size: 72px;
    --h2-size: 48px;
    --h3-size: 32px;
    --body-size: 18px;
    --caption-size: 14px;
    --line-height: 1.75;

    /* Layout */
    --border-radius: 4px;
    --transition-duration: 1500ms;
    --transition-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Smooth Scrolling - Handled by Lenis JS library */
html {
    /* scroll-behavior removed - conflicts with Lenis smooth scroll */
    /* Lenis provides superior smooth scrolling with proper animation sync */
}

/* Base Typography */
body {
    font-family: var(--font-family);
    font-size: var(--body-size);
    line-height: var(--line-height);
    color: var(--text-light);
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-light) 100%);
    overflow-x: hidden;
}

h1 {
    font-size: var(--h1-size);
    font-weight: 700;
    letter-spacing: -2px;
    line-height: 1.1;
}

h2 {
    font-size: var(--h2-size);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h3 {
    font-size: var(--h3-size);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* Globe Container */
#globe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    background: #000000; /* Pitch black background for star field effect */
}

#globe-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#globe-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Country Highlighting Styles */
.country-highlight {
    transition: all 0.5s ease;
}

.country-highlight-multiple {
    transition: all 0.3s ease;
}

.country-glow {
    animation: pulse-glow 2s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
    0% {
        opacity: 0.3;
        stroke-width: 6;
    }

    100% {
        opacity: 0.6;
        stroke-width: 10;
    }
}

/* Scroll prompt for preloader */
.scroll-prompt {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Title Overlay - Fullscreen sticky with zoom animation */
#title-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
    opacity: 1;
    will-change: transform, opacity, scale;
    pointer-events: auto;
    /* Animation controlled by GSAP ScrollTrigger */
}

/* SVG Title - Scales infinitely without quality loss */
#title-svg {
    width: 90%;
    max-width: 1400px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.9));
    shape-rendering: geometricPrecision;
    text-rendering: geometricPrecision;
}

@keyframes pulse-opacity {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Story Container */
#story-container {
    position: relative;
    z-index: 2;
    margin-top: 250vh;  /* Extended to match title animation duration and prevent overlap */
    background: transparent;
}

/* Story Sections */
.story-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 2rem;
    position: relative;
}

.story-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
}

.story-section[data-theme="for"]::before {
    background: var(--for-green);
    left: auto;
    right: 0;
}

.story-section[data-theme="against"]::before {
    background: var(--against-red);
}

/* Neutral theme sections - centered and stacked layout */
.story-section[data-theme="neutral"] {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 6rem;
}

.story-section[data-theme="neutral"] .content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.story-section[data-theme="neutral"] .viz {
    width: 100%;
    max-width: 600px;
    margin: 3rem auto 0;
    height: auto;
    min-height: 300px;
}

/* Flip layout for FOR sections */
.story-section[data-theme="for"] {
    flex-direction: row-reverse;
}

/* Section Layout */
.story-section .content {
    width: 40%;
    padding-right: 3rem;
    z-index: 3;
    position: relative;
}

/* Adjust padding for FOR sections */
.story-section[data-theme="for"] .content {
    padding-right: 10;
    padding-left: 3rem;
    margin-top: 15rem;
}

.story-section[data-section="risk-thermometer"][data-theme="for"] .content {
    margin-top: -5rem !important;
}


.story-section .viz {
    width: 55%;
    height: 80vh;
    position: relative;
    min-height: 400px;
    opacity: 0;
    display: none;
    visibility: hidden;
    transition: opacity 0.8s ease;
    will-change: opacity, visibility;
}

.story-section .viz.active {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
    z-index: 1;
}

.story-section .viz:not(.active) {
    opacity: 0 !important;
    display: none !important;
    visibility: hidden !important;
    pointer-events: none;
}

/* Full width content for conclusion */
.story-section .content.full-width {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding-right: 0;
    text-align: center;
}

/* Final Poll Styling */
.final-poll {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.poll-buttons {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    justify-content: center;
}

.poll-btn {
    padding: 1rem 2rem;
    border: 2px solid;
    border-radius: var(--border-radius);
    background: transparent;
    color: var(--text-light);
    font-family: var(--font-family);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.poll-btn.for-btn {
    border-color: var(--for-green);
}

.poll-btn.for-btn:hover {
    background: var(--for-green);
    color: var(--bg-dark);
}

.poll-btn.against-btn {
    border-color: var(--against-red);
}

.poll-btn.against-btn:hover {
    background: var(--against-red);
    color: var(--text-light);
}

.poll-btn.neutral-btn {
    border-color: var(--text-dim);
}

.poll-btn.neutral-btn:hover {
    background: var(--text-dim);
    color: var(--bg-dark);
}

.poll-results {
    margin-top: 2rem;
}

.result-bar {
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    margin-bottom: 1rem;
}

.result-segment {
    height: 100%;
    transition: width 1s ease;
}

.for-segment {
    background: var(--for-green);
}

.against-segment {
    background: var(--against-red);
}

.neutral-segment {
    background: var(--text-dim);
}

.result-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--caption-size);
}

.for-label {
    color: var(--for-green);
}

.against-label {
    color: var(--against-red);
}

.neutral-label {
    color: var(--text-dim);
}

/* Simple Nuclear Preloader */
.preloader-component {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-light) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

/* Nuclear Symbol Animation */
.nuclear-symbol-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.nuclear-symbol {
    filter: drop-shadow(0 0 20px var(--for-green));
}

.symbol-group {
    transform-origin: 0 0;
    animation: spin 2s linear infinite;
}

/* Simple spin animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Loading text */
.loading-text {
    text-align: center;
}

.loading-text p {
    color: var(--text-light);
    font-size: 18px;
    font-weight: 400;
    margin: 0;
    opacity: 0.8;
}

/* Main content initially hidden */
#globe-container,
#story-container {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}

.content-loaded #globe-container,
.content-loaded #story-container {
    opacity: 1;
    transform: translateY(0);
}

/* Error Message Styling */
#error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    background: rgba(255, 71, 87, 0.95);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    backdrop-filter: blur(10px);
    border: 2px solid var(--against-red);
    box-shadow: 0 10px 30px rgba(255, 71, 87, 0.3);
}

.error-content h3 {
    color: white;
    margin-bottom: 1rem;
    font-size: 24px;
}

.error-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.error-content button {
    padding: 0.75rem 1.5rem;
    background: white;
    color: var(--against-red);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
}

.error-content button:hover {
    background: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .symbol-group {
        animation: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nuclear-symbol .segment {
        stroke-width: 4;
        opacity: 1;
    }

    .center-circle {
        stroke-width: 6;
    }

    .outer-ring {
        stroke-width: 4;
        opacity: 0.8;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nuclear-symbol {
        width: 100px;
        height: 100px;
    }

    .preloader-content {
        margin-top: 120px;
        gap: 1.5rem;
    }

    .typewriter-text {
        font-size: clamp(20px, 6vw, 36px);
        letter-spacing: 1px;
    }

    .progress-container {
        width: 90vw;
    }

    #error-message {
        margin: 0 1rem;
        width: calc(100% - 2rem);
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .nuclear-symbol {
        width: 80px;
        height: 80px;
    }

    .preloader-content {
        margin-top: 100px;
        gap: 1rem;
    }

    .typewriter-text {
        font-size: clamp(18px, 5vw, 28px);
    }

    .loading-status {
        margin-top: 0.5rem;
    }

    .status-text {
        font-size: 14px;
    }
}

/* Tooltip Styling */
.tooltip {
    position: absolute;
    background: rgba(26, 31, 58, 0.95);
    color: var(--text-light);
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-size: var(--caption-size);
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 250px;
}

.tooltip.visible {
    opacity: 1;
}

/* Chart Styling */
.chart-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.chart-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
}

.chart-narrative {
    margin-left: 6rem;
}

.axis {
    font-size: 12px;
    color: var(--text-dim);
}

.axis-label {
    font-size: 14px;
    font-weight: 500;
}

.bar {
    transition: all 0.3s ease;
}

.bar:hover {
    opacity: 0.8;
}

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

.area {
    opacity: 0.7;
}

/* Timeline Controls */
.timeline-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-btn {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 2px solid var(--text-dim);
    color: var(--text-light);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: var(--font-family);
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
}

.timeline-btn:hover:not(:disabled) {
    background: var(--text-dim);
    color: var(--bg-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.timeline-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(160, 160, 160, 0.3);
}

#play-btn {
    border-color: var(--for-green);
    color: var(--for-green);
}

#play-btn:hover:not(:disabled) {
    background: var(--for-green);
    color: var(--bg-dark);
}

#show-all-btn {
    border-color: var(--warn-amber);
    color: var(--warn-amber);
}

#show-all-btn:hover:not(:disabled) {
    background: var(--warn-amber);
    color: var(--bg-dark);
}

.year-display {
    font-size: 24px;
    font-weight: 700;
    min-width: 80px;
    text-align: center;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --h1-size: 48px;
        --h2-size: 36px;
        --h3-size: 24px;
        --body-size: 16px;
    }

    .story-section {
        flex-direction: column;
        padding: 1rem;
    }

    .story-section .content {
        width: 100%;
        padding-right: 0;
        margin-bottom: 2rem;
    }

    .story-section .viz {
        width: 100%;
        height: 60vh;
    }

    .poll-buttons {
        flex-direction: column;
        align-items: center;
    }

    .poll-btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    :root {
        --h1-size: 36px;
        --h2-size: 28px;
        --h3-size: 20px;
        --body-size: 14px;
    }

    #title-overlay {
        bottom: 15%;
        padding: 0 1rem;
    }

    .story-section {
        padding: 1rem 0.5rem;
    }

    .timeline-controls {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .year-slider {
        order: -1;
        width: 100%;
        max-width: none;
        margin: 0 0 1rem 0;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    #title-overlay .scroll-hint {
        animation: none;
    }

    .loading-spinner {
        animation: none;
        border-top-color: var(--text-dim);
    }
}

/* Focus indicators for accessibility */
button:focus,
.poll-btn:focus,
.timeline-btn:focus {
    outline: 2px solid var(--for-green);
    outline-offset: 2px;
}

/* Scroll to Top Button */
.scroll-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--for-green), #00cc70);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
    color: var(--bg-dark);
}

.scroll-to-top-btn:hover {
    background: linear-gradient(135deg, #00ff88, #00e67a);
    box-shadow: 0 6px 16px rgba(0, 255, 136, 0.4);
    transform: translateY(-2px);
}

.scroll-to-top-btn:active {
    transform: translateY(0);
}

.scroll-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 3;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-light: #ffffff;
        --text-dim: #cccccc;
        --bg-dark: #000000;
        --bg-light: #1a1a1a;
    }
}

/* Print styles */
@media print {

    #globe-container,
    .viz {
        display: none;
    }

    .story-section {
        page-break-inside: avoid;
        min-height: auto;
    }

    .story-section .content {
        width: 100%;
    }
}

/* Safety Timeline Styles */
#safety-timeline {
    width: 100%;
    min-height: 400px;
    position: relative;
}

#safety-timeline svg {
    display: block;
    margin: 0 auto;
}

.milestone {
    transition: all 0.3s ease;
}

.milestone-connector {
    transition: all 0.3s ease;
}

.milestone:hover .milestone-connector {
    stroke-width: 4;
}

.timeline-legend {
    opacity: 0.8;
}

@media (max-width: 768px) {
    #safety-timeline {
        min-height: 500px;
    }

    #safety-timeline svg {
        overflow-x: auto;
    }
}


/* Energy Comparison Section */
.story-section.energy-comparison-section {
    padding: 0;
    display: block;
    height: auto;
    min-height: 100vh;
}

.energy-comparison-container {
    display: flex;
    width: 100%;
    position: relative;
    /* Height is determined by content (scroll-text) */
}

.sticky-viz {
    position: sticky;
    top: 0;
    width: 50%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Override .viz styles inside sticky-viz for energy comparison */
.sticky-viz .viz {
    width: 100%;
    height: 100%;
    opacity: 1;
}

.scroll-text {
    width: 50%;
    padding-top: 50vh;
    /* Start text lower */
    padding-bottom: 50vh;
    z-index: 10;
}

.step {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    transition: opacity 0.5s ease;
    pointer-events: none;
    /* Let clicks pass through if needed */
}

.step.active {
    opacity: 1;
}

.step-content {
    background: rgba(10, 14, 39, 0.95);
    /* Dark background with opacity */
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid var(--for-green);
    max-width: 400px;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.step-content h3 {
    color: var(--for-green);
    margin-bottom: 0.5rem;
    font-size: 24px;
}

.step-content p {
    margin-bottom: 0.5rem;
    font-size: 18px;
}

/* Visualization Groups */
.viz-group {
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Disable CSS transitions for energy comparison viz groups - D3 handles these */
.energy-comparison-section .viz-group {
    transition: none;
}

/* Responsive */
@media (max-width: 768px) {
    .story-section.energy-comparison-section {
        display: flex;
        flex-direction: column;
    }

    .energy-comparison-container {
        flex-direction: column;
    }

    .sticky-viz {
        position: relative;
        /* Disable sticky on mobile if needed, or keep it */
        position: sticky;
        top: 0;
        width: 100%;
        height: 50vh;
        z-index: 5;
        background: var(--bg-dark);
        /* Ensure background covers content behind */
    }

    .scroll-text {
        width: 100%;
        padding-top: 0;
        padding-bottom: 20vh;
    }

    .step {
        min-height: 60vh;
    }

    .step-content {
        margin: 0 1rem;
        background: rgba(10, 14, 39, 0.95);
    }
}

/* --- Terms and Conditions (Cosmic Theme) --- */

.tc-container-wrapper {
    width: 100%;
    margin: 3rem 0;
    position: relative;
    z-index: 10;
}

/* Main Glass Box */
.tc-container {
    background: rgba(10, 14, 39, 0.7); /* Deep Cosmic Blue */
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace; /* Tech font */
    overflow: hidden;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

/* Header */
.tc-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tc-title {
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 0.85em;
    color: var(--for-green); /* Tech Accent */
    text-transform: uppercase;
}

.tc-status {
    font-family: monospace;
    font-size: 0.75em;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-dim);
}

/* Body Layout */
.tc-body {
    display: flex;
    flex-grow: 1;
    position: relative;
}

/* Sidebar Stats */
.tc-sidebar {
    width: 200px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    font-family: monospace;
    flex-shrink: 0;
}

.tc-stat-block h4 {
    font-size: 0.65em;
    color: var(--text-dim);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
    padding-bottom: 4px;
}

.tc-stat-value {
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
}

.stat-highlight { color: var(--warn-amber); }

/* Main Content Area */
.tc-scroll-window {
    flex-grow: 1;
    padding: 40px;
    overflow-y: auto;
    position: relative;
    background: linear-gradient(to bottom, rgba(10,14,39,0), rgba(0,0,0,0.3));
}

.tc-content-text h3 {
    font-size: 1.1em;
    color: #fff;
    margin-top: 40px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--for-green);
    padding-bottom: 8px;
    display: inline-block;
    text-transform: uppercase;
}

.tc-content-text p {
    font-size: 0.9em;
    line-height: 1.7;
    color: var(--text-light);
    opacity: 0.9;
    margin-bottom: 20px;
    max-width: 90%;
}

.tc-content-text strong {
    color: #fff;
    font-weight: 600;
}

/* Visualizations embedded in text */
.data-clause-viz {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    padding: 20px;
    margin: 25px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.data-clause-viz::before {
    content: "EXHIBIT DATA //";
    position: absolute;
    top: -10px;
    left: 10px;
    background: var(--bg-dark); /* Matches section bg */
    padding: 0 10px;
    font-size: 0.7em;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.viz-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.8em;
    font-family: monospace;
}

.viz-label {
    width: 120px;
    text-align: right;
    margin-right: 15px;
    opacity: 0.7;
    font-size: 0.9em;
}

.viz-bar-container {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    height: 10px;
    border-radius: 2px;
    overflow: hidden;
}

.viz-bar {
    height: 100%;
    border-radius: 2px;
}

.viz-val {
    width: 70px;
    text-align: right;
    margin-left: 10px;
    opacity: 0.9;
}

/* Footer / Actions */
.tc-actions {
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.tc-btn {
    padding: 12px 24px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--text-light);
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tc-btn-reject {
    border-color: var(--against-red);
    color: var(--against-red);
    opacity: 0.8;
}

.tc-btn-reject:hover {
    background: rgba(255, 71, 87, 0.1);
    opacity: 1;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.2);
}

.tc-btn-accept {
    border-color: var(--for-green);
    color: #0a0e27;
    background: var(--for-green);
}

.tc-btn-accept:hover {
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
    transform: translateY(-1px);
}

/* Overlay */
.tc-viz-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(10, 14, 39, 0.95);
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.tc-viz-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.tc-overlay-content {
    text-align: center;
    max-width: 600px;
}

.tc-big-stat {
    font-size: 3.5em;
    font-weight: 700;
    margin: 15px 0;
    font-family: monospace;
    letter-spacing: -2px;
}

/* --- Terms and Conditions: Advanced Visualizations --- */

/* 1. Lollipop Chart (Mortality) */
.viz-lollipop-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    height: 24px;
}

.viz-lollipop-track {
    flex-grow: 1;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.viz-lollipop-line {
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    position: absolute;
    left: 0;
    top: 50%;
}

.viz-lollipop-head {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px currentColor;
    z-index: 2;
    background: currentColor; /* Uses color from inline style */
}

/* 2. Bubble Chart (Carbon) */
.viz-bubble-container {
    display: flex;
    align-items: baseline;
    justify-content: space-around;
    height: 140px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.viz-bubble-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    width: 25%;
}

.viz-bubble {
    border-radius: 50%;
    opacity: 0.8;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    font-weight: bold;
    color: rgba(0,0,0,0.7);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

.viz-bubble:hover {
    transform: scale(1.1);
    z-index: 10;
}

/* 3. Nested Squares (Waste) */
.viz-square-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    margin: 10px 0;
}

.viz-square-label {
    position: absolute;
    bottom: 5px;
    font-size: 0.7em;
    width: 100%;
    text-align: center;
    color: rgba(255,255,255,0.6);
}

.viz-square-coal {
    border: 1px dashed var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.viz-square-nuclear {
    background: var(--for-green);
    box-shadow: 0 0 10px var(--for-green);
    position: absolute; /* Center inside the large square */
}

/* 4. Dot Matrix (Chernobyl) */
.viz-dot-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
}

.viz-dot-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.viz-dot-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    max-width: 300px;
}

.viz-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #333;
}

.viz-dot.active {
    box-shadow: 0 0 4px currentColor;
    background: currentColor;
}

/* --- Energy Orb Battle Styles --- */
.orb-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    color: #e6f2ff;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 1rem;
}

.orb-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px 0;
    margin-bottom: 1rem;
}

.orb-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 1rem;
}

.orb-controls {
    display: flex;
    gap: 12px;
}

.orb-btn {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
}

.orb-btn.primary {
    background: linear-gradient(90deg, #1b6cff, #3bb9ff);
    color: #001;
    font-weight: 700;
    border: none;
}

.orb-btn.secondary {
    background: #1a1a1a;
    color: #ddd;
}

.orb-categories {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.orb-catBox {
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    background: #0c1b30;
    border: 1px solid rgba(255,255,255,0.05);
    font-size: 14px;
    transition: all 0.2s;
}

.orb-catBox.selected {
    background: #1b6cff;
    border: 1px solid #69c0ff;
    color: white;
}

.orb-tally-box {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 14px;
}

.orb-arena-wrap {
    width: 100%;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
}

svg#orb-arena {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 600px;
    background: transparent;
}

.orb-timeline-wrap {
    height: 40px;
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    overflow: hidden;
}

#orb-timeline {
    display: flex;
    gap: 1px;
    height: 100%;
    width: 100%;
}

.orb-timelineBar {
    flex-grow: 1;
    height: 100%;
    cursor: pointer;
    transition: opacity 0.2s;
}

.orb-timelineBar:hover {
    opacity: 0.8;
}

.orb-timelineTooltip {
    position: absolute;
    background: rgba(0,0,0,0.9);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    pointer-events: none;
    font-size: 12px;
    opacity: 0;
    z-index: 1000;
    border: 1px solid rgba(255,255,255,0.2);
}

.orb-popup {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.7);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10;
    border-radius: 8px;
}

.orb-popup.show {
    visibility: visible;
    opacity: 1;
}

.orb-popup-content {
    background: #0b1a26;
    padding: 36px 64px;
    border-radius: 16px;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.orb-year-range {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 14px;
}