/* ============================================
   MODERN CV WEBSITE - GLOBAL STYLES
   ============================================ */

:root {
    --primary-color: #6366f1;
    --secondary-color: #06b6d4;
    --accent-color: #ec4899;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --success: #10b981;
    --warning: #f59e0b;

    --transition-smooth: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.light-mode {
    --primary-color: #4f46e5;
    --secondary-color: #0891b2;
    --accent-color: #db2777;
    --dark-bg: #f8fafc;
    --card-bg: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #cbd5e1;
    --success: #059669;
    --warning: #d97706;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--dark-bg);
    /* debug colours */
    /* border: 2px red solid; */
    color: var(--text-primary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    padding-top: 1rem;
    padding-bottom: 7rem;
}

/* ============================================
   UNIVERSE CONTAINER
   ============================================ */

.universe {
    display: flex;
    /* Changed for layout */
    width: 100%;
    height: 100vh;
    overflow: hidden;
    /* Prevent scrolling on main layout */
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(10px);
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 56px;
    height: 28px;
    border-radius: 999px;
    border: 1.5px solid var(--border-color);
    background: var(--card-bg);
    cursor: pointer;
    z-index: 2000;
    padding: 0;
    display: flex;
    align-items: center;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.theme-toggle:hover {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.35);
    border-color: var(--primary-color);
}

.theme-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
}

.theme-thumb {
    position: absolute;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s;
    color: #fff;
}

.theme-thumb svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    stroke-width: 2;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.3s;
    fill: currentColor;
}

/* Moon visible by default (dark mode) */
.icon-moon {
    opacity: 1;
    position: absolute;
}

.icon-sun {
    opacity: 0;
    position: absolute;
    stroke-width: 2;
    fill: none;
}

/* Light mode: slide right, show sun */
.theme-toggle.is-light .theme-thumb {
    transform: translateX(28px);
    background: #f59e0b;
}

.theme-toggle.is-light .icon-moon {
    opacity: 0;
}

.theme-toggle.is-light .icon-sun {
    opacity: 1;
}

#viz-canvas-tooltip {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}


/* Page container to force captions + figure together */
.page-container {
    display: flex;
    height: 100%;
    width: 100%;
    max-width: 1100px;
    flex-direction: column;
    /* Stack them vertically */
    align-items: flex-start;
    /* ALIGN LEFT (Start of the flex axis) */
    margin: 0 auto;
    /* Center the wrapper on the page */
    gap: 1rem;
    /* Space between Main and Caption */
}

/* New Main Layout Styles */
.main-layout {
    display: flex;
    width: 100%;
    height: 100%;
    /* border: 2px purple solid; */
    max-width: 1100px;
    /* Adjust this value to control the size of the 'page' */
    aspect-ratio: 210 / 297;
    /* margin: auto; */
    /* box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color); */
}

/* Figure Caption */
.figure_caption {
    font-size: 12px;
    color: var(--text-primary);
    display: block;
    width: 100%;
    /* Fills the 1100px container width */
    max-width: 1100px;
    height: 30px;
    margin-left: 20px;
    margin-top: 0;
    /* Controlled by 'gap' in container now */
    text-align: left;
    /* Ensures text starts on the left */

    /* Visuals */
    /* border: 2px pink solid; */

}

.visualization-container {
    flex: 0 0 40%;
    position: relative;
    height: 100%;
    width: 100%;
    background-color: var(--dark-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    gap: 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.visualization-container-right {
    flex: 0 0 33%;
    position: relative;
    height: 100%;
    width: 100%;
    background-color: var(--dark-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    overflow: hidden;
    min-height: 0;
}

.main-content-container {
    display: none;
    /* Hide from right-column since charts now fill the space */
}

/* ============================================
   HEADER & NAVIGATION (REMOVED)
   ============================================ */

/* ============================================
   VISUALIZATION CONTAINER
   ============================================ */


/* Old rule removed - using flexbox layout instead */

/* Canvas wrapper for axis label positioning */
.canvas-wrapper {
    position: relative;
    flex: 0 0 60%;
    /* Takes 60% of visualization-container height */
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#clusterViz {
    position: relative;
    z-index: 1;
    display: block;
    cursor: default;
    width: 100%;
    min-width: 250px;
    flex: 1;
    /* Fill the canvas wrapper */
    min-height: 0;
}

/* UMAP Axis Labels */
.axis-label {
    position: absolute;
    font-size: 14px;
    font-weight: 500;
    color: rgba(203, 213, 225, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 5;
    display: flex;
    align-items: center;
}

body.light-mode .axis-label {
    color: rgba(15, 23, 42, 0.6);
}

.axis-text {
    white-space: nowrap;
    margin-top: 0px;
}

.axis-arrow {
    color: inherit;
}

.axis-arrow-x {
    width: 55px;
    height: 12px;
}

.axis-arrow-y {
    width: 12px;
    height: 55px;
}

.axis-label-x {
    bottom: 5px;
    left: 8px;
    flex-direction: column;
    align-items: center;
    gap: 0px;
}

.axis-label-y {
    bottom: 24px;
    left: -14px;
    padding: 0px;
    flex-direction: row;
    align-items: center;
    gap: 0px;
}

.axis-label-y .axis-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

#clusterViz:hover {
    filter: none;
}

.cluster-info {
    display: none;
}

.cluster-label {
    position: absolute;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
    pointer-events: auto;
    cursor: default;
    opacity: 0.8;
    transition: opacity 0.5s ease;
    white-space: nowrap;
    z-index: 10;
}

/* ============================================
   CONTENT AREA
   ============================================ */

.content-area {
    position: static;
    /* Override absolute positioning */
    width: 100%;
    height: auto;
    transform: none;
    padding: 0;
}

.content-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 40px 40px;
    opacity: 0;
    transform: scale(0.95) translateY(20px);
    pointer-events: none;
    transition: var(--transition-smooth);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.content-section::-webkit-scrollbar {
    width: 6px;
}

.content-section::-webkit-scrollbar-track {
    background: transparent;
}

.content-section::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.content-section::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Scree Plot Styles */
.scree-plot-container {
    position: relative;
    width: 100%;
    background-color: var(--dark-bg);
    padding: 0px;
    margin: 0px;
    overflow: hidden;
}

/* Shared h2 styles for chart sections */
.charts-section h2 {
    margin: 0;
    padding: 0.25rem 0;
    font-size: 1rem;
    text-align: center;
    color: var(--text-primary);
    width: 100%;
    flex-shrink: 0;
    /* Don't shrink below content size */
}

.scree-plot-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 100%;
    margin-bottom: 20px;
}

#screePlotCanvas {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    /* Changed to 100% to fill its parent .scree-plot-container */
    display: block;
    background-color: var(--dark-bg);
    /*border: 1px solid var(--border-color);
    border-radius: 8px;*/
}

/* Right column wrapper - stacks sections vertically */
.right-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    min-height: 0;
    /* Allows flex children to shrink below content size */
}

/* 1. Parent Wrapper */
.details-row-wrapper {
    display: flex;
    flex-direction: row;
    width: 100%;
    flex: 0 0 55%;
    min-height: 0;
    /* Allows flex children to shrink below content size */
    overflow: hidden;

    /* Remove conflicting borders/colors if desired */
    /* border: 2px red solid; */
    background-color: var(--dark-bg);
    gap: 1.25rem;
}

/* 2. LEFT COLUMN (The Section Wrapper) */
/* Target the class names explicitly used in your HTML */
.details-row-wrapper .visualization-container-right {
    /* FLEX RULES */
    flex: 0 0 55%;
    /* Rigid 70% width */
    max-width: 70%;
    /* Hard limit */
    min-width: 0;
    /* Prevents content from forcing it wider */

    /* Layout for inner content */
    display: flex;
    flex-direction: column;
    height: 100%;

    /* Visuals */
    /* border: 2px yellow solid;  */
    padding: 0;
    margin: 0;
}

/* 3. RIGHT COLUMN (The Section Wrapper) */
.details-row-wrapper .image-container-right {
    position: relative;
    /* FLEX RULES */
    flex: 0 0 40%;
    /* Rigid 30% width */
    max-width: 40%;
    /* Hard limit */
    min-width: 0;
    /* Prevents content from forcing it wider */

    /* Layout for inner content */
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;

    /* Visuals */
    /* border: 2px blue solid; */
    padding: 0;
    margin: 0;
}

/* 4. INNER CONTENT (The actual details boxes) */
/* Make them fill their parent sections completely */
.details-container,
.details-image-container {
    flex: 1;
    /* Grow to fill remaining vertical space below the <h1> */
    width: 100%;
    /* Fill horizontal width */
    height: 100%;
    /* Ensure it takes available height */
    overflow: hidden;
    /* Handle spillover */
    position: relative;

}

/* Details Content - HTML-based selectable text */
.details-content {
    width: 100%;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    user-select: text;
    /* Container for the dynamic scaling of child elements */
    container-type: size;
}

.details-content h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.details-content h4 {
    margin: 15px 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.details-content .section-label {
    display: inline-block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.details-content .details-company {
    font-style: italic;
    color: var(--text-secondary);
    margin: 10px 0 15px 0;
}

.details-content .details-keywords {
    font-weight: 600;
    color: var(--text-secondary);
    margin: 10px 0 15px 0;
    word-break: break-word;
}

.details-content .details-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-secondary);
    font-size: 14px;
}

.details-content a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
}

.details-content a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.details-placeholder {
    text-align: center;
    color: var(--text-secondary);
    margin: 0;
    padding-top: 20%;
}

/* Charts section in right column - displays D and E side by side */
.charts-section {
    display: flex;
    flex-direction: row;
    height: 100%;
    min-height: 500px;
    width: 100%;
    gap: 1rem;
    flex: 1;
    /* Takes remaining space */
    min-height: 0;
    /* Allows flex children to shrink below content size */
    overflow: visible;
}

.charts-section .scree-plot-container,
.charts-section .feature-loadings-container {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg);
    padding: 0px;
    margin: 0px;
    margin-top: 15px;
    margin-bottom: 10px;
    margin-right: 5px;
    overflow: visible;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 5. CANVAS FIX */
/* Ensure the canvas doesn't break the layout */
#detailsPlotCanvas,
#detailsImagePlotCanvas,
#screePlotCanvas,
#featureLoadingsCanvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Feature Loadings Container */
.feature-loadings-container {
    position: relative;
    width: 100%;
    flex: 0 1 50%;
    background-color: var(--dark-bg);
    padding: 0px;
    margin: 0px;
    overflow: visible;
}

.feature-loadings-container h2 {
    margin-top: 0;
    font-size: 1.2rem;
    text-align: center;
    color: var(--text-primary);
    width: 100%;
}

/* i've since removed the header but keeping here for future changes */
/* .details-container h2 {
    margin-top: 10px;
    font-size: 1.2rem;
    text-align: center;
    color: var(--text-primary);
    width: 100%;
} */

.details-info {
    font-size: 1.0rem;
    color: var(--text-secondary);
    min-width: 100%;
    margin-bottom: 20px;
}




/* ============================================
   CONTROL PANEL - HYPERPARAMETER ADJUSTMENT
   ============================================ */

.control-panel {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    /* Allows panel to dynamically claim needed space */
    background-color: var(--dark-bg);
    padding-top: 0.5rem;
    overflow: visible;
    /* Must remain visible so tooltips aren't clipped */
    min-height: 0;
    /* Let flex shrink properly */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Control panel title */
.control-panel h2 {
    margin: 0;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Panel content layout */
.panel-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0rem;
}

.panel-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    border-bottom: none;
    background: transparent;
    width: 100%;
}

.panel-label {
    position: absolute;
    top: -5px;
    left: -5px;
    margin: 0;
    padding: 5px;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 24px;
    line-height: 1;
    z-index: 10;
    /* Ensures it stays above the canvas */
    color: var(--text-primary);
}

.control-panel.expanded .panel-header {
    justify-content: space-between;
    padding: 0px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

.panel-header h3 {
    display: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-primary);
    margin: 0;
}

.control-panel.expanded .panel-header h3 {
    display: block;
}

.panel-toggle {
    font-size: 14px;
    cursor: pointer;
    padding: 4px 16px;
    border-radius: 0px;
    border: 0px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-weight: 600;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.panel-toggle:hover {
    opacity: 0.8;
}

.control-panel.expanded .panel-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    box-shadow: none;
    padding: 4px 8px;
    font-weight: 500;
}

.control-panel.expanded .panel-toggle:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    border-color: transparent;
}

.panel-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.25rem;
    padding: 0;
    overflow-y: auto;
    /* Restored for panel scrolling */
    /* Makes the sliders sub-panel natively scrollable */
    /* overflow-x: hidden; */
    min-height: 0;
    /* Essential for grid nested in flex */
}

.control-group {
    margin-bottom: 0px;
}

.control-group label {
    display: block;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.slider,
input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #3e356b 0%, #357ba2 33%, #49c1ad 66%, #def5e5 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    border: none;
    padding: 0;
}

.slider::-webkit-slider-thumb,
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 0 8px rgba(73, 193, 173, 0.5);
    border: 1px solid #def5e5;
    transition: transform 0.1s ease;
}

.slider::-webkit-slider-thumb:hover,
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.slider::-moz-range-thumb,
input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: 1px solid #def5e5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 0 8px rgba(73, 193, 173, 0.5);
    transition: transform 0.1s ease;
}

.slider::-moz-range-thumb:hover,
input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.value-display {
    min-width: 45px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}

/* Tooltip styling (Lifted from flappy.html) */
.param-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 4px;
    color: var(--text-primary);
    background: var(--dark-bg);
    border-radius: 50%;
    width: 14px;
    height: 14px;
    text-align: center;
    line-height: 14px;
    font-size: 10px;
    font-weight: bold;
    cursor: help;
    border: 1px solid var(--text-primary);
    z-index: 100;
}

.param-tooltip .tooltip-text {
    visibility: hidden;
    width: 280px;
    max-width: calc(100vw - 60px);
    /* Relative to main container (viewport) */
    background-color: var(--card-bg);
    color: var(--text-primary);
    text-align: left;
    border-radius: 6px;
    padding: 12px;
    position: fixed;
    z-index: 10000;
    top: 180%;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    font-size: 0.75rem;
    font-weight: normal;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: auto;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: normal;
}

/* Invisible bridge to prevent hover loss between icon and tooltip */
.param-tooltip::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 15px;
    z-index: 9998;
}

.param-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent var(--border-color) transparent;
}

.param-tooltip:hover .tooltip-text,
.param-tooltip .tooltip-text:hover {
    visibility: visible;
    opacity: 1;
}

.param-tooltip.tooltip-left .tooltip-text {
    left: auto;
    right: -5px;
    transform: none;
}

.param-tooltip.tooltip-left .tooltip-text::after {
    left: auto;
    right: 12px;
    transform: none;
}

.status-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 6px;
    font-size: 12px;
    color: #10b981;
    margin-bottom: 12px;
    font-weight: 500;
}

/* Toggle Button Group */
.toggle-group {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

/* Button Glowing Border Animation (from Flappy) */
@keyframes spinShadow {
    0% {
        box-shadow: 0 -4px 15px rgba(73, 193, 173, 0.6), 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    25% {
        box-shadow: 4px 0 15px rgba(53, 123, 162, 0.6), 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    50% {
        box-shadow: 0 4px 15px rgba(73, 193, 173, 0.6), 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    75% {
        box-shadow: -4px 0 15px rgba(53, 123, 162, 0.6), 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    100% {
        box-shadow: 0 -4px 15px rgba(73, 193, 173, 0.6), 0 4px 6px rgba(0, 0, 0, 0.1);
    }
}

@keyframes spinShadowHover {
    0% {
        box-shadow: 0 -6px 20px rgba(73, 193, 173, 0.8), 0 8px 15px rgba(0, 0, 0, 0.2);
    }

    25% {
        box-shadow: 6px 0 20px rgba(53, 123, 162, 0.8), 0 8px 15px rgba(0, 0, 0, 0.2);
    }

    50% {
        box-shadow: 0 6px 20px rgba(73, 193, 173, 0.8), 0 8px 15px rgba(0, 0, 0, 0.2);
    }

    75% {
        box-shadow: -6px 0 20px rgba(53, 123, 162, 0.8), 0 8px 15px rgba(0, 0, 0, 0.2);
    }

    100% {
        box-shadow: 0 -6px 20px rgba(73, 193, 173, 0.8), 0 8px 15px rgba(0, 0, 0, 0.2);
    }
}

.toggle-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: linear-gradient(135deg, rgba(73, 193, 173, 0.3), rgba(53, 123, 162, 0.3));
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s, color 0.3s;
}

.toggle-btn:hover {
    background: linear-gradient(135deg, rgba(73, 193, 173, 0.6), rgba(53, 123, 162, 0.6));
    color: white;
    transform: translateY(-3px) scale(1.02);
    animation: spinShadowHover 3s linear infinite;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #49c1ad, #357ba2);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toggle-btn.active:hover {
    transform: translateY(-3px) scale(1.02);
    animation: spinShadowHover 3s linear infinite;
}

.toggle-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: none;
}

.method-info {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 6px;
    padding-left: 2px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

.status-dot.live {
    animation: pulse-live 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes pulse-live {

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

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

.refresh-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary-color), #3b82f6);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.refresh-btn:active {
    transform: translateY(0);
}

/* Control Panel Collapse Animation */


/* Responsive: Hide on small screens */
@media (max-width: 1024px) {
    .control-panel {
        top: 20px;
    }

    .main-layout {
        flex-direction: column;
        /* Stack columns on smaller screens */
    }

    .visualization-container {
        flex: 0 0 50vh;
        /* Give it a fixed height */
    }

    .visualization-container-right {
        flex: 0 0 50vh;
        /* Give it a fixed height */
    }

    .main-content-container {
        overflow-y: auto;
    }
}

@media (max-width: 768px) {
    .controls.expanded {
        width: 95vw;
        max-width: 400px;
    }
}

.content-section.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    z-index: 50;
}

.section-close {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 10;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.section-close:hover {
    opacity: 1;
}

.section-close::before,
.section-close::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-secondary);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 1px;
}

.section-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.section-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.section-content {
    max-width: 700px;
    width: 100%;
}

.section-content h1 {
    font-size: 42px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    letter-spacing: -1px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.content-text {
    line-height: 1.8;
    font-size: 16px;
    color: var(--text-secondary);
}

.content-text p {
    margin-bottom: 20px;
}

/* ============================================
   EXPERIENCE ITEMS
   ============================================ */

.experience-item,
.project-item {
    margin-bottom: 40px;
    padding: 25px;
    background: rgba(51, 65, 85, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition-smooth);
    cursor: pointer;
    border-left: 4px solid transparent;
}

.experience-item:hover,
.project-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
    border-left-color: var(--secondary-color);
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.experience-item h3,
.project-item h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.experience-item .meta,
.project-item .meta {
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
}

.experience-item p,
.project-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   CONTACT LINKS
   ============================================ */

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
}

.contact-link {
    padding: 10px 25px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition-smooth);
    display: inline-block;
    box-shadow: var(--shadow-sm);
    border: none;
    cursor: pointer;
}

.contact-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
}

.contact-link:active {
    transform: translateY(-1px);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .section-content h1 {
        font-size: 32px;
    }

    .content-section {
        padding: 30px 30px 30px;
    }
}

@media (max-width: 768px) {

    .section-content h1 {
        font-size: 28px;
        margin-bottom: 20px;
    }

    .content-section {
        padding: 20px 20px 20px;
    }

    .section-close {
        top: 20px;
        right: 20px;
    }

    .experience-item,
    .project-item {
        padding: 20px;
        margin-bottom: 25px;
    }

    .content-text {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .section-content h1 {
        font-size: 24px;
    }

    .content-section {
        padding: 15px 15px 15px;
    }

    .experience-item h3,
    .project-item h3 {
        font-size: 16px;
    }

    .contact-links {
        gap: 10px;
    }

    .contact-link {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes glowPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.3));
    }

    50% {
        filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.6));
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section.active .section-content {
    animation: slideIn 0.6s ease-out;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}