/**
 * Modern Professional CSS Theme
 * Theme Name: Professional Medical/Calculator Theme
 * Version: 2.0.0
 * Combined from multiple source files
 */

/* ==========================================================================
   THEME CONFIGURATION & CSS VARIABLES
   ========================================================================== */
:root {
    /* Color Palette */
    --primary-color: #62929e;
    --primary-hover: #546a7b;
    --primary-light: #fdfdff;
    --secondary-color: #c6c5b9;
    --accent-color: #62929e;
    --success-color: #62929e;
    --warning-color: #c6c5b9;
    --error-color: #393d3f;
    --error-light: #fdfdff;
    --text-primary: #393d3f;
    --text-secondary: #393d3f;
    --text-muted: #546a7b;
    --text-light: #fdfdff;
    --border-color: #c6c5b9;
    --border-focus: #62929e;

    /* Spacing Scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 25px;
    --space-3xl: 30px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-xs: 10px;
    --font-size-sm: 12px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 20px;
    --font-size-3xl: 24px;
    --line-height: 1.6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(57, 61, 63, 0.05);
    --shadow-md: 0 5px 15px rgba(57, 61, 63, 0.1);
    --shadow-lg: 0 10px 30px rgba(57, 61, 63, 0.15);
    --shadow-focus: 0 0 0 2px rgba(98, 146, 158, 0.2);
    --shadow-color: rgba(57, 61, 63, 0.15);

    /* Border Radius */
    --radius-sm: 0px;
    --radius-md: 0px;
    --radius-lg: 0px;

    /* Global Border Radius Reset */
    --global-radius: 0px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Layout */
    --container-max-width: 1100px;
    --sidebar-width: 280px;
    --header-height: 96px;
}

/* Force 0 border-radius everywhere */
* {
    border-radius: 0 !important;
}

/* Additional CSS Variables from original file */
:root {
    --primary-gradient: linear-gradient(135deg, #62929e, #c6c5b9);
    --background-color: #fdfdff;
    --error-color-alt: #393d3f;
}

/* ==========================================================================
   DARK THEME CONFIGURATION
   ========================================================================== */
[data-theme="dark"] {
    /* Color Palette - Dark Mode Overrides */
    --primary-color: #62929e;
    --primary-hover: #7aa5b0;
    --primary-light: #1e293b;
    /* Dark Card Background */
    --secondary-color: #334155;
    /* Darker Secondary */
    --accent-color: #62929e;

    --success-color: #62929e;
    /* Consistently keeping brand color or adjust? */
    --warning-color: #cbd5e1;

    /* Error needs to be visible on dark - light red or keeping consistent? 
       Original was dark gray. Let's use a lighter gray or proper red. */
    --error-color: #ef4444;
    --error-light: #1e293b;

    /* Text Colors - Inverted */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #fdfdff;
    /* Keep white for buttons/contrast */

    --border-color: #334155;
    --border-focus: #62929e;

    /* Backgrounds */
    --background-color: #0f172a;
    /* Main Dark Background */

    /* Shadows - Stronger for dark mode depth */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-color: rgba(0, 0, 0, 0.5);

    --primary-gradient: linear-gradient(135deg, #1e293b, #0f172a);
}

/* ==========================================================================
   DARK MODE OVERRIDES (COMPREHENSIVE)
   ========================================================================== */

/* Structure & Containers */
[data-theme="dark"] body,
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-gray-50,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .footer,
[data-theme="dark"] footer,
[data-theme="dark"] #sidebar,
[data-theme="dark"] .card,
[data-theme="dark"] .title,
[data-theme="dark"] .bg-gray-custom {
    background-color: var(--primary-light) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] #sidebar-container,
[data-theme="dark"] aside {
    background-color: var(--primary-light) !important;
}

/* Borders */
[data-theme="dark"] .border-b,
[data-theme="dark"] .border-t,
[data-theme="dark"] .border-l,
[data-theme="dark"] .border-r,
[data-theme="dark"] .border {
    border-color: var(--border-color) !important;
}

/* Inputs & Forms */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] #searchBox {
    background-color: var(--secondary-color) !important;
    color: var(--text-light) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] input::placeholder {
    color: var(--text-muted) !important;
}

/* Typography Colors */
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-gray-500 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-gray-900 {
    color: var(--text-light) !important;
}

/* Search Dropdown */
[data-theme="dark"] #searchResults {
    background-color: var(--primary-light) !important;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .search-result-item:hover {
    background-color: var(--secondary-color);
}

/* Icons & Images */
/* Invert mainly icons (SVGs) in sidebar and footer */
[data-theme="dark"] #sidebar img,
[data-theme="dark"] footer img,
[data-theme="dark"] .icon img,
[data-theme="dark"] img.icon,
[data-theme="dark"] button img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* Exclude images that shouldn't be inverted if they have a specific class, 
   but for now assuming most UI elements are icons. 
   If there are product images in sidebar, this might need refinement. */

/* Links & Navigation */
[data-theme="dark"] a.sub-link,
[data-theme="dark"] .nav-link {
    color: var(--text-primary);
}

[data-theme="dark"] a.sub-link:hover,
[data-theme="dark"] .active-link {
    background-color: var(--secondary-color) !important;
    color: var(--accent-color) !important;
}

/* Tables */
[data-theme="dark"] table {
    background-color: var(--primary-light);
    color: var(--text-primary);
}

[data-theme="dark"] th {
    background-color: var(--secondary-color);
    color: var(--text-light);
    border-color: var(--border-color);
}

[data-theme="dark"] td {
    border-color: var(--border-color);
}

/* Scrollbars */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--background-color);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
    border: 2px solid var(--background-color);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Dark Theme specific overrides for utility classes and header */
[data-theme="dark"] header {
    background-color: var(--primary-light) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .text-gray-800 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] header button:hover {
    background-color: var(--secondary-color) !important;
}

[data-theme="dark"] header img {
    filter: brightness(0) invert(1);
}

/* Recent Updates Dark Mode Extensions */
[data-theme="dark"] .update-element {
    background-color: var(--secondary-color) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .date-marker {
    background-color: var(--primary-color) !important;
    color: var(--text-light) !important;
    border-color: var(--primary-hover) !important;
}

[data-theme="dark"] .update-dot {
    background-color: var(--text-muted) !important;
}

[data-theme="dark"] .update-dot.today {
    background-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(98, 146, 158, 0.3);
}

[data-theme="dark"] .slideshow-wrapper {
    background-color: var(--primary-light) !important;
}

[data-theme="dark"] .slide .bg-gray-50 {
    background-color: var(--primary-light) !important;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-family);
    line-height: var(--line-height);
    color: var(--text-secondary);
    background-color: var(--background-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.25rem 0 0.75rem;
    color: var(--text-primary);
    padding: 10px 0;
    background-color: var(--primary-light);
    border-radius: var(--radius-sm);
}

h2 {
    position: relative;
    display: inline-block;
    padding-bottom: var(--space-sm);
    color: var(--text-primary);
}

/* Underline */
h2::after {
    content: "";
    position: absolute;
    bottom: 0;
    height: 3px;
    background: var(--border-focus);
    border-radius: var(--radius-sm);

    /* TEXT-ONLY underline */
    left: var(--num-width, 2.0ch);
    /* number jitna hissa skip karega */
    right: 0;
}

/* Text Styles */
p {
    margin: 0 0 var(--space-md);
    font-size: var(--font-size-base);
}

.text-sm {
    font-size: var(--font-size-sm);
}

p.text-sm {
    font-size: var(--font-size-sm);
    background: var(--primary-light) !important;
    border-left: 1px solid var(--border-color);
}

p.text-sm-ho {
    font-size: var(--font-size-sm);
    background: var(--primary-light) !important;
}

ul.text-sm {
    font-size: var(--font-size-sm);
    background: var(--primary-light) !important;
}

.text-base {
    font-size: var(--font-size-base);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-xl {
    font-size: var(--font-size-xl);
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-light {
    color: var(--text-light);
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

/* General Typography */
.font-sans article {
    border: 1px solid var(--border-color);
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
    border-right-width: 1px;
    border-left-width: 1px;
    border-bottom-width: 1px;
}

/* ==========================================================================
   LAYOUT SYSTEM
   ========================================================================== */

.container {
    width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.flex {
    display: flex;
}

.flex-column {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

[data-theme="dark"] .quick-tip-section {
    background-color: var(--secondary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .quick-tip-section strong,
[data-theme="dark"] .quick-tip-section p {
    color: var(--text-secondary) !important;
}

/* Search Box Fixes for Dark Mode */
/* Search Box Fixes for Dark Mode */
[data-theme="dark"] .search-container-styled {
    background-color: var(--secondary-color) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] #searchBox,
[data-theme="dark"] #searchBox:focus,
[data-theme="dark"] #searchBox:active {
    background-color: transparent !important;
    border: none !important;
    color: var(--text-light) !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Ensure no white background on autofill or browser defaults */
[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--secondary-color) inset !important;
    -webkit-text-fill-color: var(--text-light) !important;
}

[data-theme="dark"] #searchBox {
    background-color: transparent !important;
    border: none !important;
    color: var(--text-light) !important;
}

/* Reset image margin in search box to look balanced or keep it? 
   Current style="margin-left: 10px" is inline. 
   We just need to ensure the icon color is inverted correctly. */

/* Specific Icon Inversions for Right Sidebar & Footer */
[data-theme="dark"] #relatedLinks img,
[data-theme="dark"] .resources-affiliates-links img,
[data-theme="dark"] .pinned-items-content img,
[data-theme="dark"] footer .hover-img,
[data-theme="dark"] footer .icon2 img {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

/* Ensure social icons in footer are visible */
[data-theme="dark"] footer .flex.space-x-4 a img {
    filter: brightness(0) invert(1);
}

/* ==========================================================================
   TITLE STYLES
   ========================================================================== */

.top-h1,
.cal_page_title {
    background-color: var(--primary-light);
    color: var(--text-light);
    font-weight: 500;
    padding: 14px 11px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.cal_page_title {
    font-size: 20px;
    padding: 30px 20px 20px 20px;
    background: var(--text-primary);
    text-align: left;
    border: none;
}

[data-theme="dark"] .cal_page_title {
    background: var(--primary-light) !important;
    color: var(--text-primary) !important;
}


.title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    margin-bottom: 0px;
    padding: 12px;
    background-color: var(--primary-light);
    border: none;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.title2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    margin-bottom: 0px;
    padding: 8px;
    border: none;
}

.title3 {
    font-size: 18px;
    font-weight: 400;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.title4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.tool-title {
    font-size: 24px;
    margin-bottom: 25px;
    color: var(--text-secondary);
    text-align: center;
}

/* Override utility classes for dark mode specifically for icons in right sidebar */
/* Override utility classes for dark mode specifically for icons in right sidebar */
[data-theme="dark"] .settings-container img,
[data-theme="dark"] .calculator-container .header img,
[data-theme="dark"] #relatedLinks .header img,
[data-theme="dark"] #pinnedItemsContainer .header img,
[data-theme="dark"] #voice-settings img,
[data-theme="dark"] #dose-calculator img,
[data-theme="dark"] #dilution-calculator img,
[data-theme="dark"] #sidebar .title3 img,
[data-theme="dark"] #sidebar .title4 img,
[data-theme="dark"] #sidebar .text-lg img,
[data-theme="dark"] #sidebar .flex.items-center img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* Fix for image placeholders if they are simple divs or imgs with specific src */
[data-theme="dark"] .images-container div[style*="background-color: #eee"],
[data-theme="dark"] .bg-gray-200 {
    /* Tailwind placeholder */
    background-color: var(--secondary-color) !important;
    border-color: var(--border-color);
}

/* Fix placeholders specifically in image section if identified by structure */
[data-theme="dark"] .thumbnails-container>div {
    background-color: var(--secondary-color) !important;
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   Image Magnifier & Product Gallery Dark Mode Fixes
   ========================================================================== */

/* Prevent inversion for product images in the magnifier section */
[data-theme="dark"] #imageMagnifier img,
[data-theme="dark"] .image-magnifier-container img,
[data-theme="dark"] #zoomable-image,
[data-theme="dark"] .image-nav-buttons button img {
    filter: none !important;
    opacity: 1 !important;
}

/* Backgrounds and Borders for Magnifier */
[data-theme="dark"] .image-magnifier-container,
[data-theme="dark"] .magnifier-wrapper {
    background-color: var(--primary-light) !important;
    border-color: var(--border-color) !important;
}

/* Text Colors inside Magnifier */
[data-theme="dark"] .image-magnifier-container p,
[data-theme="dark"] .image-magnifier-container span,
[data-theme="dark"] .image-magnifier-container .text-gray-900,
[data-theme="dark"] .image-magnifier-container .text-gray-600,
[data-theme="dark"] .image-magnifier-container .text-gray-700 {
    color: var(--text-primary) !important;
}

/* Fix for the 'View' badge */
[data-theme="dark"] .image-magnifier-container .bg-slate-100 {
    background-color: var(--secondary-color) !important;
    color: var(--text-light) !important;
}

/* ==========================================================================
   Table of Contents & Navigation Dark Mode
   ========================================================================== */
[data-theme="dark"] .content-table .tab-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .content-table .tab-link:hover {
    color: var(--accent-color);
}

[data-theme="dark"] #toc-toggle-icon,
[data-theme="dark"] img[alt*="Table of Contents"] {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

/* ==========================================================================
   Pinned Items & Local Data Notice Styles
   ========================================================================== */

/* Base Styles */
.local-data-notice {
    background-color: #f0f4f8;
    border-left: 3px solid #62929e;
    padding: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: #546a7b;
    border-radius: 3px;
}

.pinned-item {
    margin: 0;
    border-radius: 0;
    padding-bottom: 10px;
}

.data-type-tag {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    margin-left: 4px;
}

.unpin-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    flex-shrink: 0;
    margin-left: 4px;
}

.pinned-date {
    font-size: 10px;
    color: #999;
    margin-top: 3px;
    padding-left: 0;
}

/* Dark Mode Overrides for Pinned Items */
[data-theme="dark"] .local-data-notice {
    background-color: var(--secondary-color);
    color: var(--text-secondary);
    border-color: var(--border-focus);
}

[data-theme="dark"] .pinned-category .category-title {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .pinned-item:hover {
    background-color: var(--secondary-color) !important;
}

[data-theme="dark"] .data-type-tag {
    color: var(--text-muted);
}

[data-theme="dark"] .pinned-date {
    color: var(--text-muted);
}

[data-theme="dark"] .unpin-btn img {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

/* Ensure BMR History and other sidebar header icons are inverted */
[data-theme="dark"] .float-right-sidebar .header img {
    filter: brightness(0) invert(1);
    opacity: 0.9;
}


/* ==========================================================================
   CONTAINER STYLES
   ========================================================================== */

.bg-gray-custom {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    margin-bottom: 0px;
    padding: 12px;
    background-color: var(--primary-light);
    border: none;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.calculator-container,
.sidebar-cal-bg,
.resources-affiliates-links,
.ivfluidrate-history-section,
.Latest-Updates,
.tool-container {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
    padding: 8px;
}

.cal_page {
    font-family: sans-serif;
    font-size: 14px;
    margin: 20px auto;
    padding: 0 20px;
    margin-top: 0;
}

.cal_page p {
    font-size: 16px;
    text-align: left;
    color: var(--text-muted);
    margin: 0;
    padding: 10px 0;
}


.main-container {
    max-width: 100%;
}

/* ==========================================================================
   FORM STYLES
   ========================================================================== */

/* Labels */
.form-label,
.input-label,
.cal_page .input-group label,
:not(.user-section) label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    display: block;
}

/* Inputs */
.form-input,
.form-select,
.input-field,
.select-field,
.cal_page .input-group input,
.cal_page .input-group select,
:not(.user-section) form input,
:not(.user-section) select,
:not(.user-section) textarea {
    width: 100%;
    padding: var(--space-sm) 10px;
    font-size: var(--font-size-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--primary-light);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    margin-bottom: var(--space-md);
}

/* Focus States */
.form-input:focus,
.form-select:focus,
.input-field:focus,
.select-field:focus,
.cal_page .input-group input:focus,
.cal_page .input-group select:focus,
:not(.user-section) form input:focus,
:not(.user-section) select:focus,
:not(.user-section) textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-focus);
}

/* Error States */
.input-field.error,
.select-field.error {
    border-color: var(--error-color);
}

.tool-container :focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(98, 146, 158, 0.2);
}

.tool-container .error {
    border-color: var(--error-color);
}

/* ==========================================================================
   BUTTON STYLES
   ========================================================================== */

/* Primary Buttons */
.form-button,
.calculate-button,
.cal_page button,
:not(.user-section) .sb-btn {
    width: 100%;
    padding: var(--space-lg);
    background: var(--primary-color);
    color: var(--text-light);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-button:hover,
.calculate-button:hover,
.cal_page button:hover,
:not(.user-section) .sb-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.form-button:active,
.calculate-button:active,
.cal_page button:active,
:not(.user-section) .sb-btn:active {
    transform: translateY(0);
}

/* Clear History Button Specifics */
.clear-history-button {
    background-color: #ef4444 !important;
    /* Red color */
    color: white !important;
    font-weight: 600;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

.clear-history-button:hover {
    background-color: #dc2626 !important;
    /* Darker red on hover */
}

/* Dark Mode Hover Fix for Clear History */
[data-theme="dark"] .clear-history-button:hover {
    background-color: #b91c1c !important;
    /* Even darker red for dark mode contrast */
    color: white !important;
}

/* Secondary Buttons */
.clear-history-button {
    background-color: var(--error-color);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.3s;
    font-size: var(--font-size-sm);
    border: none;
    cursor: pointer;
}

.clear-history-button:hover {
    background-color: var(--text-primary);
}

.load-more-btn {
    background-color: var(--text-primary);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.3s;
    font-size: var(--font-size-sm);
}

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

/* Form Button Styles */
.form-button.hidden {
    display: none;
}

/* Button Toggle */
button#toggleVoice,
a.translate-link {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-radius: 0.25rem;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
    background-color: var(--primary-light);
}

button#toggleVoice:hover,
a.translate-link:hover {
    color: var(--primary-color);
    border-right: 4px solid var(--text-primary);
}

/* ==========================================================================
   INPUT GROUP STYLES
   ========================================================================== */

.cal_page .container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: 0;
    margin: 20px auto;
}

.cal_page .input-group {
    display: flex;
    flex-direction: column;
}

.cal_page .input-group label {
    font-size: var(--font-size-sm);
    font-weight: bold;
    margin-bottom: 3px;
}

.cal_page .input-group input,
.input-group select {
    font-size: var(--font-size-sm);
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    width: 100%;
}

.cal_page .height-input-group {
    display: flex;
    gap: var(--space-sm);
}

.cal_page .height-input-group input {
    width: 50%;
}

/* ==========================================================================
   PROGRESS BAR STYLES
   ========================================================================== */

.cal_page .progress-container {
    width: 100%;
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    margin-top: var(--space-lg);
}

.cal_page .progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-color);
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

.cal_page .bmi-marker {
    position: absolute;
    top: -5px;
    height: 20px;
    width: 2px;
    background: var(--error-color);
    transition: left 0.5s ease-in-out;
}

.cal_page .bmi-range {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    margin-top: 5px;
}

.progress-line {
    height: 3px;
    background: var(--text-light);
    margin-top: var(--space-sm);
    animation: shrink 10s linear forwards;
}

/* ==========================================================================
   RESULT STYLES
   ========================================================================== */

.result-container,
.inj-result-container {
    margin-top: var(--space-lg);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    line-height: 1.4;
    padding: 1rem;
    background-color: var(--primary-light);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-sm);
}

.result-box {
    margin-top: var(--space-2xl);
    padding: var(--space-lg);
    background-color: var(--secondary-color);
    border-left: 5px solid var(--success-color);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.cal_page .result {
    font-size: var(--font-size-base);
    font-weight: bold;
    text-align: center;
    margin-top: var(--space-lg);
}

/* Success Styles */

.cal_page .success {
    background: var(--success-color);
}

.cal_page .category-underweight {
    background: var(--secondary-color);
}

.cal_page .category-normal {
    background: var(--success-color);
}

.cal_page .category-overweight {
    background: var(--warning-color);
}

.cal_page .category-obese {
    background: var(--error-color);
}

/* ==========================================================================
   NOTIFICATION STYLES
   ========================================================================== */

.cal_page .notification {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: var(--text-light);
    font-size: var(--font-size-sm);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    display: none;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.cal_page .notification-progress {
    width: 100%;
    height: 5px;
    background: var(--primary-hover);
    margin-top: var(--space-sm);
    border-radius: var(--radius-sm);
}

.cal_page .notification-progress-bar {
    height: 100%;
    width: 100%;
    background: var(--success-color);
    animation: notificationFade 3s linear forwards;
}

/* ==========================================================================
   HISTORY STYLES
   ========================================================================== */

.cal_page .history {
    margin-top: var(--space-lg);
}

.cal_page .history h3 {
    font-size: var(--font-size-base);
    text-align: center;
}

.cal_page .history ul {
    list-style: none;
    padding: 0;
    font-size: var(--font-size-sm);
    text-align: center;
}

.cal_page .history li {
    padding: 0.3rem;
    border-bottom: 1px solid var(--border-color);
}

/* ==========================================================================
   LOADER STYLES
   ========================================================================== */

.loader-wrapper,
#sidebar-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(252, 223, 255, 0.85) 0%, rgba(240, 248, 255, 0.85) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.loader,
#sidebar-loader .loader {
    width: 60px;
    height: 60px;
    position: relative;
}

.loader::before,
.loader::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: spinPremium 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loader::before {
    width: 60px;
    height: 60px;
    border: 5px solid transparent;
    border-top: 5px solid var(--primary-color);
    border-right: 5px solid var(--primary-color);
    top: 0;
    left: 0;
}

.loader::after {
    width: 45px;
    height: 45px;
    border: 5px solid transparent;
    border-bottom: 5px solid var(--accent-color);
    border-left: 5px solid var(--accent-color);
    top: 7.5px;
    left: 7.5px;
    animation: spinReverse 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.updates-loader {
    width: 50px;
    height: 50px;
    position: relative;
    margin: var(--space-xl) auto;
}

.updates-loader::before,
.updates-loader::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: spinPremium 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.updates-loader::before {
    width: 50px;
    height: 50px;
    border: 4px solid transparent;
    border-top: 4px solid var(--primary-color);
    border-right: 4px solid var(--primary-color);
    top: 0;
    left: 0;
}

.updates-loader::after {
    width: 35px;
    height: 35px;
    border: 4px solid transparent;
    border-bottom: 4px solid var(--accent-color);
    border-left: 4px solid var(--accent-color);
    top: 7.5px;
    left: 7.5px;
    animation: spinReverse 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

/* ==========================================================================
   MODAL STYLES
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 50%;
    padding: var(--space-xl);
    max-width: 700px;
    background: var(--text-light);
    border-radius: var(--radius-md);
}

.close {
    position: absolute;
    top: 85px;
    right: 370px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: var(--transition-normal);
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
}

/* ==========================================================================
   SLIDESHOW STYLES
   ========================================================================== */

/* Basic Slideshow */
.slide {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    width: 100%;
}

.slide.active {
    display: block;
    opacity: 1;
}

.slideshow-wrapper {
    position: relative;
    max-width: 100%;
    overflow: hidden;
    border-radius: 8px;
    /* responsive width */
    height: 200px;
    /* FIXED HEIGHT (customize as needed) */
    margin: 0 auto;
    /* center horizontally */
    overflow: hidden;
}

.slideshow-wrapper h3 {
    font-weight: bold;
}

.slideshow-nav {
    position: absolute;
    bottom: 20px;
    color: var(--text-light);
    border: none;
    padding: 0px;
    cursor: pointer;
    font-size: 24px;
    z-index: 9;
    border-radius: 2px;
}

.slideshow-nav.prev {
    right: 64px;
}

.slideshow-nav.next {
    right: 24px;
}

.slideshow-nav:hover {
    background: transparent;
}

.slideshow-indicators {
    text-align: center;
    padding: var(--space-lg) 0;
}

.indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 5px;
    background: var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.indicator.active {
    background: var(--primary-color);
}

/* Slide Indicators (Alternative) */
#slide-indicators {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--border-color);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.indicator.active {
    background-color: var(--primary-color);
}

/* ==========================================================================
   SIDEBAR STYLES
   ========================================================================== */

.sidebar {
    transition: transform var(--transition-fast);
}

.sidebar-closed {
    transform: translateX(-100%);
}

#sidebar-container,
#sidebar-container_cal,
#sidebar-container_ho {
    max-height: 92vh;
    overflow-y: auto;
    position: fixed;
}

#sidebar-container::-webkit-scrollbar,
#sidebar-container_cal::-webkit-scrollbar,
#sidebar-container_ho::-webkit-scrollbar,
.-webkit-scroll::-webkit-scrollbar {
    width: 6px;
}

#sidebar-container::-webkit-scrollbar-thumb,
#sidebar-container_cal::-webkit-scrollbar-thumb,
#sidebar-container_ho::-webkit-scrollbar-thumb,
.-webkit-scroll::-webkit-scrollbar-thumb {
    background-color: var(--text-muted);
    border-radius: 0;
}

#sidebar-container::-webkit-scrollbar-thumb:hover,
#sidebar-container_cal::-webkit-scrollbar-thumb:hover,
#sidebar-container_ho::-webkit-scrollbar-thumb:hover,
.-webkit-scroll::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-primary);
}

#dropdown-content {
    transition: max-height var(--transition-fast);
    overflow: hidden;
}

/* Dropdown Styles */
.dropdown-content {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.320, 1);
    overflow: hidden;
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
    animation: expandDropdown 0.4s cubic-bezier(0.23, 1, 0.320, 1) forwards;
}

.dropdown-content.hidden {
    max-height: 0px !important;
    opacity: 0 !important;
    visibility: hidden;
    animation: collapseDropdown 0.4s cubic-bezier(0.23, 1, 0.320, 1) forwards;
}

/* ==========================================================================
   IMAGE STYLES
   ========================================================================== */

.image-center {
    float: none;
    margin: 1.5rem auto;
    text-align: center;
    max-width: 500px;
    color: var(--text-muted);
}

.image-caption {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem;
    background-color: var(--primary-light);
    border-top: 1px solid var(--border-color);
}

.image-bordered {
    border: 1px solid var(--border-color);
    padding: 0.25rem;
    background-color: var(--text-light);
}

.image-bg-light {
    background-color: var(--primary-light);
}

.image-bg-dark {
    background-color: var(--text-primary);
}

.image-bg-gradient {
    background: linear-gradient(to bottom right, var(--primary-light), var(--border-color));
}

.float-right-image {
    float: right;
    margin: 0;
    max-width: 400px;
    width: 100%;
    color: var(--text-primary);
    font-weight: bold;
    overflow: hidden;
    background-color: var(--text-light);
    background-size: cover;
}

.float-right-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.05;
    pointer-events: none;
}

.float-right-image .sd-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.ad-content img {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
}

/* ==========================================================================
   TABLE STYLES
   ========================================================================== */

.edit-section table,
.content-table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
    background-color: var(--primary-light);
    font-size: 0.875rem;
    box-shadow: var(--shadow-sm);
}

.edit-section th {
    background-color: var(--primary-color);
    color: var(--text-light);
    font-weight: 500;
    padding: 0.625rem;
    text-align: left;
}

.edit-section td,
td {
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.content-table .no-so3 {
    padding: 3px 5px;
    cursor: pointer;
    border-left: 4px solid transparent;
    margin-bottom: 0;
}

.content-table .no-so3:hover,
.content-table .no-so3.active {
    background-color: var(--error-light);
    border-left: 3px solid var(--error-color);
    font-weight: bold;
}

/* ==========================================================================
   LIST STYLES
   ========================================================================== */

ul li {
    font-size: var(--font-size-base);
}

.b-left li {
    border-left: 2px solid var(--border-color);
    height: auto;
    padding: 3px 3px 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.b-left li:hover {
    padding-left: 6px;
    border-left: 3px solid var(--text-primary);
}

.se-b-left a {
    border-left: 2px solid var(--border-color);
    padding: 3px 3px 3px 8px;
    height: auto;
    font-size: var(--font-size-base);
    color: var(--primary-color);
}

.se-b-left a:hover {
    padding-left: 6px;
    border-left: 3px solid var(--text-primary);
    background-color: transparent;
}

.r-left {
    border-left: 2px solid var(--border-color);
    height: auto;
    padding: 3px 3px 3px 8px;
    max-width: 194px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: visible;
    text-overflow: clip;
    display: inline-block;
    font-size: var(--font-size-base);
}

.r-left:hover {
    padding-left: 6px;
    border-left: 3px solid var(--text-primary);
}

/* ==========================================================================
   LINK STYLES
   ========================================================================== */

.sub-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.sub-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.tab-link {
    cursor: pointer;
    text-decoration: none;
    transition: color 0.1s ease;
}

.tab-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
    font-size: 14.2px;
}

/* Active Link Styles */
a.active-link {
    font-weight: bold;
    text-decoration: underline;
    position: relative;
}

a.active-link::before {
    content: '<';
    position: absolute;
    right: -1.5rem;
    color: var(--text-primary);
}

/* Header Active Link Styles */
header a[href] {
    transition: all 0.3s ease;
    position: relative;
}

header a[href]:hover {
    color: var(--text-primary);
    background-color: var(--primary-light);
}

.active-header-link {
    color: var(--text-primary) !important;
    border-bottom: 3px solid var(--text-primary) !important;
    background-color: var(--primary-light);
}

/* ==========================================================================
   ICON STYLES
   ========================================================================== */

.icon {
    height: 20px;
    width: 20px;
    margin-right: var(--space-sm);
}

.icon2 {
    height: 24px;
    width: 24px;
    margin-right: var(--space-sm);
}

/* Voice Icon Styles */
.voice-controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.voice-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.voice-icon:hover {
    transform: scale(1.1);
}

/* ==========================================================================
   SEARCH STYLES
   ========================================================================== */

.search-result {
    display: none;
}

.search-result.show {
    display: block;
}

.search-result-item {
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.search-result-item:hover {
    background-color: var(--text-light);
}

#searchResults {
    max-height: 300px;
    overflow-y: auto;
}

#searchResults:hover {
    background-color: transparent;
}

#searchResults::-webkit-scrollbar {
    width: 6px;
}

#searchResults::-webkit-scrollbar-thumb {
    background-color: var(--primary-light);
    border-radius: 10px;
}

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

/* ==========================================================================
   VOICE SETTINGS STYLES
   ========================================================================== */

#voiceSettings label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0px;
    display: block;
}

#voiceSettings select:focus,
#voiceSettings input[type="checkbox"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(98, 146, 158, 0.2);
}

#voiceSettings .setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0;
    margin-bottom: var(--space-sm);
}

#voiceSettings a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-around;
}

#voiceSettings select,
#voiceSettings input[type="checkbox"] {
    width: auto;
    padding: 4px 5px;
    font-size: var(--font-size-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--primary-light);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    margin-bottom: 0px;
}

/* ==========================================================================
   TABLE OF CONTENTS STYLES
   ========================================================================== */

#table-of-contents {
    width: 100%;
    margin: 1rem 0;
    margin-left: 10px;
    border-collapse: collapse;
    background-color: var(--primary-light);
}

.content-table li {
    list-style: none;
    margin: 8px 0;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
}

.content-table li.active {
    color: var(--primary-color);
    text-decoration: underline var(--primary-color);
}

.toc-toggle-icon {
    transition: transform var(--transition-fast);
}

/* ==========================================================================
   CARD STYLES
   ========================================================================== */

.card-bg {
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.card-bg-a {
    color: var(--text-light);
}

/* ==========================================================================
   UPDATE STYLES
   ========================================================================== */

.update-item {
    opacity: 0;
    transform: translateY(20px);
    animation: slideIn var(--transition-normal) ease forwards;
}

.update-tree-container {
    position: relative;
    padding-left: 30px;
}

.update-element {
    position: relative;
    margin-bottom: var(--space-lg);
    border-left: 3px solid var(--border-color);
    transition: all var(--transition-fast);
}

.update-element:hover {
    border-left-color: var(--primary-color);
    transform: translateX(4px);
}

.update-element::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--border-color);
    animation: growLine var(--transition-normal) ease-out forwards;
    transform-origin: top;
}

.update-element::after {
    content: '';
    position: absolute;
    left: -30px;
    top: 20px;
    width: 20px;
    height: 2px;
    background: var(--border-color);
    animation: growBranch var(--transition-normal) ease-out forwards;
    transform-origin: left;
}

.update-dot {
    position: absolute;
    left: -34px;
    top: 16px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-primary);
    animation: popDot 0.3s ease-out forwards;
    transform: scale(0);
}

.update-dot.today {
    background: var(--success-color);
    box-shadow: 0 0 0 2px rgba(98, 146, 158, 0.2);
}

.date-marker {
    position: absolute;
    left: -46px;
    top: -15px;
    font-size: 10px;
    color: var(--text-muted);
    background: var(--text-light);
    padding: 2px 6px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    animation: fadeIn var(--transition-normal) ease-out forwards;
}

.update-element:last-child::before {
    height: 20px;
}

/* ==========================================================================
   Magnifier Perfection
   ========================================================================== */

.magnifier-lens {
    width: 150px;
    height: 150px;
    background-repeat: no-repeat;
    border: 3px solid white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    pointer-events: none;
    z-index: 50;
    display: none;
}

@media (max-width: 768px) {
    .magnifier-lens {
        display: none !important;
    }

    /* Disable lens on mobile */
}

/* ==========================================================================
   ANIMATION KEYFRAMES
   ========================================================================== */

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

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

/* Premium Dual Ring Spinner Animations */
@keyframes spinPremium {
    0% {
        transform: rotate(0deg);
        opacity: 1;
    }

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

@keyframes spinReverse {
    0% {
        transform: rotate(360deg);
        opacity: 0.8;
    }

    100% {
        transform: rotate(0deg);
        opacity: 0.8;
    }
}

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

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

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(50px);
    }
}

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

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

@keyframes shrink {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

@keyframes notificationFade {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

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

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

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

@keyframes growLine {
    from {
        transform: scaleY(0);
    }

    to {
        transform: scaleY(1);
    }
}

@keyframes growBranch {
    from {
        transform: scaleX(0);
    }

    to {
        transform: scaleX(1);
    }
}

@keyframes popDot {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

/* Dropdown Open Animation */
@keyframes expandDropdown {
    from {
        max-height: 0;
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        max-height: 1000px;
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown Close Animation */
@keyframes collapseDropdown {
    from {
        max-height: 1000px;
        opacity: 1;
        transform: translateY(0);
    }

    to {
        max-height: 0;
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ==========================================================================
   ANIMATION CLASSES
   ========================================================================== */

.animate-fade-in {
    animation: fadeIn var(--transition-normal) ease-out forwards;
}

/* ==========================================================================
   SCROLLBAR CUSTOMIZATION
   ========================================================================== */

/* Webkit Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--primary-light);
}

::-webkit-scrollbar-thumb {
    background-color: var(--text-muted);
    border-radius: 0;
}

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

.webkit-scroll::-webkit-scrollbar {
    width: 6px;
}

.webkit-scroll::-webkit-scrollbar-track {
    background: var(--border-color);
}

.webkit-scroll::-webkit-scrollbar-thumb {
    background: var(--border-focus);
    border-radius: 3px;
}

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


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

@media (max-width: 768px) {

    .edit-section h1 {
        font-size: 1.125rem;
    }

    .edit-section h2 {
        font-size: 1rem;
    }

    .edit-section h3 {
        font-size: 0.9375rem;
    }

    .edit-section p,
    .edit-section ul li {
        font-size: 0.875rem;
    }

    .edit-section table,
    .edit1.edit2 table {
        width: 100%;
        overflow-x: hidden;
        /* optional */
        white-space: normal !important;
        font-size: 0.8125rem;
        word-break: break-word;
    }

    .image-slider {
        width: 100%;
        height: auto;
        max-width: 100%;
    }

    .image-slider img.slider-image {
        max-width: 100%;
        width: 100%;
        height: auto;
        position: relative;
        left: 0 !important;
    }

    .cal_page {
        max-width: 90%;
        padding: var(--space-lg);
    }

    .cal_page h1 {
        font-size: 16px;
    }

    .cal_page button {
        font-size: var(--font-size-sm);
        padding: var(--space-sm);
    }

    .float-right-image {
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        position: fixed !important;
        margin-top: 0;
        right: 0;
        bottom: 0;
        width: 80% !important;
        width: 280px !important;
        z-index: 1000;
        overflow-y: auto !important;
    }

    .float-right-image.show {
        transform: translateX(0);
        float: none;
        margin: 0 auto;
        max-width: 100%;
        margin-bottom: 0;
    }

    .con-sec {
        max-width: 100%;
    }

    .top-h1 {
        padding-right: 3.5rem;
    }

    .sidebar-toggle {
        position: fixed !important;
        top: 85px !important;
        right: 2px !important;
        margin-right: 14px;
        z-index: 1001;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        background: var(--primary-color);
        padding: 0.375rem;
        transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    }

    .sidebar-toggle:hover {
        cursor: pointer;
        background: var(--primary-hover);
    }

    .float-right-image .mb-4 {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }

    .float-right-image .image-slider {
        width: 100%;
        max-width: 400px;
        height: 250px;
        margin: 0 auto;
    }

    .float-right-image .dose-calculator,
    .float-right-image .affiliates-links,
    .float-right-image .embed-video,
    .float-right-image .resources-links,
    .float-right-image .Latest-Updates,
    .float-right-image .advertisement-section {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .float-right-image input[type="number"] {
        font-size: 16px;
        padding: var(--space-sm);
    }

    .float-right-image button {
        min-height: 44px;
        padding: var(--space-lg) 15px;
    }

    .smmt-6 {
        margin-top: 0px;
    }

    .close-sidebar {
        display: block !important;
    }

    h2 {
        font-size: 1.25rem;
    }

    .ph-center {
        text-align: center;
    }

    h2 button,
    h2 a {
        display: block;
        margin-top: 0.5rem;
    }

    #voiceSettings label,
    #voiceSettings select,
    #voiceSettings input {
        display: block;
    }

    .m41 {
        display: flex;
        flex-wrap: wrap;
        flex-direction: column;
    }

    .m41 label {
        font-weight: normal;
    }

    .m41 a:hover {
        text-decoration: none;
    }

    /* Slideshow Responsive */
    .slideshow-wrapper {
        grid-template-columns: 1fr;
        height: 240px;
    }

    .slideshow-wrapper h3 {
        font-size: 20px;
        font-weight: bold;
    }

    .slideshow-wrapper p {
        font-size: 14px;
    }

    .slideshow-wrapper .ri-si-mg {
        display: none;
    }

    /* Sidebar Scrolling for Small Devices */
    aside#sidebar {
        height: calc(100vh - 100px);
        overflow-y: hidden;
        overflow-x: hidden;
        /* max-height: calc(100vh - 100px); */
        display: flex;
        flex-direction: column;
    }

    .sidebar-content-wrapper {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .float-right-image .image-slider {
        height: 200px;
    }

    .pl-4 {
        padding-left: 1rem;
    }

    .pr-4 {
        padding-right: 1rem;
    }
}

@media (max-width: 640px) {
    #sidebar {
        padding-bottom: 80px;
    }

    .float-right-image {
        float: none;
        margin: 0px auto;
        max-width: 100%;
        margin-bottom: 0;
    }

    .con-sec {
        max-width: 100%;
    }

    .image-center {
        max-width: 100%;
    }
}

@media (max-width: 750px) {
    .con-sec {
        max-width: 100%;
    }
}

@media (min-width: 1023px) {

    .main-container {
        width: 77%;
    }
}

@media (max-width: 700px) {
    .modal-content {
        width: 100%;
    }
}


@media (max-width: 1023px) {
    .active-header-link img {
        border-bottom: 2px solid var(--text-primary) !important;
        padding-bottom: 5px !important;
    }

    .active-header-link {
        border: none !important;
        padding-bottom: 5px !important;
        background-color: transparent !important;
    }

    header a[href]:hover {
        color: none;
        background-color: transparent;
    }

    .float-right-sidebar {
        max-height: 100vh;
    }

    .sidebar-toggle {
        display: none;
    }

    .close {
        position: absolute;
        top: 85px;
        right: 10px;
        color: #f1f1f1;
        font-size: 40px;
        font-weight: bold;
        transition: var(--transition-normal);
    }

    .sidebar-toggle {
        display: flex;
    }


}

@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .float-right-image img {
        image-rendering: -webkit-optimize-contrast;
    }
}

@media print {
    .float-right-image {
        break-inside: avoid;
        max-width: 250px;
        box-shadow: none;
    }

    .float-right-image::before {
        display: none;
    }
}

/* ==========================================================================
   SPECIAL STYLES
   ========================================================================== */

/* Chrome, Edge, Safari autofill fix */
input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    box-shadow: 0 0 0 1000px transparent inset !important;
    background-color: transparent !important;
    background-clip: content-box !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    box-shadow: 0 0 0 1000px transparent inset !important;
    background-color: transparent !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
    display: none !important;
}

input[type="search"] {
    background-color: transparent !important;
    -webkit-box-shadow: 0 0 0px 1000px transparent inset !important;
    box-shadow: 0 0 0px 1000px transparent inset !important;
}

/* Additional Utility Classes */
.injection-warning {
    background: transparent;
    color: var(--text-primary);
    padding: var(--space-lg);
    text-align: center;
    font-weight: bold;
    font-size: var(--font-size-base);
    border-top: 3px solid var(--error-color);
    border-radius: 0.5rem;
    border: solid 1px var(--error-color);
    margin: var(--space-xl);
}

.ph-nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
}

.m41 {
    display: flex;
    flex-direction: row;
    align-content: center;
    align-items: center;
    justify-content: space-between;
}

.m41 label {
    font-weight: normal;
}

.m41 a:hover {
    text-decoration: none;
}

/* Right Sidebar */
.float-right-sidebar {
    position: sticky;
    top: 80px;
    padding-bottom: 0;
    max-height: 92vh;
    overflow-y: auto;
    max-width: 280px;
}

/* Content Section */
.float-left-sidebar {
    width: 100%;
    z-index: 0;
}

/* ==========================================================================
   USER SECTION EXCEPTIONS
   ========================================================================== */

:not(.user-section) form input,
:not(.user-section) select,
:not(.user-section) textarea {
    width: 100%;
    padding: var(--space-sm) 10px;
    font-size: var(--font-size-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--primary-light);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    margin-bottom: var(--space-md);
}

:not(.user-section) form input:focus,
:not(.user-section) select:focus,
:not(.user-section) textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(98, 146, 158, 0.2);
}

:not(.user-section) label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    display: block;
}

:not(.user-section) .sb-btn {
    width: 100%;
    padding: var(--space-lg);
    background: var(--primary-color);
    color: var(--text-light);
    font-size: var(--font-size-sm);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

:not(.user-section) .sb-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

:not(.user-section) .sb-btn:active {
    transform: translateY(0);
}

/* ==========================================================================
   HOME BUTTON
   ========================================================================== */

.home-button {
    position: fixed;
    top: var(--space-lg);
    left: var(--space-lg);
    padding: var(--space-lg) 15px;
    color: var(--text-light);
    border: none;
    cursor: pointer;
    font-size: var(--font-size-lg);
    border-radius: var(--radius-sm);
    text-decoration: none;
    display: inline-block;
    background-color: var(--primary-color);
}

.home-button:hover {
    font-weight: bold;
    background-color: var(--primary-hover);
}

/* ==========================================================================
   IMAGE VIEWER
   ========================================================================== */

.viewer-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-image {
    max-width: 90%;
    max-height: 90%;
    transition: transform 0.3s ease-in-out;
    cursor: grab;
}

.viewer-controls {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-md);
}

.viewer-button {
    padding: var(--space-lg);
    font-size: var(--font-size-lg);
    background: rgba(252, 223, 255, 0.2);
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
}

.viewer-button:hover {
    background: rgba(252, 223, 255, 0.4);
}

/* ==========================================================================
   CONTACT STYLES
   ========================================================================== */

:not(.user-section) .contact-container {
    position: relative;
}

:not(.user-section) .contact-trigger {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    background: var(--text-primary);
    color: var(--text-light);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    padding: var(--space-sm);
}

:not(.user-section) .contact-trigger:hover {
    transform: scale(1.15) rotate(5deg);
}

:not(.user-section) .contact-trigger:active {
    transform: scale(0.95) rotate(-5deg);
    box-shadow: 0 8px 20px var(--shadow-color);
}

:not(.user-section) .contact-modal {
    display: none;
    position: fixed;
    bottom: 80px;
    right: var(--space-lg);
    background: var(--background-color);
    padding: var(--space-xl);
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color);
    width: 320px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(50px);
}

:not(.user-section) .contact-modal.active {
    display: block;
    animation: slideIn var(--transition-normal) ease-out forwards, bounce var(--transition-normal) 0.5s ease-out;
}

:not(.user-section) .contact-modal.closing {
    animation: slideOut var(--transition-normal) ease-out forwards;
}

:not(.user-section) .error-msg {
    color: var(--error-color-alt);
    font-size: var(--font-size-sm);
    display: none;
    margin-top: var(--space-sm);
}

/* ==========================================================================
   SPEECH AND HIGHLIGHT STYLES
   ========================================================================== */

.speech-highlight {
    background-color: var(--warning-color);
    color: var(--text-primary);
    transition: background-color var(--transition-normal);
    border-radius: 2px;
    padding: 0 1px;
}

/* ==========================================================================
   HOVER EFFECTS
   ========================================================================== */

.hover-img:hover {
    transform: rotateY(180deg);
}

/* ==========================================================================
   ERROR BAR STYLES
   ========================================================================== */

.error-bar {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 1002;
    animation: fadeIn var(--transition-normal) ease-in-out;
    min-width: 240px;
    opacity: 1;
    transition: opacity var(--transition-normal);
    max-width: 340px;
}

.error-bar.hide {
    opacity: 0;
    pointer-events: none;
}

.error-message {
    top: var(--space-lg);
    right: -300px;
    background-color: var(--error-light);
    color: var(--error-color);
    padding: var(--space-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 0 10px rgba(57, 61, 63, 0.1);
    transition: right var(--transition-normal) ease-in-out;
}

.error-message,
.inj-error-container,
.cal_page .error {
    background-color: var(--error-light);
    color: var(--error-color);
    font-size: var(--font-size-base);
    line-height: 1.5;
    border-left: 4px solid var(--error-color);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
}

/* ==========================================================================
   SELECT OPTION STYLING
   ========================================================================== */

select option:hover {
    background-color: var(--error-color);
}

/* ==========================================================================
   SIDEBAR SCROLLABLE & FOOTER SECTIONS STYLING
   ========================================================================== */

/* Main sidebar flex container */
aside#sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Search section at top - always visible */
.search-section {
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

/* Scrollable content container - takes remaining space */
aside#sidebar>div:nth-child(2) {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Footer sections - always at bottom, never scroll */
aside#sidebar>div:last-child,
aside#sidebar>div:nth-last-child(2) {
    flex-shrink: 0;
    position: relative;
    z-index: 5;
}

/* Quick Tips Footer Section */
aside#sidebar>div.bg-blue-50 {
    flex-shrink: 0;
    background-color: #eff6ff !important;
    border-top: 1px solid #bfdbfe;
    border-bottom: 1px solid #bfdbfe;
    padding: 12px;
    margin-top: auto;
}

aside#sidebar>div.bg-blue-50 h4 {
    font-size: 11px;
    font-weight: 700;
    color: #1e40af;
    text-transform: uppercase;
    margin-bottom: 8px;
    margin-top: 0;
}

aside#sidebar>div.bg-blue-50 p {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.5;
    margin: 0;
}

/* Support & Links Footer Section */
aside#sidebar>div.bg-gray-50 {
    flex-shrink: 0;
    background-color: #f9fafb !important;
    border-top: 1px solid #e5e7eb;
    padding: 12px;
}

aside#sidebar>div.bg-gray-50>div {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

aside#sidebar>div.bg-gray-50 a {
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
    transition: all var(--transition-fast);
}

aside#sidebar>div.bg-gray-50 a:hover {
    color: #1e40af;
    text-decoration: underline;
}

aside#sidebar>div.bg-gray-50 p {
    font-size: 11px;
    color: #6b7280;
    margin: 8px 0 0 0;
}

/* Custom scrollbar styling for sidebar */
aside#sidebar::-webkit-scrollbar {
    width: 6px;
}

aside#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

aside#sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

aside#sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   FOOTER IMAGE STYLES
   ========================================================================== */

/* Footer link images - icons used in Quick Links */
footer .sub-link img,
aside#sidebar .sub-link img {
    width: 20px;
    height: 20px;
    transition: all var(--transition-fast);
    filter: brightness(0.95);
    object-fit: contain;
    flex-shrink: 0;
}

footer .sub-link img:hover,
aside#sidebar .sub-link img:hover {
    filter: brightness(1.15) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transform: scale(1.15);
}

/* Social media icons in footer */
footer .icon2,
footer .icon2 img {
    transition: all var(--transition-fast);
    filter: brightness(0.9);
}

footer .icon2:hover {
    transform: scale(1.2) rotate(5deg);
}

footer .icon2:hover img {
    filter: brightness(1.2) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* Footer link styling with image alignment */
footer .sub-link,
aside#sidebar .sub-link {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: all var(--transition-fast);
    flex-wrap: wrap;
    align-items: center;
}

footer .sub-link:hover,
aside#sidebar .sub-link:hover {
    padding-left: 2px;
}

/* Footer privacy and terms icons */
footer .sub-link[href*="privacy-policy"] img,
footer .sub-link[href*="Terms"] img {
    width: 18px;
    height: 18px;
}

/* Hover image filter class for general use */
.hover-img {
    transition: all var(--transition-fast);
}

.hover-img:hover {
    filter: brightness(1.1) contrast(1.05);
    transform: translateY(-2px);
}

/* Pin Button Styling */
.pin-btn {
    flex-shrink: 0;
    min-width: 24px;
    width: 24px;
    height: 24px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 2px !important;
}

.pin-btn img {
    width: 12px;
    height: 12px;
    object-fit: contain;
}

/* Pinned Items Styling */
.pinned-category {
    position: relative;
}

.category-title {
    font-size: 11px;
    font-weight: 700;
    color: #546a7b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 8px 0 8px 0;
    padding: 0 8px;
}

.category-items {
    margin: 0;
    padding: 0 4px 8px 4px;
    align-items: center;
}

.category-items li {
    list-style: none;
    border-left: 2px solid var(--border-color);
    padding: 0px 8px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: left;
    transition: all var(--transition-fast);
}

.category-items li:hover {
    padding-left: 10px;
    border-left: 3px solid var(--text-primary);
    background-color: rgba(98, 146, 158, 0.05);
}

.category-items .sub-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    font-size: 13px;
    margin: 0;
}

.category-items .sub-link:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

.unpin-btn {
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.unpin-btn:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

/* ==========================================================================
   END OF THEME
   ========================================================================== */

/* Professional Enhancements */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(198, 197, 185, 0.1);
}

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

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

/* Smooth transitions for all interactive elements */
a,
button,
input,
select,
textarea {
    transition: all var(--transition-fast);
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Selection styling */
::selection {
    background-color: var(--primary-color);
    color: white;
}

::-moz-selection {
    background-color: var(--primary-color);
    color: white;
}

/* Professional button enhancements */
button {
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 0.3px;
}

button:active {
    transform: scale(0.98);
}

/* Input field professional styling */
input,
textarea,
select {
    font-family: var(--font-family);
}

input:focus,
textarea:focus,
select:focus {
    box-shadow: var(--shadow-focus);
}

/* Link hover effects */
a {
    color: var(--primary-color);
    text-decoration: none;
}

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

/* Professional table styling if used */
table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: rgba(98, 146, 158, 0.05);
    font-weight: 600;
    color: var(--text-primary);
}

/* Smooth page transitions */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ==========================================================================
   PRINT STYLES - Professional Print Output
   ========================================================================== */

@media print {

    /* Reset page margins and setup */
    @page {
        margin: 1.5cm;
        size: A4;
    }

    /* Hide non-content elements */
    #header-container,
    #sidebar-container,
    #footer-container,
    .slideshow-nav,
    .slideshow-indicators,
    .next-slide,
    .prev-slide,
    button,
    .modal,
    .error-bar,
    nav,
    .navigation,
    .sidebar,
    header,
    footer,
    .no-print,
    img[src*="icon"],
    img[src*="svg"],
    img[src*="SVG"],
    img[alt*="Icon"],
    img[alt*="icon"],
    .article-meta,
    .content-table,
    #table-of-contents {
        display: none !important;
    }

    /* Reset body and main container */
    body {
        margin: 0;
        padding: 0;
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.6;
    }

    /* Main content area */
    .main-container,
    .edit1,
    .edit2,
    .cal_page {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Remove all backgrounds and borders for clean print */
    * {
        background: white !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* Keep essential borders for tables and sections */
    table,
    th,
    td {
        border: 1px solid #333 !important;
    }

    /* Typography optimizations */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
        color: black !important;
        margin-top: 1em;
        margin-bottom: 0.5em;
    }

    h1 {
        font-size: 24pt;
        padding-bottom: 0.3em;
    }

    h2 {
        font-size: 18pt;
        padding-bottom: 0.2em;
    }

    h3 {
        font-size: 14pt;
    }

    p,
    li {
        orphans: 3;
        widows: 3;
        font-size: 11pt;
        line-height: 1.6;
        color: black !important;
    }

    /* Remove decorative underlines */
    h2::after {
        display: none !important;
    }

    /* Links - show URL after link text */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }

    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }

    /* Tables */
    table {
        width: 100%;
        border-collapse: collapse;
        page-break-inside: avoid;
        margin: 1em 0;
    }

    th {
        background: #f0f0f0 !important;
        font-weight: bold;
        padding: 8px;
        border: 1px solid #333 !important;
    }

    td {
        padding: 6px 8px;
        border: 1px solid #666 !important;
    }

    thead {
        display: table-header-group;
    }

    tr {
        page-break-inside: avoid;
    }

    /* Images */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
        display: block;
        margin: 1em auto;
    }

    /* Result boxes and important content */
    .result-container,
    .result-box,
    .inj-result-container {
        padding: 1em !important;
        margin: 1em 0 !important;
        page-break-inside: avoid;
    }

    /* Cards and statistics */
    .card-bg {
        padding: 1em !important;
        margin: 0.5em 0 !important;
        page-break-inside: avoid;
    }

    /* Lists */
    ul,
    ol {
        margin: 0.5em 0 0.5em 2em;
    }

    li {
        margin-bottom: 0.3em;
    }

    /* Forms - show values but hide interactive elements */
    input,
    select,
    textarea {
        border: none !important;
        border-bottom: 1px solid #999 !important;
        background: transparent !important;
        padding: 2px 4px !important;
        font-size: 11pt !important;
    }

    /* Labels */
    label {
        font-weight: bold;
        color: black !important;
    }

    /* Hide slideshow controls but keep content */
    .slideshow-wrapper {
        display: block !important;
    }

    .slide {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 1em;
    }

    .slide:not(:first-child) {
        display: none !important;
    }

    /* Grid layouts - convert to single column */
    .grid,
    .grid-cols-1,
    .grid-cols-2,
    .grid-cols-3,
    .md\\:grid-cols-2,
    .md\\:grid-cols-3 {
        display: block !important;
    }

    .grid>* {
        margin-bottom: 1em;
    }

    /* Flex layouts - stack vertically */
    .flex {
        display: block !important;
    }

    /* Page breaks */
    section {
        page-break-inside: avoid;
        margin-bottom: 1.5em;
    }

    /* Title styling for print */
    .title,
    .title2,
    .title3,
    .title4,
    .tool-title,
    .top-h1,
    .cal_page_title,
    .bg-gray-custom {
        padding: 0.5em !important;
        margin: 1em 0 0.5em 0 !important;
        color: black !important;
        page-break-after: avoid;
    }

    /* Calculator and tool containers */
    .calculator-container,
    .tool-container {
        padding: 1em !important;
        margin: 1em 0 !important;
    }

    /* Latest updates section */
    .Latest-Updates {
        page-break-inside: avoid;
    }

    /* Ensure proper contrast */
    .text-muted,
    .text-secondary,
    .text-primary {
        color: black !important;
    }

    /* Remove max-width constraints */
    .max-w-6xl,
    .max-w-4xl,
    .max-w-3xl,
    .max-w-2xl {
        max-width: 100% !important;
    }

    /* Remove margins from main flex container */
    .flex.max-w-6xl.mx-auto {
        margin: 0 !important;
    }

    /* Progress bars - show as static elements */
    .progress-container,
    .progress-bar {
        background: white !important;
    }

    /* History sections */
    .history {
        padding: 1em !important;
        margin: 1em 0 !important;
    }

    /* Remove flex margins */
    .ml-auto {
        margin-left: 0 !important;
    }

    .mt-20 {
        margin-top: 1em !important;
    }

    /* Code blocks if any */
    code,
    pre {
        background: #f5f5f5 !important;
        padding: 0.5em !important;
        font-family: 'Courier New', monospace;
        font-size: 10pt;
        page-break-inside: avoid;
    }

    /* Abbreviations - show title */
    abbr[title]:after {
        content: " (" attr(title) ")";
        font-size: 9pt;
    }

    /* Optimization: Reduce ink usage */
    * {
        -webkit-print-color-adjust: economy;
        print-color-adjust: economy;
    }

    /* Keep important backgrounds */
    .result-container,
    .result-box,
    th,
    .title,
    .bg-gray-custom {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* ==========================================================================
       DRUG PAGES SPECIFIC PRINT STYLES
       ========================================================================== */

    /* Hide right sidebar with calculators and related links */
    .float-right-sidebar,
    .float-right-image,
    #voice-settings,
    #dose-calculator,
    #dilution-calculator,
    #relatedLinks {
        display: none !important;
    }

    /* Hide left sidebar */
    .float-left-sidebar {
        width: 100% !important;
        float: none !important;
    }

    /* Article meta - show date and category, hide voice button */
    .article-meta {
        display: block !important;
        margin-bottom: 1em !important;
        padding: 0.5em !important;
        border: none !important;
    }

    .article-meta p {
        margin: 0.3em 0 !important;
        font-size: 10pt !important;
    }

    /* Hide toggle voice button */
    #toggleVoice,
    #voiceIcon {
        display: none !important;
    }

    /* Table of Contents - show but hide toggle button */
    .content-table {
        border-left: 2px solid #333 !important;
        padding-left: 1em !important;
        margin: 1em 0 !important;
        display: block !important;
    }

    #table-of-contents {
        display: block !important;
    }

    #toc-toggle-icon,
    .content-table button {
        display: none !important;
    }

    .content-table ul {
        list-style: decimal !important;
        padding-left: 1.5em !important;
    }

    .content-table li {
        margin-bottom: 0.4em !important;
        color: black !important;
        cursor: default !important;
    }

    .tab-link {
        text-decoration: none !important;
        color: black !important;
    }

    /* Section headings with IDs */
    h2[id^="scroll-tx"] {
        padding: 0.5em !important;
        margin-top: 1.5em !important;
        page-break-after: avoid;
    }

    /* Content sections */
    .edit1,
    .edit2 {
        max-width: 100% !important;
    }

    .space-y-6>* {
        margin-bottom: 1em !important;
    }

    /* Dividers */
    .border-t,
    .border-b,
    .border-gray-300 {
        margin: 0.5em 0 !important;
    }

    /* Key Point boxes */
    .italic.bg-slate-50,
    .text-sm.italic.bg-slate-50 {
        padding: 0.8em !important;
        margin: 0.8em 0 !important;
        font-style: italic;
        page-break-inside: avoid;
    }

    /* Tables - price and specification tables */
    .price-table,
    .specifications-table {
        width: 100% !important;
        border: 1px solid #333 !important;
        margin: 1em 0 !important;
        page-break-inside: avoid;
    }

    .price-table thead tr,
    .specifications-table thead tr {
        background: #e0e0e0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .price-table th,
    .specifications-table th {
        background: #e0e0e0 !important;
        border: 1px solid #333 !important;
        padding: 8px !important;
        font-weight: bold;
        text-align: left;
    }

    .price-table td,
    .specifications-table td {
        border: 1px solid #666 !important;
        padding: 6px 8px !important;
    }

    .price-table .border-b,
    .specifications-table .border-b {
        border-bottom: 1px solid #999 !important;
    }

    /* Lists in content */
    .list-disc {
        list-style-type: disc !important;
        padding-left: 2em !important;
        margin: 0.8em 0 !important;
    }

    .list-disc li {
        margin-bottom: 0.5em !important;
        line-height: 1.6;
    }

    /* Disclaimer section */
    .border-red-500 {
        padding-left: 0.5em !important;
    }

    .edit-section {
        padding: 1em !important;
        page-break-inside: avoid;
    }

    /* Main content container */
    .con-sec {
        padding: 0 !important;
    }

    /* Remove border styling from main container */
    .edit-m,
    .edit-m1 {
        border: none !important;
    }

    /* Image magnifier container */
    #imageMagnifier {
        page-break-inside: avoid;
        margin: 1em 0 !important;
    }

    #imageMagnifier img {
        max-width: 100% !important;
        height: auto !important;
        display: block;
        margin: 0 auto;
    }

    /* Pills/badges if any */
    .badge,
    .pill {
        padding: 2px 6px !important;
        display: inline-block;
    }

    /* Ensure proper text color throughout */
    .text-gray-500,
    .text-gray-700,
    .text-gray-800 {
        color: #333 !important;
    }

    /* Hide image zoom functionality */
    #myModal,
    .modal-content,
    .close {
        display: none !important;
    }

    /* Proper page title */
    .top-h1 {
        background: white !important;
        padding: 1em 0.5em !important;
        margin-bottom: 1em !important;
    }

    .top-h1 h1 {
        font-size: 22pt !important;
        color: black !important;
        line-height: 1.3;
        margin: 0 !important;
    }

    /* Remove rounded corners for print */
    .rounded,
    .rounded-lg,
    .rounded-l-2xl {
        border-radius: 0 !important;
    }

    /* Optimize font sizes for readability */
    .text-2xl {
        font-size: 18pt !important;
    }

    .text-lg {
        font-size: 14pt !important;
    }

    .text-base {
        font-size: 11pt !important;
    }

    .text-sm {
        font-size: 10pt !important;
    }

    .text-xs {
        font-size: 9pt !important;
    }

    /* Strong/bold emphasis */
    strong {
        font-weight: bold;
        color: black !important;
    }

    /* Remove flex display from wrappers */
    .flex.items-center,
    .flex.flex-col {
        display: block !important;
    }

    /* Space optimizations */
    .mb-2,
    .mb-4,
    .my-3,
    .my-6 {
        margin-bottom: 0.8em !important;
        margin-top: 0.5em !important;
    }

    .pl-4,
    .pr-4,
    .pb-4,
    .pt-4 {
        padding: 0 !important;
    }

    .pl-6 {
        padding-left: 1.5em !important;
    }

    /* Print page breaks for sections */
    h2[id^="scroll-tx12"],
    h2[id^="scroll-tx13"] {
        page-break-before: auto;
    }

    /* Ensure minimum content on page */
    h2,
    h3,
    h4 {
        orphans: 3;
        widows: 3;
    }


    /* Watermark - Repeating Logo pattern across entire page */
    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('/logo.png');
        background-repeat: repeat;
        background-position: center;
        background-size: 300px auto;
        opacity: 0.03;
        z-index: -1;
        pointer-events: none;
        transform: rotate(-45deg) scale(1.5);
        transform-origin: center center;
    }

    /* Watermark - User name text at center */
    body::after {
        content: "kundan1.in";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-45deg);
        font-size: 70pt;
        font-weight: bold;
        color: rgba(0, 0, 0, 0.04);
        z-index: 0;
        pointer-events: none;
        white-space: nowrap;
        font-family: 'Arial', sans-serif;
        letter-spacing: 0.15em;
    }
}