/* Root Design System Variables */
:root {
    --primary: #0f4c5c;           /* Sophisticated Clinical Teal/Oceanic Navy */
    --primary-hover: #0a333f;
    --primary-light: #f2f7f9;     /* Soft oceanic wash */
    
    --bg-primary: #fcfbfa;        /* Soft warm paper/stone tone - highly editorial */
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --border-color: #eaeaea;      /* Extra clean, thin light borders */
    
    --text-primary: #1a202c;      /* Professional readable off-black */
    --text-secondary: #4a5568;    /* Softer gray for clean body text */
    --text-muted: #718096;
    --text-inverse: #ffffff;
    
    --accent: #a08c6b;            /* Sophisticated muted gold/bronze */
    --accent-hover: #8c7859;
    
    /* Category Accent Colors - Shifted to muted, highly professional tones */
    --color-breast: #a27b72;       /* Warm rose-clay */
    --color-breast-light: #f9f6f5;
    
    --color-aesthetics: #4a7c8c;   /* Slate blue */
    --color-aesthetics-light: #f4f7f8;
    
    --color-body: #6b8f71;         /* Sage olive green */
    --color-body-light: #f5f8f6;
    
    --color-pediatric: #8a7a93;    /* Dusty amethyst */
    --color-pediatric-light: #f7f6f8;
    
    --color-tumors: #a08c6b;       /* Muted bronze-khaki */
    --color-tumors-light: #f9f8f6;

    /* UI feedback states */
    --success: #5f7a63;            /* Soft forest green */
    --success-light: #f5f7f5;
    --warning: #b28c83;            /* Soft clay red */
    --warning-light: #faf7f6;
    
    /* Typography */
    --font-hebrew: 'Assistant', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-english: 'Outfit', 'Inter', sans-serif;
    
    /* Shadows & Effects */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.03), 0 1px 4px rgba(0,0,0,0.02);
    --shadow-lg: 0 12px 30px rgba(0,0,0,0.05), 0 2px 10px rgba(0,0,0,0.03);
    --shadow-glow: 0 0 15px rgba(15, 76, 92, 0.12);
    
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    
    --header-height: 70px;
    --sidebar-width: 280px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables Override */
body.dark-mode {
    --bg-primary: #0f111a;         /* Ultra-premium dark slate */
    --bg-secondary: #161922;
    --bg-card: #161922;
    --border-color: #222735;
    
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f111a;

    --primary: #54b3c4;            /* Soft, highly readable dark mode teal */
    --primary-hover: #73c8d7;
    --primary-light: rgba(84, 179, 196, 0.1);
    
    --color-breast-light: rgba(162, 123, 114, 0.12);
    --color-aesthetics-light: rgba(74, 124, 140, 0.12);
    --color-body-light: rgba(107, 143, 113, 0.12);
    --color-pediatric-light: rgba(138, 122, 147, 0.12);
    --color-tumors-light: rgba(160, 140, 107, 0.12);

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.6);
    --shadow-lg: 0 12px 30px rgba(0,0,0,0.8);
    --shadow-glow: 0 0 15px rgba(84, 179, 196, 0.15);
}

/* Base Resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-hebrew);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

input, textarea, button {
    font-family: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Layout */
.app-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 100;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-area {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.logo-text h1 {
    font-size: 18.5px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.2px;
}

.logo-text span {
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.1px;
}

/* Global Search */
.search-bar-container {
    position: relative;
    width: 40%;
    max-width: 500px;
}

.search-bar-container input {
    width: 100%;
    padding: 10px 42px 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    transition: var(--transition-fast);
}

.search-bar-container input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}

.clear-btn {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 110;
}

.search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: var(--transition-fast);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--bg-primary);
}

.search-result-title {
    font-weight: 700;
    font-size: 15px;
}

.search-result-category {
    font-size: 11px;
    font-weight: bold;
    color: var(--primary);
    text-transform: uppercase;
}

.search-result-snippet {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-no-results {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.nav-action-btn:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.badge {
    background-color: var(--primary);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.theme-toggle-btn {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
    background-color: var(--border-color);
}

/* Layout Panels */
.app-layout {
    display: flex;
    flex: 1;
    margin-top: var(--header-height);
    max-width: 1400px;
    width: 100%;
    margin-right: auto;
    margin-left: auto;
}

.app-sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--header-height);
    right: max(0px, calc((100% - 1400px) / 2));
    bottom: 0;
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 24px;
    overflow-y: auto;
    z-index: 90;
    transition: background-color var(--transition-normal), border-color var(--transition-normal), right var(--transition-normal);
}

.app-main-content {
    flex: 1;
    margin-right: auto;
    margin-left: auto;
    max-width: 1200px;
    width: 100%;
    padding: 40px;
    min-height: calc(100vh - var(--header-height));
    transition: margin-right var(--transition-normal);
}

/* Sidebar Nav */
.sidebar-nav h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.category-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cat-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-md);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    border-right: 3px solid transparent;
}

.cat-link:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.cat-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-right-color: var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.cat-icon {
    font-size: 18px;
}

.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 24px 0;
}

.sidebar-footer-info {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* HOME VIEW */
.hero-section {
    text-align: center;
    padding: 50px 24px 70px;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

body.dark-mode .hero-section {
    background-color: var(--bg-card);
}

.hero-badge {
    display: inline-block;
    padding: 5px 14px;
    background-color: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(14, 91, 95, 0.15);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 0.3px;
}

.hero-section h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.25;
    letter-spacing: -0.3px;
}

.hero-subtitle {
    font-size: 15.5px;
    color: var(--text-secondary);
    max-width: 750px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero-search-wrapper {
    display: flex;
    max-width: 580px;
    margin: 0 auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

body.dark-mode .hero-search-wrapper {
    background-color: rgba(9, 13, 22, 0.6);
}

.hero-search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light), 0 4px 20px rgba(0, 0, 0, 0.03);
}

.hero-search-wrapper input {
    flex: 1;
    border: none;
    padding: 12px 18px;
    font-size: 15px;
    background-color: transparent;
    color: var(--text-primary);
}

.hero-search-wrapper input:focus {
    outline: none;
}

.hero-search-wrapper button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.hero-search-wrapper button:hover {
    background-color: var(--primary-hover);
}

/* Category Grid */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    position: relative;
    padding-right: 14px;
    letter-spacing: -0.2px;
}

.section-title::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background-color: var(--primary);
    border-radius: 2px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

@media (min-width: 1025px) {
    .categories-grid a:last-child {
        grid-column: span 2;
    }
}

.category-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
    cursor: pointer;
}

.category-card[data-category="breast"] { border-top-color: var(--color-breast); }
.category-card[data-category="aesthetics"] { border-top-color: var(--color-aesthetics); }
.category-card[data-category="body"] { border-top-color: var(--color-body); }
.category-card[data-category="pediatric"] { border-top-color: var(--color-pediatric); }
.category-card[data-category="tumors"] { border-top-color: var(--color-tumors); }

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03);
}
.category-card[data-category="breast"]:hover { border-color: var(--color-breast); }
.category-card[data-category="aesthetics"]:hover { border-color: var(--color-aesthetics); }
.category-card[data-category="body"]:hover { border-color: var(--color-body); }
.category-card[data-category="pediatric"]:hover { border-color: var(--color-pediatric); }
.category-card[data-category="tumors"]:hover { border-color: var(--color-tumors); }

.breast-color { background-color: var(--color-breast-light); color: var(--color-breast); }
.aesthetics-color { background-color: var(--color-aesthetics-light); color: var(--color-aesthetics); }
.body-color { background-color: var(--color-body-light); color: var(--color-body); }
.pediatric-color { background-color: var(--color-pediatric-light); color: var(--color-pediatric); }
.tumors-color { background-color: var(--color-tumors-light); color: var(--color-tumors); }

.category-card h4 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.category-card[data-category="breast"]:hover h4 { color: var(--color-breast); }
.category-card[data-category="aesthetics"]:hover h4 { color: var(--color-aesthetics); }
.category-card[data-category="body"]:hover h4 { color: var(--color-body); }
.category-card[data-category="pediatric"]:hover h4 { color: var(--color-pediatric); }
.category-card[data-category="tumors"]:hover h4 { color: var(--color-tumors); }

.category-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex: 1;
    line-height: 1.6;
}

.card-action {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap var(--transition-fast);
}

.category-card:hover .card-action {
    gap: 8px;
}

/* Info Banner */
.info-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-right: 4px solid var(--primary);
    padding: 32px 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.banner-content h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

.banner-content p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 700px;
}

.banner-graphics {
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-svg-icon {
    width: 48px;
    height: 48px;
    color: var(--primary);
    opacity: 0.8;
}

/* CATEGORY VIEW */
.category-header {
    margin-bottom: 32px;
}

.back-to-home-btn, .back-to-category-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 16px;
    transition: var(--transition-fast);
}

.back-to-home-btn:hover, .back-to-category-btn:hover {
    color: var(--primary);
    transform: translateX(4px);
}

.category-header h2 {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 8px;
}

.category-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.articles-list-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.article-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    transition: var(--transition-normal);
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.article-card-header h4 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}

.article-card-header .en-title {
    font-family: var(--font-english);
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
}

.article-card-body p {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.article-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.read-more-link {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ARTICLE VIEW */
.article-navigation-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 32px;
}

.article-actions {
    display: flex;
    gap: 12px;
}

.btn-outline {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

.btn-outline.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.article-layout {
    display: flex;
    gap: 40px;
    position: relative;
}

.article-container {
    flex: 1;
    max-width: 820px;
}

.article-toc-wrapper {
    width: 250px;
    position: sticky;
    top: calc(var(--header-height) + 45px);
    max-height: calc(100vh - var(--header-height) - 65px);
    display: flex;
    flex-direction: column;
}

.toc-nav-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.toc-nav-card button {
    text-align: right;
    width: 100%;
    margin-bottom: 0;
    padding: 0;
    font-size: 13.5px;
}

.toc-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    direction: ltr; /* Forces the scrollbar to the right side */
}

.toc-card > * {
    direction: rtl; /* Restores Hebrew Right-to-Left text flow and alignment */
}

.toc-card::-webkit-scrollbar {
    width: 4px;
}
.toc-card::-webkit-scrollbar-track {
    background: transparent;
}
.toc-card::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}
.toc-card::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

.toc-card h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-link {
    font-size: 13.5px;
    color: var(--text-secondary);
    font-weight: 500;
    display: block;
    line-height: 1.4;
    padding: 4px 0 4px 8px;
    border-right: 2px solid transparent;
    transition: var(--transition-fast);
}

.toc-link:hover {
    color: var(--primary);
    padding-right: 4px;
}

.toc-link.active {
    color: var(--primary);
    font-weight: 700;
    border-right-color: var(--primary);
    padding-right: 6px;
}

/* Article Content Style */
.article-header {
    margin-bottom: 36px;
}

.article-header h2 {
    font-size: 36px;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.15;
    margin-bottom: 8px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.english-subtitle {
    font-family: var(--font-english);
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 600;
}

.meta-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 3.5px 9px;
    border-radius: 4px;
    text-transform: uppercase;
    background-color: var(--primary-light);
    color: var(--primary);
}

.meta-tag.category-breast { background-color: var(--color-breast-light); color: var(--color-breast); }
.meta-tag.category-aesthetics { background-color: var(--color-aesthetics-light); color: var(--color-aesthetics); }
.meta-tag.category-body { background-color: var(--color-body-light); color: var(--color-body); }
.meta-tag.category-pediatric { background-color: var(--color-pediatric-light); color: var(--color-pediatric); }
.meta-tag.category-tumors { background-color: var(--color-tumors-light); color: var(--color-tumors); }
.meta-tag.category-lab { background-color: rgba(160, 140, 107, 0.12); color: #a08c6b; }

.article-intro-box {
    border-right: 4px solid var(--primary);
    background-color: var(--primary-light);
    padding: 22px 26px;
    border-radius: var(--radius-md);
    margin-bottom: 36px;
}

.article-intro-box p {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.75;
    font-weight: 500;
}

/* Parser Rendered Content Styles */
.article-body-content {
    font-size: 15.5px;
    color: var(--text-primary);
    line-height: 1.8;
}

.article-body-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
    scroll-margin-top: calc(var(--header-height) + 20px);
}

.article-body-content h3 {
    font-size: 16.5px;
    font-weight: 700;
    margin-top: 28px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

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

.article-body-content ul {
    margin-right: 0;
    margin-bottom: 24px;
    list-style: none;
    padding-right: 0;
}

.article-body-content li {
    position: relative;
    padding-right: 18px;
    margin-bottom: 10px;
}

.article-body-content li::before {
    content: '';
    position: absolute;
    right: 0;
    top: 9px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary);
    opacity: 0.75;
}

.article-body-content strong {
    font-weight: 700;
    color: var(--text-primary);
}

.article-body-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.article-body-content a:hover {
    color: var(--accent);
}

/* Tooltip terms */
.glossary-tooltip-trigger {
    border-bottom: 2px dashed var(--primary);
    cursor: help;
    font-weight: 600;
    position: relative;
}

/* PREPARATION TOOL SECTION */
.consultation-prep-section {
    margin-top: 60px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: var(--bg-card);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.prep-header {
    background-color: var(--primary-light);
    padding: 32px;
    border-bottom: 1px solid var(--border-color);
}

.prep-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    margin-bottom: 12px;
}

.prep-header h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.prep-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.prep-tool-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.prep-checklist-card h4, .prep-notes-card h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.write-us-link {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.write-us-link:hover {
    color: var(--primary-hover);
}

.prep-questions-checkboxes {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prep-questions-checkboxes li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.prep-questions-checkboxes li:hover {
    border-color: var(--primary);
}

.prep-questions-checkboxes input[type="checkbox"] {
    margin-top: 5px;
    accent-color: var(--primary);
    cursor: pointer;
}

.prep-questions-checkboxes label {
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.prep-notes-card textarea {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
}

.prep-notes-card textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.prep-tool-actions {
    padding: 0 32px 32px;
    display: flex;
    gap: 16px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background-color: var(--bg-primary);
}

/* GLOSSARY VIEW */
.glossary-header {
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.glossary-header h2 {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 8px;
}

.glossary-header p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.glossary-search-wrapper {
    max-width: 600px;
}

.glossary-search-wrapper input {
    width: 100%;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 15px;
}

.glossary-search-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
}

.glossary-list-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.glossary-item-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.glossary-term {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.glossary-definition {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* SAVED STATE */
.saved-header {
    margin-bottom: 32px;
}

.saved-header h2 {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 8px;
}

.saved-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.empty-saved-state {
    text-align: center;
    padding: 80px 24px;
    background-color: var(--bg-secondary);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.empty-icon {
    font-size: 48px;
    color: var(--text-muted);
}

.empty-saved-state p {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 400px;
    margin-bottom: 12px;
}

/* Footer styling */
.app-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 24px 20px;
    margin-top: 60px;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-about h4 {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 16px;
}

.footer-about p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-contact {
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.footer-contact a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.footer-contact a:hover {
    color: var(--primary-hover);
}

.footer-links h5, .footer-disclaimer h5 {
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    font-size: 13.5px;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary);
    padding-right: 4px;
}

.footer-disclaimer p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* Spinner Loading */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 40px auto 16px;
}

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

/* Responsive Styles */
@media (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    .articles-list-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-container {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    .footer-disclaimer {
        grid-column: span 2;
    }
    .article-layout {
        flex-direction: column;
    }
    .article-toc-wrapper {
        display: none;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        right: -100%;
        width: 100%;
        box-shadow: none;
    }
    .app-main-content {
        margin-right: 0;
        padding: 24px;
    }
    .search-bar-container {
        display: none; /* Hide global search in mobile header, show in hero instead */
    }
    .header-container {
        padding: 0 16px;
    }
    .hero-section h2 {
        font-size: 28px;
    }
    .articles-list-grid {
        grid-template-columns: 1fr;
    }
    .footer-container {
        grid-template-columns: 1fr;
    }
    .footer-disclaimer {
        grid-column: span 1;
    }
    .prep-tool-actions {
        flex-direction: column;
    }
    .glossary-list-container {
        grid-template-columns: 1fr;
    }
/* ==========================================================================
   Lab Disclaimer Styles
   ========================================================================== */

.lab-disclaimer-card {
    background-color: var(--color-tumors-light);
    border: 1px solid rgba(160, 140, 107, 0.2);
    border-right: 4px solid var(--accent);
    padding: 22px 26px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

body.dark-mode .lab-disclaimer-card {
    background-color: rgba(160, 140, 107, 0.08);
    border-color: rgba(160, 140, 107, 0.2);
}

.disclaimer-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: rgba(160, 140, 107, 0.15);
    color: var(--accent);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 12px;
}

body.dark-mode .disclaimer-badge {
    background-color: rgba(160, 140, 107, 0.25);
}

.lab-disclaimer-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.lab-disclaimer-card strong {
    color: var(--text-primary);
    font-weight: 700;
}



@media print {
    /* Force Light Mode colors for printing under all conditions */
    :root, body, body.dark-mode {
        --bg-primary: #ffffff !important;
        --bg-secondary: #ffffff !important;
        --bg-card: #ffffff !important;
        --border-color: #e2e8f0 !important;
        
        --text-primary: #0f172a !important;
        --text-secondary: #475569 !important;
        --text-muted: #64748b !important;
        --text-inverse: #000000 !important;
        
        --primary: #0f766e !important;
        --primary-hover: #115e59 !important;
        --primary-light: #f0fdfa !important;

        --color-breast-light: #f0fdfa !important;
        --color-aesthetics-light: #f5f3ff !important;
        --color-body-light: #fff7ed !important;
        --color-pediatric-light: #f0f9ff !important;
        --color-tumors-light: #fef2f2 !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
    
    .app-header, .app-sidebar, .app-footer, .article-navigation-bar, .toc-card, 
    .prep-tool-actions, .prep-notes-card, .sidebar-nav, .theme-toggle-btn {
        display: none !important;
    }
    
    .app-main-content {
        margin-right: 0 !important;
        padding: 0 !important;
    }
    
    .article-layout {
        display: block !important;
    }
    
    .article-container {
        max-width: 100% !important;
    }
    
    .consultation-prep-section {
        border: none !important;
        box-shadow: none !important;
        margin-top: 30px !important;
        page-break-before: always;
    }
    
    .prep-header {
        background: transparent !important;
        padding: 0 0 15px 0 !important;
        border-bottom: 2px solid black !important;
    }
    
    .prep-tool-body {
        padding: 20px 0 !important;
    }
    
    .prep-questions-checkboxes li {
        background: transparent !important;
        border: none !important;
        padding: 4px 0 !important;
        border-bottom: 1px dashed #ccc !important;
    }
    
    .prep-questions-checkboxes input[type="checkbox"] {
        border: 1px solid black !important;
        width: 15px;
        height: 15px;
    }
    
    /* Overrides for printing ONLY the checklist questions with the topic title */
    body.print-checklist-only .article-body-content,
    body.print-checklist-only .prep-header,
    body.print-checklist-only .prep-notes-card,
    body.print-checklist-only .prep-checklist-card h4,
    body.print-checklist-only .article-header span,
    body.print-checklist-only .article-header .article-category-tag {
        display: none !important;
    }
    
    body.print-checklist-only .consultation-prep-section {
        page-break-before: avoid !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    body.print-checklist-only .article-header h2 {
        font-size: 26px !important;
        margin-bottom: 24px !important;
        border-bottom: 2px solid black !important;
        padding-bottom: 12px !important;
    }
}
