/**
 * Health.AI SEO Directory — Shared Directory Styles
 * Mayo Clinic + PubMed inspired clinical design
 * Fonts: Source Serif 4 (headings) + Source Sans 3 (body)
 */

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

body {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: #2d3748;
    background-color: #fafbfc;
}

/* Ensure readable font size */
p, li, td, dd {
    font-size: 16px;
    line-height: 1.75;
}

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

h1 {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: #1b2a4a;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

h2 {
    font-family: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    font-size: 1.625rem;
    font-weight: 600;
    color: #1b2a4a;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    letter-spacing: -0.01em;
}

h3 {
    font-family: 'Source Sans 3', -apple-system, sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-family: 'Source Sans 3', -apple-system, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a5568;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

/* ============================================================
   NAVBAR CUSTOMIZATION
   ============================================================ */

.navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.navbar-brand {
    font-size: 1.25rem;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: #4a5568 !important;
    padding: 0.5rem 0.75rem !important;
    transition: color 0.15s ease;
}

.nav-link:hover {
    color: #0057b8 !important;
}

.dropdown-menu {
    font-size: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    overflow: hidden;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    background-color: #edf2ff;
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */

.breadcrumb {
    font-size: 13px;
    padding: 0;
    margin: 0;
}

.breadcrumb a {
    color: #0057b8;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #adb5bd;
    font-size: 11px;
}

/* ============================================================
   CARDS & SECTIONS
   ============================================================ */

.condition-card,
.med-card,
.directory-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    background: #fff;
}

.condition-card:hover,
.med-card:hover,
.directory-card:hover {
    box-shadow: 0 8px 30px rgba(0,87,184,0.08);
    border-color: #b8d4f0;
    transform: translateY(-2px);
}

.condition-card a,
.med-card a,
.directory-card a {
    text-decoration: none;
    color: inherit;
}

.condition-card h3,
.med-card h3,
.directory-card h3 {
    color: #0057b8;
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    border: none;
    padding: 0;
}

/* ============================================================
   HERO SECTION (Condition Hub)
   ============================================================ */

.hero-section {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 50%, #edf5ff 100%);
    padding: 2.5rem;
    border-radius: 20px;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    color: #1b2a4a;
    margin-bottom: 0.5rem;
}

.hero-section .also-known-as {
    color: #6c757d;
    font-size: 14px;
    font-style: italic;
}

.hero-section .hero-summary {
    font-size: 1.1rem;
    color: #4a5568;
    margin: 1rem 0;
}

/* Stats bar */
.stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
}

.stat-item i {
    font-size: 14px;
}

/* Reviewed badge */
.reviewed-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 13px;
    color: #059669;
    background: #ecfdf5;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
}

/* ============================================================
   QUICK FACTS CARD
   ============================================================ */

.quick-facts {
    background: #fff;
    border: 2px solid #d0e3f5;
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.quick-facts h3 {
    color: #0057b8;
    font-size: 1.1rem;
    margin-top: 0;
    border: none;
    padding: 0;
}

.quick-facts dl {
    margin: 0;
}

.quick-facts dt {
    color: #0057b8;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-top: 0.75rem;
}

.quick-facts dd {
    margin-left: 0;
    font-size: 15px;
    color: #2d3748;
}

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

.toc-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc-sidebar h6 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

.toc-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-sidebar li {
    margin-bottom: 0.25rem;
}

.toc-sidebar a {
    display: block;
    padding: 0.4rem 0.75rem;
    font-size: 13px;
    color: #6c757d;
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: all 0.15s ease;
}

.toc-sidebar a:hover {
    color: #0057b8;
    background: #f5f8ff;
    border-left-color: #0057b8;
}

.toc-sidebar a.active {
    color: #0057b8;
    font-weight: 500;
    background: #edf2ff;
    border-left-color: #0057b8;
}

/* ============================================================
   CALLOUT BOXES
   ============================================================ */

.callout {
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border-left: 4px solid;
}

.callout-warning {
    background: #fffbeb;
    border-color: #e6a817;
}

.callout-danger {
    background: #fef2f2;
    border-color: #dc2626;
}

.callout-info {
    background: #edf2ff;
    border-color: #0057b8;
}

.callout-success {
    background: #ecfdf5;
    border-color: #059669;
}

.callout h4 {
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

/* ============================================================
   FAQ ACCORDION
   ============================================================ */

.faq-section .accordion-item {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border: 1px solid #e2e8f0;
}

.faq-section .accordion-button {
    font-weight: 500;
    font-size: 15px;
    color: #2d3748;
}

.faq-section .accordion-button:not(.collapsed) {
    background: #edf2ff;
    color: #0057b8;
}

.faq-section .accordion-body {
    font-size: 15px;
    color: #4a5568;
}

/* ============================================================
   A-Z INDEX
   ============================================================ */

.az-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 1.5rem;
}

.az-filter a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    background: #edf2f7;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.az-filter a:hover,
.az-filter a.active {
    background: #0057b8;
    color: #fff;
}

.az-filter a.disabled {
    color: #d1d5db;
    background: #f7f8fa;
    pointer-events: none;
}

/* ============================================================
   MEDICATION TABLE
   ============================================================ */

.med-table {
    font-size: 14px;
}

.med-table th {
    background: #f1f5f9;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    border-bottom: 2px solid #e2e8f0;
}

.med-table td {
    vertical-align: middle;
}

.med-table tr:nth-child(even) {
    background-color: #fafbfc;
}

.med-table a {
    color: #0057b8;
    text-decoration: none;
}

.med-table a:hover {
    text-decoration: underline;
}

/* ============================================================
   SEVERITY BADGES
   ============================================================ */

.severity-mild { background: #d4edda; color: #155724; border-radius: 12px; padding: 0.25rem 0.75rem; }
.severity-moderate { background: #fff3cd; color: #856404; border-radius: 12px; padding: 0.25rem 0.75rem; }
.severity-severe { background: #f8d7da; color: #721c24; border-radius: 12px; padding: 0.25rem 0.75rem; }
.severity-life-threatening { background: #721c24; color: #fff; border-radius: 12px; padding: 0.25rem 0.75rem; }

/* ============================================================
   PATIENT STORIES
   ============================================================ */

.story-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.25s ease;
}

.story-card:hover {
    box-shadow: 0 4px 16px rgba(0,87,184,0.06);
}

.story-card .story-meta {
    font-size: 13px;
    color: #6c757d;
}

/* ============================================================
   CHAT WIDGET
   ============================================================ */

.chat-message {
    margin-bottom: 1rem;
}

.chat-bubble {
    position: relative;
}

.chat-message.user .chat-bubble {
    background: #0057b8 !important;
    color: #fff;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 0.5rem;
}

.chat-typing span {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    animation: chatBounce 1.4s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

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

@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .hero-section {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .hero-section h1 {
        font-size: 1.75rem;
    }

    .stats-bar {
        gap: 0.5rem;
    }

    .stat-item {
        font-size: 12px;
        padding: 0.35rem 0.75rem;
    }

    .toc-sidebar {
        position: static;
        max-height: none;
    }

    .az-filter a {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .callout {
        padding: 1.25rem;
    }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */

@media print {
    .navbar, .directory-sidebar, #health-ai-chat-widget,
    .chat-widget, footer, .breadcrumb, .toc-sidebar {
        display: none !important;
    }

    body { font-size: 12pt; }
    h1 { font-size: 18pt; }
    h2 { font-size: 14pt; }
}
