/* CSS Variables for Theme Support */
:root {
    /* Light Mode Colors */
    --bg: #edf1f7;
    --surface: #ffffff;
    --light-surface: #f7fafc;
    --text: #2d3748;
    --text-secondary: #4a5568;
    --border: #e2e8f0;
    
    /* Primary/Accent Colors */
    --primary-color: #4299e1;
    --primary-light: #63b3ed;
    --success-color: #48bb78;
    --success-hover: #38a169;
    
    /* Shadows */
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.15);
    
    /* Interactive Colors */
    --hover-bg: #edf2f7;
    --active-bg: #e0f7ff;
    
    /* Images/Icons */
    --image-filter: none;
}

/* Dark Mode Colors */
body.dark-mode {
    --bg: #1a202c;
    --surface: #2d3748;
    --light-surface: #4a5568;
    --text: #e2e8f0;
    --text-secondary: #a0aec0;
    --border: #4a5568;
    
    /* Primary/Accent Colors - adjusted for dark mode */
    --primary-color: #63b3ed;
    --primary-light: #90cdf4;
    --success-color: #68d391;
    --success-hover: #48bb78;
    
    /* Shadows */
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-dark: rgba(0, 0, 0, 0.4);
    
    /* Interactive Colors */
    --hover-bg: #4a5568;
    --active-bg: #2a4365;
    
    /* Images/Icons */
    --image-filter: invert(1);
}

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

body {
    font-family: Arial, sans-serif;
    overflow: hidden;
    background: var(--bg);
    transition: background 0.3s ease;
}

/* Navbar Styles */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 30px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    transition: background 0.3s, border-color 0.3s;
    box-shadow: 0 2px 4px var(--shadow);
}

.navbar-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Navbar logo styling with theme support */
.navbar-title img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: invert(1); /* Convert white to black for light mode */
    transition: filter 0.3s ease;
}

/* In dark mode, keep original white logo */
body.dark-mode .navbar-title img {
    filter: none; /* Keep white logo for dark mode */
}

.navbar-title h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.navbar-subtitle {
    font-size: 12px;
    color: var(--primary-color);
    text-transform: none;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--light-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px var(--shadow);
}

.theme-toggle:hover {
    background: var(--hover-bg);
    transform: scale(1.05);
    box-shadow: 0 4px 8px var(--shadow-dark);
}

/* App Layout - Three Column Grid */
.app-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 60px;
    height: calc(100vh - 70px);
    width: 100vw;
    margin-top: 70px;
    background: var(--bg);
    transition: grid-template-columns 0.3s ease, background 0.3s ease;
}

.app-layout:has(.icon-bar:hover) {
    grid-template-columns: 1fr 1fr 200px;
}

/* Icon Bar - Vertical Toolbar */
.icon-bar {
    background: var(--surface);
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left: 2px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    box-shadow: -2px 0 10px var(--shadow);
}

.icon-bar-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.icon-bar-label {
    font-size: 11px;
    font-weight: bold;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-bottom: 3px;
    opacity: 0;
    transition: opacity 0.3s ease;
    height: 0;
    overflow: hidden;
}

.icon-bar:hover .icon-bar-label {
    opacity: 1;
    height: auto;
}

.icon-bar-select {
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.icon-bar-select option {
    background: var(--surface);
    color: var(--text);
}

.icon-bar-select:hover {
    border-color: var(--primary-color);
    background: var(--light-surface);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.icon-bar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--light-surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    font-size: 13px;
    font-weight: 500;
}

.icon-bar:hover .icon-bar-btn {
    justify-content: flex-start;
}

.icon-bar-btn:hover {
    background: var(--hover-bg);
    border-color: var(--border);
    box-shadow: 0 2px 4px var(--shadow);
}

.icon-bar-btn.active {
    background: var(--success-color);
    border-color: var(--success-color);
    color: #ffffff;
}

.icon-bar-btn.active:hover {
    background: var(--success-hover);
    border-color: var(--success-hover);
}

.icon-bar-btn svg {
    flex-shrink: 0;
}

.icon-bar-text {
    white-space: nowrap;
    flex: 1;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.icon-bar:hover .icon-bar-text {
    opacity: 1;
    width: auto;
}

.icon-bar-3d {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.icon-bar-3d:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

/* Measure Tooltip */
.measure-tooltip {
    position: absolute;
    background: rgba(45, 55, 72, 0.95);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
    z-index: 2000;
    box-shadow: 0 2px 8px var(--shadow-dark);
    border: 1px solid var(--primary-color);
    transform: translateX(-50%);
    transition: background 0.3s ease, border-color 0.3s ease;
}

body.dark-mode .measure-tooltip {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--primary-color);
}

/* Measure Line Style */
.measure-line {
    stroke: var(--primary-color);
    stroke-width: 2;
    stroke-dasharray: 5, 5;
}

.map-container {
    position: relative;
    border-right: 2px solid var(--text-secondary);
    background: var(--bg);
}

.map-container:nth-child(2) {
    border-right: none;
}

.map {
    width: 100%;
    height: 100%;
}

.map-label {
    position: absolute;
    top: 80px;
    background: rgba(45, 55, 72, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s ease;
}

body.dark-mode .map-label {
    background: rgba(226, 232, 240, 0.9);
    color: var(--text);
    border: 1px solid var(--border);
}

#label1 {
    left: 10px;
}

#label2 {
    right: 10px;
}

/* Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(45, 55, 72, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-arrow:hover {
    background: rgba(74, 85, 104, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-arrow-left {
    left: 10px;
}

.nav-arrow-right {
    right: 10px;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(45, 55, 72, 0.95);
    color: #e2e8f0;
    padding: 20px 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
}

.loading::before {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #4299e1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.coronal-indicator {
    position: fixed;
    bottom: 20px;
    right: calc(60px + 20px);
    width: 150px;
    height: 150px;
    background: var(--surface);
    border: 2px solid var(--text-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-dark);
    z-index: 1500;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: right 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

body:has(.icon-bar:hover) .coronal-indicator {
    right: calc(200px + 20px);
}

.coronal-indicator img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.coronal-line {
    position: absolute;
    top: 0;
    left: 10%;
    width: 3px;
    height: 100%;
    background-color: rgba(255, 0, 0, 0.9);
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.8);
    z-index: 10;
    transition: left 0.1s ease;
    pointer-events: auto;
    cursor: grab;
}

.coronal-line:active {
    cursor: grabbing;
}

/* OpenLayers Zoom Controls */
#map1 .ol-zoom {
    top: 10px !important;
    left: 10px !important;
}

#map2 .ol-zoom {
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
}

/* Overview Map Control - Position above scale line */
.ol-overviewmap {
    bottom: 40px !important;
}

/* Scale Line Control - Keep at bottom */
.ol-scale-line {
    bottom: 5px !important;
}

/* Override OpenLayers overview map box styling to use red color and thicker border */
.ol-overviewmap-box {
    border: 2px dotted red !important;  /* Changed from default 1.5px black to 2px red */
}

/* Ensure overview map container has proper dimensions */
.ol-overviewmap-map {
    width: 150px !important;
    height: 150px !important;
}

/* Force overview map canvas to fill container and show full image */
.ol-overviewmap-map canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; /* Ensure full image is visible */
}

/* Custom class for overview map from reference */
.overviewmap-custom .ol-overviewmap-map {
    border: 1px solid #7b98bc;
}

/* Crosshair */
.crosshair {
    width: 30px;
    height: 30px;
    pointer-events: none;
}

.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background: #ff0000;
}

.crosshair::before {
    left: 50%;
    top: 0;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

.crosshair::after {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}

/* Heatmap Tooltip */
.heatmap-tooltip {
    background: rgba(45, 55, 72, 0.95);
    color: #e2e8f0;
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px var(--shadow-dark);
    font-size: 13px;
    pointer-events: none;
    white-space: nowrap;
    transition: background 0.3s ease, border-color 0.3s ease;
}

body.dark-mode .heatmap-tooltip {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.heatmap-tooltip div {
    margin: 3px 0;
}

.heatmap-tooltip strong {
    color: #4CAF50;
}

/* Cursor Preview Maps */
.cursor-preview {
    position: absolute;
    bottom: 10px;
    left: 220px;
    width: 200px;
    height: 200px;
    border: 2px solid var(--text-secondary);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1500;
    background: var(--surface);
    box-shadow: 0 4px 15px var(--shadow-dark);
    display: none;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.cursor-preview canvas {
    width: 100% !important;
    height: 100% !important;
}

.preview-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #e2e8f0;
    font-size: 12px;
    background: rgba(45, 55, 72, 0.9);
    padding: 8px 12px;
    border-radius: 4px;
    z-index: 2000;
    pointer-events: none;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode .preview-message {
    background: var(--surface);
    color: var(--text);
}

.preview-label {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: bold;
    background: rgba(45, 55, 72, 0.9);
    padding: 4px 10px;
    border-radius: 4px;
    z-index: 10;
    white-space: nowrap;
    transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode .preview-label {
    background: var(--surface);
    color: var(--text);
}

/* Thumbnail Popup Styles */
.thumbnail-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    overflow: auto;
}

.thumbnail-popup-content {
    background-color: var(--surface);
    margin: 1vh auto;
    padding: 1.5vh 2vw;
    width: 90vw;
    max-width: 1400px;
    height: auto;
    max-height: 96vh;
    border-radius: 0.5rem;
    position: relative;
    overflow: auto;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 20px var(--shadow-dark);
}

.thumbnail-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 3px solid var(--border);
    padding-bottom: 1rem;
    transition: border-color 0.3s ease;
}

.thumbnail-popup-header h2 {
    margin: 0;
    color: var(--text);
    font-size: 2rem;
    font-weight: normal;
    transition: color 0.3s ease;
}

.thumbnail-close-btn {
    background: none;
    border: none;
    font-size: 2.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 1.875rem;
    height: 1.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.thumbnail-close-btn:hover {
    color: var(--text);
}

.thumbnail-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: min(2.6rem, 3.3vh);
    padding: 9.5vh 2vw 2vh;
    justify-items: center;
    align-items: center;
    height: fit-content;
    overflow: visible;
    margin-top: 0;
}

.section-thumbnail-group {
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin: min(0.5rem, 1vw);
    perspective: 1000px;
    overflow: visible;
}

.section-thumbnail-group:hover {
    transform: scale(1.05);
    z-index: 100;
}

.thumbnail-images-container {
    position: relative;
    width: min(13rem, 22vh);
    min-height: min(11.5rem, 19vh);
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.4s ease;
    overflow: visible;
}

.thumbnail-img {
    position: absolute;
    width: min(6.5rem, 10.5vh);
    height: min(6.5rem, 10.5vh);
    object-fit: cover;
    border-radius: 0.375rem;
    background-color: #fff;
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out, filter 0.4s ease, opacity 0.4s ease;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

body.dark-mode .thumbnail-img {
    background-color: #fff; /* Keep white background to match white images */
    filter: brightness(0.9);
}

.thumbnail-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.thumbnail-nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

body.dark-mode .thumbnail-nav-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text);
}

body.dark-mode .thumbnail-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.thumbnail-nav-left {
    left: 0.625rem;
}

.thumbnail-nav-right {
    right: 0.625rem;
}

.thumbnail-page-indicator {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 1.125rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.section-thumbnail-label {
    position: absolute;
    bottom: min(5rem, 8vh);
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    font-size: 1.2rem;
    color: white;
    font-weight: 800;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 0.3rem 0.75rem;
    border-radius: 0.25rem;
    z-index: 50;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

body.dark-mode .section-thumbnail-label {
    background-color: rgba(255, 255, 255, 0.9);
    color: #1a202c; /* High contrast dark text on white background */
}

.thumbnail-stain-label {
    position: absolute;
    bottom: 0.125rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.625rem;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 0.125rem 0.375rem;
    border-radius: 0.125rem;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode .thumbnail-stain-label {
    background-color: rgba(255, 255, 255, 0.9);
    color: #1a202c; /* High contrast dark text on white background */
}

.thumbnail-error {
    /* Inherit ALL positioning and animation from .thumbnail-img */
    position: absolute;
    width: min(6.5rem, 10.5vh);
    height: min(6.5rem, 10.5vh);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    
    /* Text-specific styling */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f7fafc; /* Keep light background consistently */
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.375rem;
    box-shadow: 0 2px 8px var(--shadow);
    
    /* SAME transitions as .thumbnail-img */
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out, filter 0.4s ease, opacity 0.4s ease, background-color 0.3s ease, color 0.3s ease;
}

.thumbnail-skeleton {
    position: absolute;
    width: min(6.5rem, 10.5vh);
    height: min(6.5rem, 10.5vh);
    background: linear-gradient(90deg, var(--light-surface) 25%, var(--border) 50%, var(--light-surface) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 0.375rem;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

/* 3D Thumbnail Effects and Layout - RESTORED ORIGINAL BEHAVIOR */
.thumbnail-img.ihc, .thumbnail-error.ihc {
    z-index: 30;
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.1),
        0 8px 24px rgba(0, 0, 0, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.15);
}

.thumbnail-img.left-1, .thumbnail-skeleton.left-1, .thumbnail-error.left-1 {
    z-index: 20;
    width: min(6rem, 10vh);
    height: min(6rem, 10vh);
    transform: translate(-50%, -50%) translateZ(20px) rotateY(20deg) translateX(min(-42px, -4.2vh));
    transform-origin: center;
    box-shadow: 
        -4px 4px 16px rgba(0, 0, 0, 0.2),
        -2px 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.8;
}

.thumbnail-img.right-1, .thumbnail-skeleton.right-1, .thumbnail-error.right-1 {
    z-index: 20;
    width: min(6rem, 10vh);
    height: min(6rem, 10vh);
    transform: translate(-50%, -50%) translateZ(20px) rotateY(-20deg) translateX(min(42px, 4.2vh));
    transform-origin: center;
    box-shadow: 
        4px 4px 16px rgba(0, 0, 0, 0.2),
        2px 2px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.8;
}

.thumbnail-img.back, .thumbnail-skeleton.back, .thumbnail-error.back {
    z-index: 10;
    width: min(5.3rem, 9vh);
    height: min(5.3rem, 9vh);
    transform: translate(-50%, -50%) translateZ(0px) translateY(min(-36px, -3.6vh)) scale(0.92);
    opacity: 0.8;
    box-shadow: 
        0 2px 12px rgba(0, 0, 0, 0.15),
        0 1px 4px rgba(0, 0, 0, 0.1);
}

/* Hover Effects for 3D Thumbnails */
.section-thumbnail-group:hover .thumbnail-img.left-1,
.section-thumbnail-group:hover .thumbnail-skeleton.left-1,
.section-thumbnail-group:hover .thumbnail-error.left-1 {
    transform: translate(-50%, -50%) translateZ(20px) rotateY(25deg) translateX(min(-60px, -6vh));
    opacity: 1;
}

.section-thumbnail-group:hover .thumbnail-img.right-1,
.section-thumbnail-group:hover .thumbnail-skeleton.right-1,
.section-thumbnail-group:hover .thumbnail-error.right-1 {
    transform: translate(-50%, -50%) translateZ(20px) rotateY(-25deg) translateX(min(60px, 6vh));
    opacity: 1;
}

.section-thumbnail-group:hover .thumbnail-img.back,
.section-thumbnail-group:hover .thumbnail-skeleton.back,
.section-thumbnail-group:hover .thumbnail-error.back {
    transform: translate(-50%, -50%) translateZ(5px) translateY(min(-48px, -4.8vh)) scale(0.95);
    opacity: 1;
}

.section-thumbnail-group:hover .thumbnail-img.ihc,
.section-thumbnail-group:hover .thumbnail-skeleton.ihc,
.section-thumbnail-group:hover .thumbnail-error.ihc {
    transform: translate(-50%, -50%) translateZ(45px) scale(1.03);
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.1),
        0 12px 32px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Stain-specific filters for left-1 position */
.thumbnail-img.left-1.nisl, .thumbnail-skeleton.left-1.nisl, .thumbnail-error.left-1.nisl {
    filter: brightness(1.2) sepia(0.2) hue-rotate(180deg);
}

.thumbnail-img.left-1.ihc, .thumbnail-skeleton.left-1.ihc, .thumbnail-error.left-1.ihc {
    filter: brightness(1.1) sepia(0.1) hue-rotate(90deg);
}

.thumbnail-img.left-1.myel, .thumbnail-skeleton.left-1.myel, .thumbnail-error.left-1.myel {
    filter: brightness(1.05) sepia(0.05) hue-rotate(270deg);
}

.thumbnail-img.left-1.he, .thumbnail-skeleton.left-1.he, .thumbnail-error.left-1.he {
    filter: brightness(1.15) sepia(0.15) hue-rotate(45deg);
}

/* Stain-specific filters for right-1 position */
.thumbnail-img.right-1.nisl, .thumbnail-skeleton.right-1.nisl, .thumbnail-error.right-1.nisl {
    filter: brightness(1.2) sepia(0.2) hue-rotate(180deg);
}

.thumbnail-img.right-1.ihc, .thumbnail-skeleton.right-1.ihc, .thumbnail-error.right-1.ihc {
    filter: brightness(1.1) sepia(0.1) hue-rotate(90deg);
}

.thumbnail-img.right-1.myel, .thumbnail-skeleton.right-1.myel, .thumbnail-error.right-1.myel {
    filter: brightness(1.05) sepia(0.05) hue-rotate(270deg);
}

.thumbnail-img.right-1.he, .thumbnail-skeleton.right-1.he, .thumbnail-error.right-1.he {
    filter: brightness(1.15) sepia(0.15) hue-rotate(45deg);
}

/* Stain-specific filters for back position */
.thumbnail-img.back.nisl, .thumbnail-skeleton.back.nisl, .thumbnail-error.back.nisl {
    filter: brightness(0.8) sepia(0.1) hue-rotate(180deg);
}

.thumbnail-img.back.ihc, .thumbnail-skeleton.back.ihc, .thumbnail-error.back.ihc {
    filter: brightness(0.75) sepia(0.05) hue-rotate(90deg);
}

.thumbnail-img.back.myel, .thumbnail-skeleton.back.myel, .thumbnail-error.back.myel {
    filter: brightness(0.7) sepia(0.03) hue-rotate(270deg);
}

.thumbnail-img.back.he, .thumbnail-skeleton.back.he, .thumbnail-error.back.he {
    filter: brightness(0.85) sepia(0.08) hue-rotate(45deg);
}
