/* ==========================================================================
   ADDITIONAL THEME STYLES
   ========================================================================== */

/* Smooth page transitions */
.mfr-content,
.mfr-section-card,
.mfr-quiz {
    animation: mfr-fadeIn 0.4s ease;
}

@keyframes mfr-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Code blocks within content */
.mfr-content code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--mfr-gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--mfr-navy-muted);
}

.mfr-content pre {
    background: var(--mfr-navy);
    color: #e0e0e0;
    padding: var(--space-lg);
    border-radius: var(--border-radius);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    margin: var(--space-lg) 0;
}

.mfr-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Blockquotes */
.mfr-content blockquote {
    border-left: 4px solid var(--mfr-teal);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-lg) 0;
    background: var(--mfr-teal-pale);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: var(--mfr-gray-700);
}

/* Images in content */
.mfr-content img {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin: var(--space-lg) 0;
}

/* Procedure comparison table styling */
.mfr-procedure-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.mfr-procedure-table th {
    background: var(--mfr-navy);
    color: var(--mfr-white);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mfr-procedure-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--mfr-gray-200);
    vertical-align: top;
}

.mfr-procedure-table tr:nth-child(even) td {
    background: var(--mfr-gray-100);
}

.mfr-procedure-table tr:hover td {
    background: var(--mfr-teal-pale);
}

/* Scrollbar styling for TOC */
.mfr-topic-sidebar::-webkit-scrollbar {
    width: 4px;
}

.mfr-topic-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.mfr-topic-sidebar::-webkit-scrollbar-thumb {
    background: var(--mfr-gray-300);
    border-radius: 2px;
}

/* ==========================================================================
   CLAUDE AI ENRICHMENT STYLES
   ========================================================================== */

blockquote.mfr-clinical-note {
    background: #E3F2FD;
    border-left: 4px solid #1976D2;
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-lg) 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: normal;
    font-size: 0.92rem;
    line-height: 1.6;
}

blockquote.mfr-clinical-note strong:first-child { color: #1565C0; }

.mfr-exam-tip {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFF3E0 100%);
    border: 1px solid #FFE082;
    border-left: 4px solid #FFA000;
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-lg) 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-size: 0.92rem;
}

.mfr-exam-tip strong:first-child { color: #E65100; }

.mfr-mnemonic {
    background: linear-gradient(135deg, #F3E5F5 0%, #EDE7F6 100%);
    border: 1px solid #CE93D8;
    border-left: 4px solid #8E24AA;
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-lg) 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-size: 0.92rem;
}

.mfr-mnemonic strong:first-child { color: #6A1B9A; }

.mfr-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #0B1D3A, #1E3A5F);
    color: #4DB6AC;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

@keyframes mfr-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mfr-pipeline-running { animation: mfr-pulse 2s ease-in-out infinite; }

/* Print styles */
@media print {
    .mfr-header,
    .mfr-footer,
    .mfr-topic-sidebar,
    .mfr-quiz__actions,
    .mfr-breadcrumbs,
    .mfr-forum {
        display: none !important;
    }

    .mfr-topic-layout {
        grid-template-columns: 1fr !important;
    }

    .mfr-content {
        box-shadow: none !important;
        padding: 0 !important;
    }
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
.mfr-quiz__option:focus-visible {
    outline: 3px solid var(--mfr-teal-light);
    outline-offset: 2px;
}

/* WordPress admin bar adjustment */
body.admin-bar .mfr-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .mfr-header {
        top: 46px;
    }
}

/* Comment form styling */
.mfr-forum .comment-form label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    font-size: 0.9rem;
}

.mfr-forum .comment-form input[type="text"],
.mfr-forum .comment-form input[type="email"],
.mfr-forum .comment-form textarea {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--mfr-gray-200);
    border-radius: var(--border-radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast);
}

.mfr-forum .comment-form input:focus,
.mfr-forum .comment-form textarea:focus {
    border-color: var(--mfr-teal);
    outline: none;
}

.mfr-forum .comment-form .form-submit {
    margin-top: var(--space-md);
}

/* Loading state */
.mfr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    color: var(--mfr-gray-500);
}

.mfr-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid var(--mfr-gray-200);
    border-top-color: var(--mfr-teal);
    border-radius: 50%;
    animation: mfr-spin 0.8s linear infinite;
    margin-left: var(--space-sm);
}

@keyframes mfr-spin {
    to { transform: rotate(360deg); }
}
