/* Oligodendrosite Main CSS */

/* Base Styles - Light Theme */
:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #6366f1;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --transition-speed: 300ms;

    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-tertiary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --input-bg: #ffffff;
    --hover-bg: #f3f4f6;
}

/* Dark Theme Colors */
[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #e5e7eb;
    --text-tertiary: #9ca3af;
    --border-color: #4b5563;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --card-bg: #1f2937;
    --input-bg: #374151;
    --hover-bg: #374151;
}

/* Global Theme Application */
body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Card and Container Theming */
.bg-white {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

.bg-gray-50 {
    background-color: var(--bg-secondary) !important;
}

.bg-gray-100 {
    background-color: var(--bg-tertiary) !important;
}

/* Colored background fixes for dark mode */
.bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

[data-theme="dark"] .bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.2) !important;
}

.bg-purple-50 {
    background-color: rgba(147, 51, 234, 0.1) !important;
}

[data-theme="dark"] .bg-purple-50 {
    background-color: rgba(147, 51, 234, 0.2) !important;
}

.bg-orange-50 {
    background-color: rgba(249, 115, 22, 0.1) !important;
}

[data-theme="dark"] .bg-orange-50 {
    background-color: rgba(249, 115, 22, 0.2) !important;
}

.bg-yellow-50 {
    background-color: rgba(245, 158, 11, 0.1) !important;
}

[data-theme="dark"] .bg-yellow-50 {
    background-color: rgba(245, 158, 11, 0.2) !important;
}

.bg-red-50 {
    background-color: rgba(239, 68, 68, 0.1) !important;
}

[data-theme="dark"] .bg-red-50 {
    background-color: rgba(239, 68, 68, 0.2) !important;
}

.bg-green-50 {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

[data-theme="dark"] .bg-green-50 {
    background-color: rgba(16, 185, 129, 0.2) !important;
}

/* Additional colored background classes for comprehensive dark mode support */
.bg-indigo-50 {
    background-color: rgba(99, 102, 241, 0.1) !important;
}

[data-theme="dark"] .bg-indigo-50 {
    background-color: rgba(99, 102, 241, 0.2) !important;
}

.bg-pink-50 {
    background-color: rgba(236, 72, 153, 0.1) !important;
}

[data-theme="dark"] .bg-pink-50 {
    background-color: rgba(236, 72, 153, 0.2) !important;
}

.bg-teal-50 {
    background-color: rgba(20, 184, 166, 0.1) !important;
}

[data-theme="dark"] .bg-teal-50 {
    background-color: rgba(20, 184, 166, 0.2) !important;
}

/* Additional colored background classes for cranial nerves and other sections */
.bg-cyan-50 {
    background-color: rgba(6, 182, 212, 0.1) !important;
}

[data-theme="dark"] .bg-cyan-50 {
    background-color: rgba(6, 182, 212, 0.2) !important;
}

.bg-lime-50 {
    background-color: rgba(132, 204, 22, 0.1) !important;
}

[data-theme="dark"] .bg-lime-50 {
    background-color: rgba(132, 204, 22, 0.2) !important;
}

.bg-violet-50 {
    background-color: rgba(139, 92, 246, 0.1) !important;
}

[data-theme="dark"] .bg-violet-50 {
    background-color: rgba(139, 92, 246, 0.2) !important;
}

.bg-emerald-50 {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

[data-theme="dark"] .bg-emerald-50 {
    background-color: rgba(16, 185, 129, 0.2) !important;
}

.bg-amber-50 {
    background-color: rgba(245, 158, 11, 0.1) !important;
}

[data-theme="dark"] .bg-amber-50 {
    background-color: rgba(245, 158, 11, 0.2) !important;
}

.bg-rose-50 {
    background-color: rgba(244, 63, 94, 0.1) !important;
}

[data-theme="dark"] .bg-rose-50 {
    background-color: rgba(244, 63, 94, 0.2) !important;
}

.bg-sky-50 {
    background-color: rgba(14, 165, 233, 0.1) !important;
}

[data-theme="dark"] .bg-sky-50 {
    background-color: rgba(14, 165, 233, 0.2) !important;
}

.bg-slate-50 {
    background-color: rgba(100, 116, 139, 0.1) !important;
}

[data-theme="dark"] .bg-slate-50 {
    background-color: rgba(100, 116, 139, 0.2) !important;
}

/* Text Color Utilities */
.text-gray-800 {
    color: var(--text-primary) !important;
}

.text-gray-600 {
    color: var(--text-secondary) !important;
}

.text-gray-500 {
    color: var(--text-tertiary) !important;
}

/* Additional dark mode text fixes */
.text-gray-700 {
    color: var(--text-secondary) !important;
}

.text-gray-400 {
    color: var(--text-tertiary) !important;
}

.text-gray-300 {
    color: var(--text-secondary) !important;
}

.text-gray-900 {
    color: var(--text-primary) !important;
}

/* Ensure all text elements inherit proper colors */
p,
h1,
h2,
h3,
h4,
h5,
h6,
span,
div,
li,
td,
th {
    color: inherit;
}

/* Ensure text in colored backgrounds is always readable */
.bg-blue-50 p,
.bg-blue-50 h4,
.bg-blue-50 h5,
.bg-purple-50 p,
.bg-purple-50 h4,
.bg-purple-50 h5,
.bg-orange-50 p,
.bg-orange-50 h4,
.bg-orange-50 h5,
.bg-yellow-50 p,
.bg-yellow-50 h4,
.bg-yellow-50 h5,
.bg-red-50 p,
.bg-red-50 h4,
.bg-red-50 h5,
.bg-green-50 p,
.bg-green-50 h4,
.bg-green-50 h5,
.bg-indigo-50 p,
.bg-indigo-50 h4,
.bg-indigo-50 h5,
.bg-pink-50 p,
.bg-pink-50 h4,
.bg-pink-50 h5,
.bg-teal-50 p,
.bg-teal-50 h4,
.bg-teal-50 h5,
.bg-gray-50 p,
.bg-gray-50 h4,
.bg-gray-50 h5,
.bg-cyan-50 p,
.bg-cyan-50 h4,
.bg-cyan-50 h5,
.bg-lime-50 p,
.bg-lime-50 h4,
.bg-lime-50 h5,
.bg-violet-50 p,
.bg-violet-50 h4,
.bg-violet-50 h5,
.bg-emerald-50 p,
.bg-emerald-50 h4,
.bg-emerald-50 h5,
.bg-amber-50 p,
.bg-amber-50 h4,
.bg-amber-50 h5,
.bg-rose-50 p,
.bg-rose-50 h4,
.bg-rose-50 h5,
.bg-sky-50 p,
.bg-sky-50 h4,
.bg-sky-50 h5,
.bg-slate-50 p,
.bg-slate-50 h4,
.bg-slate-50 h5 {
    color: var(--text-primary) !important;
}

/* Fix specific elements that might disappear in dark mode */
.hero-gradient h1,
.hero-gradient h2,
.hero-gradient p {
    color: white !important;
}

.chapter-card h3,
.chapter-card h4,
.chapter-card p {
    color: white !important;
    /* White text for all chapter card content */
}

/* Override Tailwind text color classes in colored backgrounds for dark mode */
/* Using higher specificity and multiple selectors to ensure override */
[data-theme="dark"] .bg-cyan-50 h4.text-cyan-700,
[data-theme="dark"] .bg-cyan-50 .text-cyan-700,
[data-theme="dark"] .bg-lime-50 h4.text-lime-700,
[data-theme="dark"] .bg-lime-50 .text-lime-700,
[data-theme="dark"] .bg-blue-50 h4.text-blue-700,
[data-theme="dark"] .bg-blue-50 .text-blue-700,
[data-theme="dark"] .bg-purple-50 h4.text-purple-700,
[data-theme="dark"] .bg-purple-50 .text-purple-700,
[data-theme="dark"] .bg-orange-50 h4.text-orange-700,
[data-theme="dark"] .bg-orange-50 .text-orange-700,
[data-theme="dark"] .bg-yellow-50 h4.text-yellow-700,
[data-theme="dark"] .bg-yellow-50 .text-yellow-700,
[data-theme="dark"] .bg-red-50 h4.text-red-700,
[data-theme="dark"] .bg-red-50 .text-red-700,
[data-theme="dark"] .bg-green-50 h4.text-green-700,
[data-theme="dark"] .bg-green-50 .text-green-700,
[data-theme="dark"] .bg-indigo-50 h4.text-indigo-700,
[data-theme="dark"] .bg-indigo-50 .text-indigo-700,
[data-theme="dark"] .bg-pink-50 h4.text-pink-700,
[data-theme="dark"] .bg-pink-50 .text-pink-700,
[data-theme="dark"] .bg-teal-50 h4.text-teal-700,
[data-theme="dark"] .bg-teal-50 .text-teal-700,
[data-theme="dark"] .bg-gray-50 h4.text-gray-700,
[data-theme="dark"] .bg-gray-50 .text-gray-700,
[data-theme="dark"] .bg-violet-50 h4.text-violet-700,
[data-theme="dark"] .bg-violet-50 .text-violet-700,
[data-theme="dark"] .bg-emerald-50 h4.text-emerald-700,
[data-theme="dark"] .bg-emerald-50 .text-emerald-700,
[data-theme="dark"] .bg-amber-50 h4.text-amber-700,
[data-theme="dark"] .bg-amber-50 .text-amber-700,
[data-theme="dark"] .bg-rose-50 h4.text-rose-700,
[data-theme="dark"] .bg-rose-50 .text-rose-700,
[data-theme="dark"] .bg-sky-50 h4.text-sky-700,
[data-theme="dark"] .bg-sky-50 .text-sky-700,
[data-theme="dark"] .bg-slate-50 h4.text-slate-700,
[data-theme="dark"] .bg-slate-50 .text-slate-700 {
    color: var(--text-primary) !important;
}

/* Specific high-priority fixes for CN XI and CN XII */
[data-theme="dark"] .bg-cyan-50 h4.font-semibold.text-cyan-700 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .bg-lime-50 h4.font-semibold.text-lime-700 {
    color: var(--text-primary) !important;
}

/* Emergency fallback with absolute color values for CN XI and CN XII */
[data-theme="dark"] .bg-cyan-50 h4 {
    color: #1f2937 !important;
    /* Dark gray for readability */
}

[data-theme="dark"] .bg-lime-50 h4 {
    color: #1f2937 !important;
    /* Dark gray for readability */
}

/* Ultra-high specificity rules to override Tailwind CDN */
html[data-theme="dark"] body main div div div.bg-cyan-50 h4.text-cyan-700,
html[data-theme="dark"] body main div div div.bg-lime-50 h4.text-lime-700,
html[data-theme="dark"] body main.container div div div.bg-cyan-50 h4.text-cyan-700,
html[data-theme="dark"] body main.container div div div.bg-lime-50 h4.text-lime-700 {
    color: #1f2937 !important;
    background-color: transparent !important;
    text-shadow: none !important;
}

/* Use CSS attribute selectors to target class combinations */
html[data-theme="dark"] [class*="bg-cyan-50"][class*="text-cyan-700"],
html[data-theme="dark"] [class*="bg-lime-50"][class*="text-lime-700"] {
    color: #1f2937 !important;
}

/* Target all h4 elements within specific background classes in dark mode */
html[data-theme="dark"] .bg-cyan-50 h4,
html[data-theme="dark"] .bg-lime-50 h4 {
    color: #1f2937 !important;
    font-weight: 600 !important;
}

/* Force override using exact Tailwind class combinations */
html[data-theme="dark"] .bg-cyan-50.p-4.border.border-cyan-200.rounded-lg h4.font-semibold.text-cyan-700,
html[data-theme="dark"] .bg-lime-50.p-4.border.border-lime-200.rounded-lg h4.font-semibold.text-lime-700 {
    color: #1f2937 !important;
}

/* Mobile responsiveness for canvases and charts */
@media (max-width: 768px) {
    .chart-container {
        padding: 0.5rem;
        margin: 0.5rem 0;
    }

    canvas {
        max-width: 100% !important;
        height: auto !important;
    }

    .brain-model-container {
        height: 300px !important;
        min-height: 250px !important;
    }

    .tab-content {
        padding: 0.5rem;
    }

    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .text-4xl {
        font-size: 2rem !important;
    }

    .text-3xl {
        font-size: 1.5rem !important;
    }

    .p-6 {
        padding: 1rem !important;
    }

    .px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .py-6 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

/* Ensure canvas elements don't overflow */
canvas {
    max-width: 100%;
    height: auto;
}

/* Fix text overflow in small containers */
.overflow-hidden {
    overflow: hidden;
}

.text-ellipsis {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Better responsive tables */
@media (max-width: 640px) {
    table {
        font-size: 0.875rem;
    }

    th,
    td {
        padding: 0.5rem !important;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Ensure SVG elements are responsive */
svg {
    max-width: 100%;
    height: auto;
}

/* Fix for Three.js canvas responsiveness */
#brain-3d-container canvas {
    max-width: 100% !important;
    max-height: 500px !important;
}

/* Better spacing for mobile */
@media (max-width: 480px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .space-x-4>*+* {
        margin-left: 0.5rem !important;
    }

    .space-y-4>*+* {
        margin-top: 0.5rem !important;
    }

    .gap-4 {
        gap: 0.5rem !important;
    }

    .gap-6 {
        gap: 1rem !important;
    }
}

/* Enhanced Shadow System */
.shadow-md {
    box-shadow: 0 4px 6px -1px var(--shadow-color), 0 2px 4px -1px var(--shadow-color) !important;
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px var(--shadow-color), 0 4px 6px -2px var(--shadow-color) !important;
}

/* Input and Form Theming */
input,
select,
textarea {
    background-color: var(--input-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Tab Navigation */
.tab-content {
    display: none !important;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Tab Button Styles */
.tab-navigation {
    display: flex !important;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
}

.tab-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: #6b7280;
    text-decoration: none;
}

.tab-button:hover {
    background-color: #fef2f2;
    color: #dc2626;
}

.tab-button[aria-selected="true"] {
    background-color: #fef2f2;
    color: #dc2626;
    border-bottom: 2px solid #dc2626;
}

[data-theme="dark"] .tab-navigation {
    border-bottom-color: #4b5563;
}

[data-theme="dark"] .tab-button {
    color: #9ca3af;
}

[data-theme="dark"] .tab-button:hover {
    background-color: rgba(153, 27, 27, 0.3);
    color: #fca5a5;
}

[data-theme="dark"] .tab-button[aria-selected="true"] {
    background-color: rgba(153, 27, 27, 0.3);
    color: #fca5a5;
    border-bottom-color: #fca5a5;
}

/* Enhanced Visual Elements */
.hero-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.chapter-gradient {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.floating-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

.pulse-animation {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

/* ================================================================ */
/* Index Page Styles */
/* ================================================================ */

.hero-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.chapter-card {
    transition: all 0.3s ease;
    background: #4b5563;
    /* Grey background for both light and dark modes */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chapter-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    background: #374151;
    /* Darker grey on hover */
}

.feature-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dasharray 0.35s;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

/* ================================================================ */
/* Chapter 3: Neural Networks & Plasticity Styles */
/* ================================================================ */

.chart-container {
    position: relative;
    min-height: 250px;
    max-height: 400px;
    margin-bottom: 1rem;
}

.brain-model-container {
    position: relative;
    min-height: 350px;
    max-height: 500px;
    width: 100%;
    overflow: hidden;
}

.plane-indicator {
    position: absolute;
    border: 2px solid;
    pointer-events: none;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.direction-arrow {
    position: absolute;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.direction-arrow:hover {
    transform: scale(1.1);
}


#brain-section-display {
    max-width: 500px;
    max-height: 350px;
    margin: 0 auto;
    background: #000;
    border-radius: 0.5rem;
    overflow: hidden;
}

#brain-section-display canvas {
    display: block;
    margin: 0 auto;
    background: #000;
    border-radius: 0.5rem;
}

/* Ensure brain compass container has transparent background */
#brain-compass-container {
    background: transparent !important;
}

/* Fix for brain compass SVGs to ensure they are visible */
#brain-compass-container svg {
    background: transparent !important;
}

/* Ensure SVG elements are properly displayed */
.brain-view svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Force visibility of brain structures */
.brain-outline,
.corpus-callosum,
.cerebellum,
.brainstem,
.ventricle,
.gray-matter,
.frontal-lobe,
.occipital-lobe,
.central-structures {
    opacity: 1 !important;
    visibility: visible !important;
}

#sagittal-plane-illustration,
#coronal-plane-illustration,
#horizontal-plane-illustration {
    width: 300px !important;
    height: 200px !important;
    display: block;
    margin: 0 auto;
}


/* Enhanced Brain Compass Styles */
.brain-compass {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    min-height: 24rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0e7ff 50%, #f3f4f6 100%);
}

.brain-model-wrapper {
    position: relative;
    z-index: 2;
}

/* Fix for function tags in light mode */
.function-tag {
    color: #1f2937 !important;
    /* Dark text for light backgrounds */
    font-weight: 500;
}

/* Ensure region cards have good contrast in both modes */
.region-info-content h5 {
    color: #1f2937 !important;
    /* Dark text for light backgrounds */
}

/* Improve contrast for region cards in light mode */
.bg-gradient-to-r.from-purple-50.to-blue-50 {
    background: linear-gradient(to right, rgba(147, 51, 234, 0.2), rgba(59, 130, 246, 0.2)) !important;
}

/* Improve contrast for clinical information in light mode */
.bg-gradient-to-r.from-yellow-50.to-orange-50 {
    background: linear-gradient(to right, rgba(245, 158, 11, 0.2), rgba(249, 115, 22, 0.2)) !important;
}

/* Improve contrast for educational content in light mode */
.bg-blue-50,
.bg-green-50 {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

/* Ensure text in these sections is readable */
.bg-blue-50 .text-blue-600,
.bg-blue-50 .text-blue-800,
.bg-green-50 .text-green-600,
.bg-green-50 .text-green-800,
.bg-purple-50 .text-purple-600,
.bg-purple-50 .text-purple-800,
.bg-yellow-50 .text-yellow-600,
.bg-yellow-50 .text-yellow-800,
.bg-red-50 .text-red-600,
.bg-red-50 .text-red-800 {
    color: #1f2937 !important;
    /* Dark text for light backgrounds */
}

/* ================================================================ */
/* Chapter 4: Enhanced Simulator Styles */
/* ================================================================ */

/* Development Timeline Enhancements */
.dev-stage-btn {
    position: relative;
    overflow: hidden;
}

.dev-stage-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #ef4444;
    transition: width 0.3s ease;
}

.dev-stage-btn.active::after {
    width: 100%;
}

/* Development Canvas Enhancements */
#development-canvas {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease;
}

#development-canvas:hover {
    transform: scale(1.02);
}

/* Cross-Section Enhancements */
#cross-section-canvas {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

#cross-section-canvas:hover {
    border-color: #3b82f6;
}

/* Blood Supply System Enhancements */
.blood-supply-btn {
    position: relative;
    overflow: hidden;
}

.blood-supply-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.blood-supply-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Enhanced Vessel Styles */
.vessel-path {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vessel-path:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Quiz Enhancements */
.vessel-quiz-highlight {
    filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.8)) !important;
    animation: quiz-glow 2s infinite;
}

@keyframes quiz-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.6));
    }

    50% {
        filter: drop-shadow(0 0 16px rgba(34, 197, 94, 1));
    }
}

/* Pressure Simulation Styles */
.pressure-indicator {
    animation: pressure-pulse 1s infinite;
}

@keyframes pressure-pulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* Tooltip Enhancements */
.tooltip-medical {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    border: 1px solid #4b5563;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

.tooltip-medical::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: inherit;
    border: inherit;
    transform: rotate(45deg);
    border-top: none;
    border-left: none;
}

/* Interactive Elements */
.interactive-area {
    transition: all 0.3s ease;
    cursor: pointer;
}

.interactive-area:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Progress Indicators */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dasharray 0.3s ease;
}

/* Medical Imaging Styles */
.imaging-header {
    font-family: 'Courier New', monospace;
    background: rgba(0, 0, 0, 0.8);
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
}

.orientation-marker {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

/* Measurement Tools */
.measurement-line {
    stroke: #fbbf24;
    stroke-width: 2;
    stroke-dasharray: 5, 5;
    animation: dash 1s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: -10;
    }
}

.measurement-point {
    fill: #fbbf24;
    stroke: #f59e0b;
    stroke-width: 2;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6));
}

/* Enhanced Buttons */
.enhanced-btn {
    position: relative;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.enhanced-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.enhanced-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Loading States */
.loading-spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

/* Mobile Responsiveness Enhancements */
@media (max-width: 768px) {
    .blood-supply-btn {
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .blood-supply-btn .text-lg {
        font-size: 1rem;
    }

    .dev-stage-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    #development-canvas,
    #cross-section-canvas {
        height: 300px !important;
    }

    .vessel-path {
        stroke-width: 10 !important;
    }

    .vessel-label {
        font-size: 12px;
    }

    /* Touch-friendly interactions */
    .interactive-area {
        min-width: 44px;
        min-height: 44px;
    }

    /* Tooltip adjustments for mobile */
    .tooltip-medical {
        max-width: 280px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .grid.grid-cols-2.lg\\:grid-cols-6 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }

    .grid.grid-cols-1.lg\\:grid-cols-4 {
        grid-template-columns: 1fr !important;
    }

    /* Stack controls vertically on very small screens */
    .dev-stage-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }

    /* Simplify complex layouts */
    .bg-gradient-to-r {
        background: var(--bg-secondary) !important;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    #development-canvas,
    #cross-section-canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark Mode Enhancements */
[data-theme="dark"] .imaging-header {
    background: rgba(0, 0, 0, 0.9);
    color: #00ff88;
    text-shadow: 0 0 5px #00ff88;
}

[data-theme="dark"] .tooltip-medical {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-color: #334155;
}

[data-theme="dark"] .enhanced-btn {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .enhanced-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2);
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {

    .vessel-path,
    .blood-supply-btn,
    .dev-stage-btn,
    .interactive-area,
    #development-canvas,
    #cross-section-canvas {
        transition: none !important;
        animation: none !important;
    }

    .vessel-quiz-highlight {
        animation: none !important;
        filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.8)) !important;
    }
}

/* Focus Styles for Accessibility */
.blood-supply-btn:focus,
.dev-stage-btn:focus,
.plane-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .vessel-path {
        stroke-width: 12 !important;
        stroke: #000000 !important;
    }

    [data-theme="dark"] .vessel-path {
        stroke: #ffffff !important;
    }

    .blood-supply-btn,
    .dev-stage-btn {
        border: 2px solid currentColor;
    }
}

/* Chapter 4 Styles */
#brain-3d-container {
    min-height: 400px;
    position: relative;
}

.error-container {
    max-width: 100%;
    max-height: 100%;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vessel-path {
    transition: all 0.3s ease;
    cursor: pointer;
}

.vessel-path:hover {
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

.vessel-path:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.vessel-selected {
    animation: pulse-glow 2s infinite;
}

.stroke-affected {
    animation: stroke-pulse 1.5s infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.8));
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(239, 68, 68, 1));
    }
}

@keyframes stroke-pulse {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(127, 29, 29, 0.8));
    }

    50% {
        filter: drop-shadow(0 0 16px rgba(127, 29, 29, 1));
    }
}

.vessel-details h4 {
    border-bottom: 2px solid #dc2626;
    padding-bottom: 0.5rem;
}

.vessel-details h5 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vessel-details h5::before {
    content: "•";
    font-size: 1.2em;
    color: currentColor;
}

#flow-animations circle {
    filter: drop-shadow(0 0 4px currentColor);
}

.blood-supply-btn {
    transition: all 0.2s ease;
}

.blood-supply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .vessel-path {
        stroke-width: 6 !important;
    }

    #circle-of-willis-svg text {
        font-size: 14px;
    }

    .blood-supply-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .blood-supply-btn .text-lg {
        font-size: 1rem;
    }

    .tab-button span.sm\\:hidden {
        display: inline !important;
    }

    .tab-button span.hidden.sm\\:inline {
        display: none !important;
    }

    .brain-region-card {
        padding: 0.75rem;
    }

    .brain-region-card h5 {
        font-size: 1rem;
    }

    .function-tag {
        font-size: 0.6rem;
        padding: 0.125rem 0.375rem;
    }
}

@media (max-width: 480px) {
    .grid.grid-cols-2.lg\\:grid-cols-6 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .brain-region-card {
        flex-direction: column;
        text-align: center;
        padding: 0.5rem;
    }

    .brain-region-card .text-3xl {
        margin-bottom: 0.5rem;
    }

    #circle-of-willis-svg {
        width: 100%;
        height: auto;
        max-width: 400px;
    }
}

.brain-region-card {
    transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.04);
    border-width: 2px;
    border-style: solid;
    border-color: transparent;
    background: var(--tw-bg-opacity, 1) #fff;
}

.dark .brain-region-card {
    background: #18181b;
    border-color: transparent;
}

.brain-region-card:hover,
.brain-region-card:focus,
.brain-region-card:active {
    box-shadow: 0 4px 24px 0 rgba(239, 68, 68, 0.10), 0 1.5px 6px 0 rgba(0, 0, 0, 0.08);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.98) 80%, rgba(239, 68, 68, 0.04) 100%);
    border-color: #f87171;
}

.dark .brain-region-card:hover,
.dark .brain-region-card:focus,
.dark .brain-region-card:active {
    background: linear-gradient(90deg, rgba(24, 24, 27, 0.98) 80%, rgba(239, 68, 68, 0.08) 100%);
    border-color: #fca5a5;
}

.brain-region-card[aria-label="Parietal Lobe"]:hover,
.brain-region-card[aria-label="Parietal Lobe"]:focus {
    border-color: #22c55e;
}

.brain-region-card[aria-label="Temporal Lobe"]:hover,
.brain-region-card[aria-label="Temporal Lobe"]:focus {
    border-color: #a78bfa;
}

.brain-region-card[aria-label="Occipital Lobe"]:hover,
.brain-region-card[aria-label="Occipital Lobe"]:focus {
    border-color: #fde047;
}

.brain-region-card[aria-label="Cerebellum"]:hover,
.brain-region-card[aria-label="Cerebellum"]:focus {
    border-color: #14b8a6;
}

.brain-region-card[aria-label="Brainstem"]:hover,
.brain-region-card[aria-label="Brainstem"]:focus {
    border-color: #ef4444;
}

.brain-region-card[aria-label="Thalamus"]:hover,
.brain-region-card[aria-label="Thalamus"]:focus {
    border-color: #818cf8;
}

.function-tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 0.375rem;
    display: inline-block;
    line-height: 1.2;
    margin-bottom: 2px;
}

@media (max-width: 640px) {
    .brain-region-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .brain-region-card span.text-3xl {
        margin-bottom: 0.5rem;
    }
}

/* Essential Tab Functionality CSS */
/* Tab Content Display Control */
.tab-content {
    display: none !important;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.tab-content.active {
    display: block !important;
    opacity: 1;
}

/* Tab Button Styling */
.tab-button {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.tab-button[aria-selected="true"] {
    background-color: rgb(185 28 28) !important;
    color: white !important;
}

.tab-button[aria-selected="true"]:hover {
    background-color: rgb(153 27 27) !important;
}

.tab-button[aria-selected="false"] {
    background-color: transparent !important;
    color: rgb(107 114 128) !important;
}

.tab-button[aria-selected="false"]:hover {
    background-color: rgb(254 242 242) !important;
    color: rgb(220 38 38) !important;
}

/* Dark mode support for tabs */
.dark .tab-button[aria-selected="false"]:hover {
    background-color: rgb(127 29 29) !important;
    background-color: rgba(127, 29, 29, 0.2) !important;
}

/* Ensure tab navigation is visible */
.tab-navigation {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Debug helper - can remove later */
.tab-content {
    min-height: 200px;
}

/* Brain 3D Model Styles */
#brain-3d-container {
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    min-height: 500px;
}

/* Brain Region Card Highlighting */
[data-region] {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

[data-region].highlighted {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
}

[data-region].active {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(139, 92, 246, 0.4);
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(59, 130, 246, 0.1) 100%);
}

/* Brain Region Hover Effects */
[data-region]:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Region Info Panel */
.region-info-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 40px var(--shadow-color);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    z-index: 1000;
    display: none;
}

.region-info-panel .info-content h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.region-info-panel .info-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.region-info-panel .info-content button {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.region-info-panel .info-content button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* 2D Fallback Styles */
.brain-2d-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #0f1419 0%, #1a1f2e 100%);
    border-radius: 12px;
}

.brain-diagram {
    position: relative;
    width: 300px;
    height: 200px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 200"><path d="M50 100 Q150 50 250 100 Q200 150 100 130 Q75 115 50 100" fill="%23d4b5a0" stroke="%23999" stroke-width="2"/></svg>') center/contain no-repeat;
}

.region-labels .label {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.region-labels .label:hover {
    background: rgba(139, 92, 246, 0.9);
    color: white;
    transform: scale(1.05);
}

.region-labels .frontal {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.region-labels .parietal {
    top: 10px;
    right: 60px;
}

.region-labels .temporal {
    bottom: 60px;
    left: 20px;
}

.region-labels .occipital {
    top: 40px;
    right: 20px;
}

.region-labels .cerebellum {
    bottom: 20px;
    right: 50px;
}

.region-labels .brainstem {
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

/* Loading States */
.brain-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
}

.brain-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

/* Enhanced Card Animations */
.brain-region-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.brain-region-card:hover {
    animation: pulse 2s infinite;
}

@keyframes pulse {

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

    50% {
        transform: scale(1.02);
    }
}

/* Canvas Enhancements */
canvas {
    border-radius: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    #brain-3d-container {
        min-height: 400px;
    }

    .region-info-panel {
        width: 95%;
        padding: 1.5rem;
    }

    .brain-diagram {
        width: 250px;
        height: 160px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    [data-region].highlighted {
        border: 3px solid #8b5cf6;
        background: rgba(139, 92, 246, 0.2);
    }

    .region-info-panel {
        border: 2px solid var(--primary-color);
    }
}

/* Enhanced Neuron Interaction Animations */
@keyframes neuron-pulse {
    0% {
        filter: brightness(1);
    }
    100% {
        filter: brightness(1.1);
    }
}

@keyframes modal-slide-in {
    0% {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes tooltip-fade-in {
    0% {
        opacity: 0;
        transform: translateY(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Modal Styles */
#neuron-info-modal {
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#neuron-info-modal #modal-content {
    animation: modal-slide-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Neuron Part Enhanced Interactivity */
.neuron-part {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.neuron-part:hover {
    transform: scale(1.05);
    filter: brightness(1.2) drop-shadow(0 0 12px rgba(59, 130, 246, 0.8));
}

.neuron-part:active {
    transform: scale(1.08);
    filter: brightness(1.3) drop-shadow(0 0 15px rgba(59, 130, 246, 0.9));
}

/* Touch-friendly styles for mobile */
@media (max-width: 768px) {
    .neuron-part {
        stroke-width: 8 !important;
        min-width: 44px;
        min-height: 44px;
    }
    
    #neuron-info-modal #modal-content {
        margin: 1rem;
        max-height: 85vh;
        border-radius: 1rem;
    }
    
    #neuron-interaction-hint {
        font-size: 0.75rem;
        padding: 0.5rem 1rem;
    }
    
    /* Enhanced touch targets */
    .neuron-part circle {
        r: 15;
    }
    
    .neuron-part rect {
        min-width: 30px;
        min-height: 20px;
    }
}

/* Hover tooltip styles */
#neuron-hover-tooltip {
    animation: tooltip-fade-in 0.2s ease-out;
    z-index: 1000;
    white-space: nowrap;
}

/* Interactive hint animation */
#neuron-interaction-hint {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    transition: opacity 0.3s ease-out;
}

/* Enhanced button styles for modal */
#close-modal, #close-modal-btn {
    transition: all 0.2s ease;
}

#close-modal:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

#close-modal-btn:hover {
    background-color: rgb(37, 99, 235);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Gradient card animations */
.bg-gradient-to-r {
    transition: all 0.3s ease;
}

.bg-gradient-to-r:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Enhanced accessibility */
.neuron-part:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

.neuron-part:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Dark mode enhancements for modal */
[data-theme="dark"] #neuron-info-modal #modal-content {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] #neuron-hover-tooltip {
    background-color: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(8px);
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
    .neuron-part {
        stroke-width: 6 !important;
        stroke: #000000 !important;
    }
    
    [data-theme="dark"] .neuron-part {
        stroke: #ffffff !important;
    }
    
    #neuron-info-modal #modal-content {
        border: 2px solid currentColor;
    }
}

/* Enhanced Neuron Structure Cards */
.neuron-structure-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.neuron-structure-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.neuron-structure-card .expanded-content {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
}

.neuron-structure-card .expanded-content:not(.hidden) {
    opacity: 1;
}

.neuron-structure-card .expanded-content.hidden {
    max-height: 0;
    opacity: 0;
}

.neuron-structure-card .expansion-arrow {
    transition: transform 0.3s ease;
}

/* Card Active States */
.neuron-structure-card.active,
.neuron-structure-card:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Enhanced hover effects for cards */
.neuron-structure-card:hover .expansion-arrow {
    transform: scale(1.1);
}

/* Touch-friendly for mobile */
@media (max-width: 768px) {
    .neuron-structure-card {
        padding: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .neuron-structure-card .expanded-content {
        padding: 0.75rem 0;
    }
    
    .neuron-structure-card .w-10 {
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Small screens */
@media (max-width: 480px) {
    .neuron-structure-card .grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }
    
    .neuron-structure-card h4 {
        font-size: 1rem;
    }
    
    .neuron-structure-card p {
        font-size: 0.875rem;
    }
}

/* Smooth scroll behavior for card navigation */
html {
    scroll-behavior: smooth;
}

/* Enhanced focus states for accessibility */
.neuron-structure-card:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .neuron-part {
        animation: none !important;
    }
    
    #neuron-interaction-hint {
        animation: none !important;
    }
    
    .neuron-structure-card {
        transition: none !important;
    }
    
    .neuron-structure-card .expanded-content {
        transition: none !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Enhanced UX animations for neuron interactions */
@keyframes neuronPulse {
    0%, 100% { 
        filter: brightness(1) drop-shadow(0 0 8px rgba(59, 130, 246, 0.5));
    }
    50% { 
        filter: brightness(1.2) drop-shadow(0 0 16px rgba(59, 130, 246, 0.8));
    }
}

@keyframes neuronHighlight {
    0% { 
        transform: scale(1);
        filter: brightness(1);
    }
    100% { 
        transform: scale(1.02);
        filter: brightness(1.3) drop-shadow(0 0 15px rgba(59, 130, 246, 0.9));
    }
}

/* Improved card expansion animation */
.neuron-structure-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.neuron-structure-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Better focus states for accessibility */
.neuron-part:focus-visible,
.neuron-structure-card:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* Smooth phase transitions for action potential */
.phase-active {
    opacity: 1 !important;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Enhanced button interactions */
button:not(.tab-button):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
}

button:not(.tab-button):active {
    transform: translateY(0);
}