/* CSS Variables for Theming */
:root {
    --bg: #ffffff;
    --panel: #f8fafc;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --layer-bg: rgba(255, 255, 255, 0.9);
    --layer-border: #cbd5e1;
}

.dark {
    --bg: #0f172a;
    --panel: #1e293b;
    --border: #334155;
    --text: #f8fafc;
    --muted: #94a3b8;
    --layer-bg: rgba(30, 41, 59, 0.85);
    /* rgba slate-800 */
    --layer-border: #475569;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* 3D Scene Container */
.perspective-container {
    perspective: 1200px;
}

.scene {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    /* Default isometric view */
    transform: rotateX(60deg) rotateZ(-45deg);
    transition: transform 0.5s ease;
}

/* 3D Layers */
.a11y-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 320px;
    height: auto;
    /* Center the layer on its own coordinates */
    transform-origin: center center;
    background: var(--layer-bg);
    border: 2px solid var(--layer-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.dark .a11y-layer {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.a11y-layer:hover,
.a11y-layer.active {
    border-color: #14b8a6;
    /* brand-500 */
    box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.3), 0 25px 30px -5px rgba(0, 0, 0, 0.2);
}

.a11y-layer.active {
    background: rgba(20, 184, 166, 0.05);
}

/* Overlay specific styling */
.layer-overlay {
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px dashed var(--layer-border);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none !important;
}

.dark .layer-overlay {
    background: rgba(0, 0, 0, 0.5) !important;
}

.layer-overlay:hover,
.layer-overlay.active {
    border-color: #14b8a6;
}

/* UI Elements inside Layers (Mock representation) */
.mock-element {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
}

/* Connecting Links (Vertical lines down Z axis) - Optional CSS effect */
.scene::after {
    /* Hard to do universally without JS, we'll rely on translateZ positioning */
}

/* Background Pattern for Canvas */
.diagram-bg {
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Anatomy List Hover Link */
.anatomy-item {
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.anatomy-item:hover,
.anatomy-item.active {
    background: var(--bg);
    border-color: #14b8a6;
}