/**
 * CRC Warriors - Article Detail page
 * Extracted from inline <style> in article-detail.php (G2 Sub-lote 5A)
 * Theme: Multi-color (teal/violet/pink/amber/green) for scientific content
 */

/* ===== CSS Variables =====
 * Las 21 variables de page_theme_map.php (entrada 'article-detail.php').
 * Preservar nombres EXACTOS — el admin puede sobrescribir desde DB.
 */
:root {
    --amber: #f59e0b;
    --amber-dark: #d97706;
    --amber-light: #fbbf24;
    --bg-amber-soft: #fffbeb;
    --bg-card: #ffffff;
    --bg-green-soft: #f0fdf4;
    --bg-pink-soft: #fdf2f8;
    --bg-teal-soft: #f0fdfa;
    --bg-violet-soft: #f5f3ff;
    --blue: #3b82f6;
    --border-color: #e2e8f0;
    --green: #10b981;
    --green-dark: #065f46;
    --pink: #ec4899;
    --teal: #0d9488;
    --teal-dark: #065f46;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --violet: #8b5cf6;
    --violet-dark: #7c3aed;
    --violet-light: #a78bfa;
}

.article-header {
        background: linear-gradient(135deg, var(--teal) 0%, var(--violet-dark) 50%, var(--pink) 100%);
        color: white;
        padding: 50px 0;
        margin-bottom: 30px;
        position: relative;
        overflow: hidden;
    }
    
    .article-header::before {
        content: "";
        position: absolute;
        top: -50%;
        right: -20%;
        width: 60%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
        animation: float 15s ease-in-out infinite;
        pointer-events: none;
    }
    
    @keyframes float {
        0%, 100% { transform: translate(0, 0) rotate(0deg); }
        50% { transform: translate(20px, -20px) rotate(5deg); }
    }
    
    .article-card {
        background: white;
        border-radius: 20px;
        padding: 35px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.08);
        margin-bottom: 25px;
        border: 1px solid var(--border-color);
    }
    
    .article-title {
        font-size: 1.6rem;
        font-weight: 800;
        color: var(--text-dark);
        line-height: 1.4;
        background: linear-gradient(135deg, var(--teal), var(--violet-dark));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .article-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
        margin: 25px 0;
        padding: 20px 0;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
    }
    
    .meta-item {
        display: flex;
        align-items: center;
        gap: 8px;
        color: var(--text-muted);
        font-size: 0.9rem;
    }
    
    .meta-item i {
        color: var(--violet);
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 1.15rem;
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 15px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .section-title i {
        font-size: 1.2rem;
        color: var(--violet);
    }
    
    .abstract-text {
        color: #374151;
        line-height: 1.9;
        font-size: 1rem;
    }
    
    .abstract-text .abstract-paragraph {
        margin-bottom: 1.25rem;
        text-align: justify;
    }
    
    .abstract-text .abstract-paragraph:last-child {
        margin-bottom: 0;
    }
    
    .abstract-text strong.text-primary {
        color: var(--teal) !important;
        font-weight: 600;
        text-transform: uppercase;
        font-size: 0.9em;
        letter-spacing: 0.5px;
    }
    
    .abstract-text sup {
        font-size: 0.7em;
        color: #9ca3af;
    }
    
    .ai-summary {
        background: linear-gradient(135deg, var(--bg-teal-soft) 0%, var(--bg-violet-soft) 50%, var(--bg-pink-soft) 100%);
        border-left: 4px solid var(--violet);
        padding: 25px;
        border-radius: 0 16px 16px 0;
        margin-bottom: 25px;
    }
    
    .ai-summary-title {
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 700;
        color: var(--violet);
        margin-bottom: 12px;
        font-size: 1.1rem;
    }
    
    .ai-summary-title i {
        font-size: 1.3rem;
    }
    
    .ai-summary p {
        color: #374151;
        line-height: 1.8;
    }
    
    .tag-badge {
        display: inline-block;
        padding: 6px 14px;
        border-radius: 25px;
        font-size: 0.8rem;
        font-weight: 600;
        margin: 4px;
        transition: all 0.2s;
    }
    
    .tag-badge:hover {
        transform: translateY(-2px);
    }
    
    .gene-badge {
        background: linear-gradient(135deg, var(--bg-amber-soft), #fde68a);
        color: #92400e;
        border: 1px solid var(--amber-light);
    }
    
    .treatment-badge {
        background: linear-gradient(135deg, var(--bg-violet-soft), #ddd6fe);
        color: #5b21b6;
        border: 1px solid var(--violet-light);
    }
    
    .evidence-badge {
        padding: 10px 18px;
        border-radius: 25px;
        font-weight: 700;
        font-size: 0.85rem;
    }
    
    .evidence-1, .evidence-1a, .evidence-1b {
        background: linear-gradient(135deg, #dcfce7, #bbf7d0);
        color: #166534;
        border: 1px solid #4ade80;
    }
    
    .evidence-2, .evidence-2a, .evidence-2b {
        background: linear-gradient(135deg, var(--bg-violet-soft), #ddd6fe);
        color: #5b21b6;
        border: 1px solid var(--violet-light);
    }
    
    .evidence-3, .evidence-4 {
        background: linear-gradient(135deg, var(--bg-amber-soft), #fde68a);
        color: #92400e;
        border: 1px solid var(--amber-light);
    }
    
    .source-link {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 14px 28px;
        background: linear-gradient(135deg, var(--teal), var(--violet-dark));
        color: white;
        border-radius: 12px;
        text-decoration: none;
        font-weight: 600;
        transition: all 0.3s;
        box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    }
    
    .source-link:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
        color: white;
    }
    
    .back-link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: white;
        text-decoration: none;
        opacity: 0.9;
        font-weight: 500;
        transition: all 0.2s;
    }
    
    .back-link:hover {
        opacity: 1;
        color: white;
        transform: translateX(-3px);
    }
    
    .sidebar-card {
        background: white;
        border-radius: 20px;
        padding: 25px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.08);
        margin-bottom: 20px;
        border: 1px solid var(--border-color);
        transition: all 0.3s;
    }
    
    .sidebar-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 15px 50px rgba(0,0,0,0.12);
    }
    
    .sidebar-title {
        font-weight: 700;
        color: var(--text-dark);
        margin-bottom: 15px;
        padding-bottom: 12px;
        border-bottom: 2px solid transparent;
        border-image: linear-gradient(135deg, var(--teal), var(--violet-dark), var(--pink)) 1;
        display: flex;
        align-items: center;
    }
    
    .sidebar-title i {
        font-size: 1.2rem;
    }
    
    .icon-teal { color: var(--teal); }
    .icon-violet { color: var(--violet); }
    .icon-pink { color: var(--pink); }
    
    .disclaimer-card {
        background: linear-gradient(135deg, var(--bg-amber-soft) 0%, var(--bg-pink-soft) 100%);
        border: 1px solid var(--amber-light);
    }
    
    .info-card {
        background: linear-gradient(135deg, var(--bg-teal-soft) 0%, var(--bg-violet-soft) 100%);
        border: 1px solid var(--violet-light);
    }
    
    .subscription-card {
        background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 50%, var(--bg-pink-soft) 100%);
        border: 2px solid var(--blue);
        position: relative;
        overflow: hidden;
    }
    
    .subscription-card::before {
        content: "";
        position: absolute;
        top: -50%;
        right: -30%;
        width: 100%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
        pointer-events: none;
    }
    
    .subscription-card .sidebar-title {
        color: #1e40af;
    }
    
    .subscription-card .btn-subscribe {
        background: linear-gradient(135deg, var(--blue), var(--violet));
        border: none;
        color: white;
        font-weight: 600;
        padding: 10px 20px;
        border-radius: 10px;
        width: 100%;
        transition: all 0.3s;
    }
    
    .subscription-card .btn-subscribe:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 20px rgba(59, 130, 246, 0.4);
    }
    
    .subscription-card .btn-subscribed {
        background: linear-gradient(135deg, var(--green), var(--green-dark));
    }
    
    .subscription-card .btn-subscribed:hover {
        box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
    }
    
    .subscription-frequency {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .subscription-frequency .form-check {
        flex: 1;
        background: rgba(255,255,255,0.7);
        padding: 8px 12px;
        border-radius: 8px;
        margin: 0;
    }
    
    .subscription-frequency .form-check-input:checked {
        background-color: var(--blue);
        border-color: var(--blue);
    }
    
    .header-badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: rgba(255,255,255,0.2);
        backdrop-filter: blur(10px);
        padding: 8px 16px;
        border-radius: 25px;
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 15px;
    }
    
    /* Translation pending banner — shown when article has no ES translation yet.
       Beast translator (crc-translator.py) traduce de noche; el banner avisa del lag. */
    .translation-pending-banner {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 6px 14px;
        background: #FAEEDA;
        color: #854F0B;
        border-radius: 20px;
        font-size: 0.82rem;
        font-weight: 500;
        margin-bottom: 16px;
    }
    .translation-pending-banner i {
        font-size: 0.9rem;
    }
    
    /* ===== Article Content Tabs ===== */
    .article-content-tabs {
        margin-top: 5px;
    }
    
    .content-tab-nav {
        display: flex;
        gap: 0;
        border-bottom: 2px solid var(--border-color);
        margin-bottom: 0;
    }
    
    .content-tab-btn {
        padding: 12px 24px;
        border: none;
        background: none;
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--text-muted);
        cursor: pointer;
        position: relative;
        transition: color 0.3s;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .content-tab-btn:hover {
        color: var(--text-muted);
    }
    
    .content-tab-btn.active {
        color: var(--violet);
    }
    
    .content-tab-btn.active::after {
        content: \'\';
        position: absolute;
        bottom: -2px;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(135deg, var(--teal), var(--violet));
        border-radius: 3px 3px 0 0;
    }
    
    .content-tab-btn .tab-badge {
        font-size: 0.65rem;
        padding: 2px 8px;
        border-radius: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .tab-badge-oa {
        background: linear-gradient(135deg, var(--bg-green-soft), #a7f3d0);
        color: var(--teal-dark);
    }
    
    .tab-badge-fetch {
        background: linear-gradient(135deg, var(--bg-violet-soft), #ddd6fe);
        color: #5b21b6;
    }
    
    .content-tab-panel {
        display: none;
        padding-top: 20px;
    }
    
    .content-tab-panel.active {
        display: block;
    }
    
    /* Full text content styling */
    .fulltext-content {
        color: #374151;
        line-height: 1.9;
        font-size: 1rem;
    }
    
    .fulltext-content .fulltext-section-title {
        font-size: 1.15rem;
        font-weight: 700;
        color: var(--teal);
        margin-top: 28px;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 2px solid transparent;
        border-image: linear-gradient(135deg, var(--teal), var(--violet-dark)) 1;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .fulltext-content .fulltext-subsection-title {
        font-size: 1.05rem;
        font-weight: 600;
        color: var(--violet);
        margin-top: 22px;
        margin-bottom: 10px;
    }
    
    .fulltext-content .fulltext-paragraph {
        margin-bottom: 1.1rem;
        text-align: justify;
    }
    
    .fulltext-content sup {
        font-size: 0.7em;
        color: #9ca3af;
    }
    
    .fulltext-source-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 14px;
        border-radius: 20px;
        font-size: 0.75rem;
        font-weight: 600;
        background: linear-gradient(135deg, var(--bg-violet-soft), #ddd6fe);
        color: #5b21b6;
        border: 1px solid var(--violet-light);
    }
    
    .fulltext-meta {
        display: flex;
        align-items: center;
        gap: 15px;
        flex-wrap: wrap;
        margin-bottom: 20px;
        font-size: 0.85rem;
        color: var(--text-muted);
    }
    
    .fulltext-loading {
        text-align: center;
        padding: 60px 20px;
    }
    
    .fulltext-loading .spinner-border {
        width: 2.5rem;
        height: 2.5rem;
        color: var(--violet);
    }
    
    .fulltext-loading p {
        margin-top: 15px;
        color: var(--text-muted);
        font-size: 0.9rem;
    }
    
    .fulltext-unavailable {
        text-align: center;
        padding: 40px 20px;
        color: var(--text-muted);
    }
    
    .fulltext-unavailable i.bi-lock {
        font-size: 2.5rem;
        color: var(--amber);
        display: block;
        margin-bottom: 12px;
    }

    /* Key Metrics Chips */
    .key-metrics {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 16px 0 20px;
        padding: 14px 16px;
        background: linear-gradient(135deg, rgba(13,148,136,0.04), rgba(124,58,237,0.04));
        border-radius: 12px;
        border: 1px solid rgba(13,148,136,0.12);
    }
    .metric-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 5px 12px;
        border-radius: 20px;
        font-size: 0.82rem;
        font-weight: 600;
        background: white;
        border: 1px solid var(--border-color);
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
        transition: transform 0.15s, box-shadow 0.15s;
        cursor: default;
    }
    .metric-chip:hover {
        transform: translateY(-1px);
        box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    }
    .metric-chip i {
        font-size: 0.9rem;
    }
    .metric-chip .metric-label {
        color: var(--text-muted);
        font-weight: 500;
    }
    .metric-chip .metric-value {
        font-weight: 700;
    }
    [data-theme="dark"] .key-metrics {
        background: linear-gradient(135deg, rgba(13,148,136,0.08), rgba(124,58,237,0.08));
        border-color: rgba(13,148,136,0.2);
    }
    [data-theme="dark"] .metric-chip {
        background: var(--bg-secondary, #1e293b);
        border-color: var(--border-color, #334155);
    }

    /* Patient Implications Section */
    .patient-implications {
        margin: 20px 0;
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid rgba(236,72,153,0.15);
        background: linear-gradient(135deg, rgba(236,72,153,0.03), rgba(139,92,246,0.03));
    }
    .implications-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 20px;
        background: linear-gradient(135deg, rgba(236,72,153,0.08), rgba(139,92,246,0.08));
        border-bottom: 1px solid rgba(236,72,153,0.1);
    }
    .implications-header i {
        font-size: 1.3rem;
        color: var(--pink);
    }
    .implications-header h3 {
        font-size: 0.95rem;
        font-weight: 700;
        margin: 0;
        color: #be185d;
    }
    .implications-header .badge-ai {
        font-size: 0.65rem;
        padding: 2px 8px;
        border-radius: 10px;
        background: linear-gradient(135deg, var(--pink), var(--violet));
        color: white;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    .implications-body {
        padding: 18px 20px;
    }
    .implications-body p {
        font-size: 0.92rem;
        line-height: 1.7;
        color: #374151;
        margin-bottom: 10px;
    }
    .implications-body p:last-child {
        margin-bottom: 0;
    }
    .implications-body strong {
        color: var(--violet);
    }
    .implications-disclaimer {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid rgba(236,72,153,0.1);
        font-size: 0.78rem;
        color: #9ca3af;
    }
    .implications-disclaimer i {
        color: var(--amber);
        flex-shrink: 0;
        margin-top: 1px;
    }
    .btn-generate-implications {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 14px 20px;
        border: 2px dashed rgba(236,72,153,0.25);
        border-radius: 12px;
        background: transparent;
        color: #be185d;
        font-weight: 600;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all 0.2s;
    }
    .btn-generate-implications:hover {
        background: rgba(236,72,153,0.05);
        border-color: rgba(236,72,153,0.4);
        transform: translateY(-1px);
    }
    .btn-generate-implications:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }
    .btn-generate-implications .spinner-border {
        width: 1rem;
        height: 1rem;
    }
    [data-theme="dark"] .patient-implications {
        border-color: rgba(236,72,153,0.2);
        background: linear-gradient(135deg, rgba(236,72,153,0.06), rgba(139,92,246,0.06));
    }
    [data-theme="dark"] .implications-header {
        background: linear-gradient(135deg, rgba(236,72,153,0.12), rgba(139,92,246,0.12));
    }
    [data-theme="dark"] .implications-header h3 { color: #f472b6; }
    [data-theme="dark"] .implications-body p { color: #d1d5db; }
    [data-theme="dark"] .btn-generate-implications { color: #f472b6; }

    /* ===== GLOSSARY TOOLTIPS ===== */
    .glossary-term {
        border-bottom: 1.5px dotted var(--violet);
        cursor: help;
        color: inherit;
        transition: background 0.2s;
    }
    .glossary-term:hover {
        background: rgba(139,92,246,0.08);
        border-radius: 2px;
    }
    #glossaryTooltip {
        display: none;
        position: fixed;
        background: #1e1b4b;
        color: #e0e7ff;
        padding: 10px 14px;
        border-radius: 10px;
        font-size: 0.82rem;
        line-height: 1.5;
        width: 300px;
        max-width: 90vw;
        z-index: 9999;
        box-shadow: 0 8px 24px rgba(0,0,0,0.3);
        pointer-events: none;
    }
    #glossaryTooltip .gt-term {
        font-weight: 700;
        color: #a5b4fc;
        margin-bottom: 4px;
        font-size: 0.85rem;
    }
    @media (max-width: 768px) {
        #glossaryTooltip { width: 260px; font-size: 0.78rem; }
    }

    /* ===== RELATED TRIALS SECTION ===== */
    .related-trials {
        background: linear-gradient(135deg, rgba(13,148,136,0.04), rgba(59,130,246,0.04));
        border: 1px solid rgba(13,148,136,0.15);
        border-radius: 16px;
        padding: 20px 24px;
        margin: 20px 0;
    }
    .related-trials-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 16px;
    }
    .related-trials-header h3 {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--text-dark);
        margin: 0;
    }
    .related-trials-header .badge-count {
        background: var(--teal);
        color: white;
        font-size: 0.72rem;
        padding: 2px 8px;
        border-radius: 10px;
        font-weight: 600;
    }
    .trial-link-card {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px 16px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        margin-bottom: 10px;
        text-decoration: none;
        color: inherit;
        transition: all 0.2s;
    }
    .trial-link-card:hover {
        border-color: var(--teal);
        box-shadow: 0 2px 12px rgba(13,148,136,0.12);
        transform: translateY(-1px);
        text-decoration: none;
        color: inherit;
    }
    .trial-link-card .trial-phase {
        flex-shrink: 0;
        width: 52px;
        height: 52px;
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 0.72rem;
        line-height: 1.2;
        text-align: center;
    }
    .trial-phase-recruiting { background: rgba(16,185,129,0.12); color: var(--green-dark); }
    .trial-phase-active { background: rgba(59,130,246,0.12); color: #2563eb; }
    .trial-phase-other { background: rgba(107,114,128,0.12); color: #6b7280; }
    .trial-link-card .trial-info { flex: 1; min-width: 0; }
    .trial-link-card .trial-title {
        font-size: 0.88rem;
        font-weight: 600;
        color: var(--text-dark);
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .trial-link-card .trial-meta {
        display: flex;
        gap: 10px;
        margin-top: 4px;
        font-size: 0.75rem;
        color: var(--text-muted);
    }
    .trial-link-card .trial-nct {
        font-family: monospace;
        font-size: 0.73rem;
        color: var(--teal);
        font-weight: 600;
    }
    .trial-link-card .trial-arrow {
        flex-shrink: 0;
        color: var(--teal);
        font-size: 1.1rem;
    }
    .trial-relation-tag {
        font-size: 0.65rem;
        padding: 1px 6px;
        border-radius: 6px;
        font-weight: 600;
    }
    .tag-auto { background: rgba(245,158,11,0.12); color: var(--amber-dark); }
    .tag-gene { background: rgba(13,148,136,0.12); color: var(--teal); }
    .tag-manual { background: rgba(139,92,246,0.12); color: var(--violet-dark); }
    [data-theme="dark"] .related-trials {
        background: linear-gradient(135deg, rgba(13,148,136,0.08), rgba(59,130,246,0.08));
        border-color: rgba(13,148,136,0.25);
    }
    [data-theme="dark"] .trial-link-card { background: var(--bg-card); }

    /* ===== SEND TO ONCOLOGIST ===== */
    .btn-send-doctor {
        background: linear-gradient(135deg, var(--violet), #6d28d9);
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 8px;
        font-weight: 600;
        font-size: 0.88rem;
        display: flex;
        align-items: center;
        gap: 6px;
        transition: all 0.2s;
    }
    .btn-send-doctor:hover {
        background: linear-gradient(135deg, var(--violet-dark), #5b21b6);
        color: white;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(139,92,246,0.3);
    }
    .send-doctor-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        backdrop-filter: blur(4px);
    }
    .send-doctor-modal {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: var(--bg-card, white);
        border-radius: 20px;
        padding: 28px;
        width: 520px;
        max-width: 92vw;
        max-height: 85vh;
        overflow-y: auto;
        z-index: 9999;
        box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    }
    .send-doctor-modal h3 {
        font-size: 1.15rem;
        font-weight: 700;
        margin-bottom: 4px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .send-doctor-modal .modal-subtitle {
        font-size: 0.85rem;
        color: var(--text-muted);
        margin-bottom: 20px;
    }
    .send-doctor-modal label {
        font-weight: 600;
        font-size: 0.85rem;
        margin-bottom: 4px;
        display: block;
    }
    .send-doctor-modal input,
    .send-doctor-modal textarea {
        width: 100%;
        padding: 10px 14px;
        border: 1.5px solid var(--border-color);
        border-radius: 10px;
        font-size: 0.9rem;
        margin-bottom: 14px;
        background: var(--bg-main, #f9fafb);
        color: var(--text-dark);
    }
    .send-doctor-modal textarea { resize: vertical; min-height: 80px; }
    .send-doctor-modal input:focus,
    .send-doctor-modal textarea:focus {
        outline: none;
        border-color: var(--violet);
        box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
    }
    .sd-preview {
        background: rgba(139,92,246,0.04);
        border: 1px solid rgba(139,92,246,0.15);
        border-radius: 12px;
        padding: 14px;
        margin-bottom: 16px;
        font-size: 0.82rem;
        line-height: 1.5;
        color: var(--text-muted);
        max-height: 200px;
        overflow-y: auto;
    }
    .sd-preview strong { color: var(--text-dark); }
    .sd-actions {
        display: flex;
        gap: 10px;
        justify-content: flex-end;
    }
    .sd-actions .btn-cancel {
        padding: 10px 20px;
        border: 1.5px solid var(--border-color);
        background: transparent;
        border-radius: 10px;
        font-weight: 600;
        cursor: pointer;
        color: var(--text-muted);
    }
    .sd-actions .btn-send {
        padding: 10px 24px;
        background: linear-gradient(135deg, var(--violet), #6d28d9);
        color: white;
        border: none;
        border-radius: 10px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .sd-actions .btn-send:hover { background: linear-gradient(135deg, var(--violet-dark), #5b21b6); }
    .sd-actions .btn-copy-email {
        padding: 10px 20px;
        background: linear-gradient(135deg, var(--teal), #0f766e);
        color: white;
        border: none;
        border-radius: 10px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    .sd-success {
        text-align: center;
        padding: 20px;
    }
    .sd-success i {
        font-size: 3rem;
        color: var(--green);
        display: block;
        margin-bottom: 12px;
    }
    .register-prompt-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        backdrop-filter: blur(4px);
    }
    .register-prompt-modal {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: var(--bg-card, white);
        border-radius: 20px;
        padding: 32px;
        width: 400px;
        max-width: 90vw;
        z-index: 9999;
        box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        text-align: center;
    }
    .register-prompt-modal i.main-icon {
        font-size: 3rem;
        color: var(--violet);
        display: block;
        margin-bottom: 14px;
    }
    .register-prompt-modal h4 {
        font-weight: 700;
        margin-bottom: 8px;
    }
    .register-prompt-modal p {
        color: var(--text-muted);
        font-size: 0.9rem;
        margin-bottom: 20px;
        line-height: 1.5;
    }
    .register-prompt-modal .btn-register {
        display: inline-block;
        background-color: var(--violet-dark);
        color: white;
        padding: 12px 28px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 0.95rem;
        text-decoration: none;
        border: none;
        cursor: pointer;
        transition: all 0.2s;
    }
    .register-prompt-modal .btn-register:hover {
        background-color: #6d28d9;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(139,92,246,0.3);
        color: white;
    }
    .register-prompt-modal .btn-close-prompt {
        display: block;
        margin-top: 12px;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 0.82rem;
        cursor: pointer;
    }


/* ============================================================
 * G2 Sub-lote 5A — Clases utility para reemplazar inline styles
 * Prefijo `art-` (article-detail).
 * Algunos inline styles permanecen porque tienen valores dinámicos
 * PHP (ej: style="color: <?= $metric['color'] ?>") o porque JS los
 * manipula con .style.display.
 * ============================================================ */

/* --- Caja de candado "Inicia sesión" para AI explanations --- */
.art-locked-box {
    text-align: center;
    padding: 15px 20px;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 12px;
    border: 1px dashed rgba(37, 99, 235, 0.3);
}
.art-locked-icon {
    font-size: 1.3rem;
    color: #2563eb;
}
.art-locked-text {
    margin: 8px 0 0;
    color: #64748b;
    font-size: 0.9rem;
}
.art-locked-link {
    color: #2563eb;
    font-weight: 600;
}

/* --- Caja de candado grande para fulltext --- */
.art-locked-box-lg {
    text-align: center;
    padding: 30px 20px;
}
.art-locked-icon-lg {
    font-size: 2rem;
    color: #2563eb;
}
.art-locked-text-lg {
    margin: 12px 0 0;
    color: #64748b;
    font-size: 0.95rem;
}

/* --- Iconos coloreados (related trials, send doctor) --- */
.art-icon-clipboard-teal {
    font-size: 1.2rem;
    color: #0d9488;
}
.art-icon-clipboard-gray {
    font-size: 1.2rem;
    color: #6b7280;
}
.art-icon-violet {
    color: #8b5cf6;
}

/* --- Borde discontinuo en related-trials/trial-link-card --- */
.art-border-dashed {
    border-style: dashed;
}

/* --- Tamaño NCT pequeño en trial cards --- */
.art-trial-nct-sm {
    font-size: 0.9rem;
}

/* --- Botón "send doctor" deshabilitado (gating registro) --- */
.art-btn-disabled {
    opacity: 0.85;
}

/* --- Source link gradients (PubMed / Full text) --- */
.art-source-pubmed {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.art-source-fulltext {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* --- Personalize Score sidebar card --- */
.art-personalize-card {
    border: 1px solid rgba(236, 72, 153, 0.2);
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.03), rgba(139, 92, 246, 0.03));
}
.art-personalize-emoji {
    font-size: 1.1rem;
}
.art-pr-bar-track {
    background: #f1f5f9;
    border-radius: 8px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}
.art-pr-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ec4899, #8b5cf6);
    border-radius: 8px;
}
.art-pr-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}

/* --- Tags genes/mutaciones de personalización --- */
.art-tag-gene {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(13, 148, 136, 0.12);
    color: #0d9488;
    font-weight: 600;
}
.art-tag-mut {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.12);
    color: #7c3aed;
    font-weight: 600;
}

/* --- Personalize "tu perfil" card (CTA registro) --- */
.art-personalize-cta-card {
    border: 1px dashed rgba(139, 92, 246, 0.3);
}
.art-personalize-cta-btn {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: white;
    font-weight: 600;
    border: none;
}

/* --- Línea de autores con line-height 1.8 --- */
.art-authors-line {
    line-height: 1.8;
}

/* --- Asterisco rojo de campo requerido --- */
.art-required-asterisk {
    color: #ef4444;
}

/* --- Botón cancelar Send Doctor (margen superior) --- */
.art-btn-cancel-mt {
    margin-top: 12px;
}

/* --- Icono de error grande (toast/modal) --- */
.art-error-icon-lg {
    font-size: 2.5rem;
    color: #ef4444;
    display: block;
    margin-bottom: 12px;
}
