/*
 * medication-trials.css — Ensayos clínicos para una medicación específica
 *
 * Variables :root (paleta home base):
 *   --teal      → azul home oscuro  (#0056a3)
 *   --violet    → azul oscuro       (#1e40af)
 *   --blue      → azul              (#3b82f6)
 *   --amber     → ámbar warning     (#f59e0b)
 *   --green     → verde success     (#10b981)
 *   Slate neutros: #1e293b → #f8fafc
 *
 * Iconos semánticos:
 *   .trend-up   → verde   (incremento)
 *   .trend-down → rojo    (descenso)
 *   .trend-flat → ámbar   (estable)
 *
 * Rediseño cromático luminoso:
 *   Hero:         azul cielo → azul brillante → cyan luminoso (no oscuro)
 *   Stat cards:   cada categoría con su color (verde/cyan/púrpura/azul/ámbar/gris)
 *   Filter pills: gradients luminosos (azul→cyan, cyan→azul) cuando activos
 *   Trial cards:  border-left con color semántico vivo
 *   Tendencia:    barras cyan→azul medio (vivaz)
 */
    :root {
        --amber: #f59e0b;
        --amber-dark: #d97706;
        --bg-amber-soft: #fffbeb;
        --bg-blue-soft: #eff6ff;
        --bg-body: #f8fafc;
        --bg-red-soft: #fef2f2;
        --bg-subtle: #f1f5f9;
        --bg-teal-soft: #eff6ff;
        --bg-violet-soft: #eff6ff;
        --blue: #3b82f6;
        --border-color: #e2e8f0;
        --green: #10b981;
        --green-dark: #065f46;
        --primary: #1e293b;
        --primary-dark: #0f172a;
        --teal: #0056a3;
        --text-primary: #1e293b;
        --text-secondary: #64748b;
        --violet: #1e40af;
    }

/* ===== Hero Section ===== */
.medication-hero {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 40%, #06b6d4 75%, #22d3ee 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.medication-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.medication-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.medication-hero .lead {
    opacity: 0.9;
    font-size: 1.1rem;
}

.hero-badge {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 1rem;
    backdrop-filter: blur(10px);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    color: var(--teal);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--violet);
}

/* ===== Medication Info Card ===== */
.medication-info-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.medication-info-card h5 {
    color: #2563eb;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-body);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.info-item i {
    color: var(--violet);
    font-size: 1.1rem;
    margin-top: 2px;
}

.info-item strong {
    color: #334155;
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--teal), #1e40af);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stat-card.recruiting::before { background: linear-gradient(90deg, #10b981, #059669); }
.stat-card.active::before     { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.stat-card.completed::before  { background: linear-gradient(90deg, #94a3b8, #64748b); }
.stat-card.enrollment::before { background: linear-gradient(90deg, #8b5cf6, #a855f7); }
.stat-card.total::before      { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.stat-card.countries::before  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.stat-number {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--teal), #1e40af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card.recruiting .stat-number {
    background: linear-gradient(135deg, #10b981, #059669);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card.active .stat-number {
    background: linear-gradient(135deg, #06b6d4, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card.completed .stat-number {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card.enrollment .stat-number {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card.total .stat-number {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card.countries .stat-number {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Filter Tabs ===== */
.filter-section {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.filter-tab {
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover {
    border-color: var(--violet);
    color: var(--violet);
}

.filter-tab.active {
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: white;
    border-color: transparent;
}

.filter-tab .count {
    background: rgba(255,255,255,0.2);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

.filter-tab:not(.active) .count {
    background: var(--bg-subtle);
}

/* ===== Trial Cards ===== */
.trials-container {
    min-height: 200px;
}

.trial-card {
    background: white;
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.25s ease;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--border-color);
}

.trial-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.trial-card.recruiting { border-left-color: #10b981; }
.trial-card.active { border-left-color: #06b6d4; }
.trial-card.completed { border-left-color: #94a3b8; }
.trial-card.upcoming { border-left-color: var(--amber); }

.trial-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

a.trial-title, .trial-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b !important;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.2s;
}

a.trial-title:hover, .trial-title:hover {
    color: var(--teal) !important;
}

.trial-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.badge-nct {
    background: #f1f5f9;
    color: var(--text-secondary);
    padding: 0.25rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: 'Monaco', 'Consolas', monospace;
    border: 1px solid #e2e8f0;
}

.badge-phase {
    background: #f1f5f9;
    color: var(--text-primary);
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.badge-status {
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-status.recruiting {
    background: #dcfce7;
    color: #166534;
}

.badge-status.active {
    background: #dbeafe;
    color: #1e40af;
}

.badge-status.completed {
    background: #f1f5f9;
    color: #475569;
}

.badge-status.upcoming {
    background: #fef3c7;
    color: #92400e;
}

.badge-enrollment {
    background: var(--bg-violet-soft);
    color: var(--violet);
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.trial-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.trial-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.trial-meta-item i {
    color: var(--text-secondary);
}

.trial-medications {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.med-badge {
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.med-badge.current {
    background: var(--teal);
    color: white;
}

.med-badge.other {
    background: var(--bg-subtle);
    color: var(--text-secondary);
}

.med-badge.other:hover {
    background: var(--violet);
    color: white;
}

.trial-description {
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
    margin-bottom: 0.6rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #e2e8f0;
}

.trial-location {
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
}

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

.trial-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-view {
    background: var(--text-primary);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.25s;
}

.btn-view:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    color: white;
}

.btn-external {
    background: white;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-color);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.25s;
}

.btn-external:hover {
    background: #f8fafc;
    color: var(--teal);
    border-color: var(--teal);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.empty-state i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.empty-state h4 {
    color: #334155;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* ===== Back Navigation ===== */
.back-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0 3rem;
}

.btn-back {
    background: white;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-back:hover {
    border-color: var(--violet);
    color: var(--violet);
}

.btn-primary-gradient {
    background: var(--teal);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 86, 163, 0.3);
    color: white;
}

/* ===== Phase Filter Pills ===== */
.phase-filter-section {
    background: white;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.phase-filter-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.25rem;
    white-space: nowrap;
}

.phase-pill {
    padding: 0.35rem 0.9rem;
    border-radius: 8px;
    border: 1.5px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.phase-pill:hover {
    border-color: var(--violet);
    color: var(--violet);
}

.phase-pill.active {
    background: linear-gradient(135deg, #06b6d4, #2563eb);
    color: white;
    border-color: transparent;
}

.phase-pill .count {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 0.25rem;
}

.phase-pill.active .count {
    opacity: 0.9;
}

/* ===== Efficacy Data Section ===== */
.efficacy-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.efficacy-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.efficacy-title i { color: var(--teal); }

.efficacy-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.efficacy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
}

.efficacy-card {
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.2s;
    background: var(--bg-body);
}

.efficacy-card:hover {
    border-color: var(--teal);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.efficacy-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
}

.efficacy-mutation {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.efficacy-evidence {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.evidence-A { background: #dcfce7; color: #166534; }
.evidence-B { background: #dbeafe; color: #1e40af; }
.evidence-C { background: var(--bg-amber-soft); color: #92400e; }
.evidence-D { background: var(--bg-red-soft); color: #991b1b; }
.evidence-other { background: var(--bg-subtle); color: var(--text-secondary); }

.efficacy-metrics {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.efficacy-metric {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.4rem 0.65rem;
    text-align: center;
    min-width: 70px;
    flex: 1;
}

.efficacy-metric-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.2;
}

.efficacy-metric-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.efficacy-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.efficacy-card-footer a {
    color: var(--teal);
    font-weight: 600;
    text-decoration: none;
}

.efficacy-card-footer a:hover {
    text-decoration: underline;
}

.efficacy-more-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--teal);
    text-decoration: none;
}

.efficacy-more-link:hover {
    text-decoration: underline;
}

/* ===== Scientific Articles Section ===== */
.articles-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.articles-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.articles-title i { color: var(--violet); }

.article-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bg-subtle);
    text-decoration: none;
    transition: all 0.15s;
}

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

.article-item:hover {
    background: var(--bg-body);
    margin: 0 -0.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    border-radius: 8px;
}

.article-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--bg-blue-soft);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal);
    font-size: 0.9rem;
    margin-top: 2px;
}

.article-content { flex: 1; min-width: 0; }

.article-item-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-item:hover .article-item-title { color: #1e293b; }

.article-item-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 3px;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.articles-more-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--teal);
    text-decoration: none;
}

.articles-more-link:hover { text-decoration: underline; }

/* ===== Related Medications ===== */
.related-meds-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.related-meds-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-meds-title i {
    color: var(--teal);
}

.related-meds-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.related-med-chip {
    display: inline-flex;
    flex-direction: column;
    background: var(--bg-body);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 0.6rem 1rem;
    text-decoration: none;
    transition: all 0.2s;
    min-width: 140px;
}

.related-med-chip:hover {
    border-color: var(--teal);
    background: var(--bg-blue-soft);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.related-med-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.related-med-chip:hover .related-med-name {
    color: var(--teal);
}

.related-med-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.related-med-targets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 4px;
}

.shared-target-tag {
    background: #dbeafe;
    color: var(--primary-dark);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}

/* ===== Drug Interactions Section ===== */
.interactions-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.interactions-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.interactions-title i { color: var(--color-red-dark); }

.interactions-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.interaction-card {
    border-radius: 10px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.6rem;
    border-left: 4px solid;
    transition: all 0.2s;
}

.interaction-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.interaction-card.major {
    background: #fef2f2;
    border-left-color: var(--color-red-dark);
}

.interaction-card.contraindicated {
    background: #fef2f2;
    border-left-color: #7f1d1d;
}

.interaction-card.moderate {
    background: #fffbeb;
    border-left-color: var(--amber-dark);
}

.interaction-card.minor {
    background: #f0fdf4;
    border-left-color: #16a34a;
}

.interaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.interaction-drugs {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary);
}

.interaction-severity {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-major { background: var(--bg-red-soft); color: #991b1b; }
.severity-contraindicated { background: #7f1d1d; color: #ffffff; }
.severity-moderate { background: var(--bg-amber-soft); color: #92400e; }
.severity-minor { background: #dcfce7; color: #166534; }

.interaction-type-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    margin-left: 6px;
}

.interaction-desc {
    font-size: 0.83rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.4rem;
}

.interaction-recommendation {
    font-size: 0.78rem;
    color: var(--text-primary);
    background: rgba(255,255,255,0.7);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    margin-top: 0.3rem;
}

.interaction-recommendation strong {
    color: var(--primary-dark);
}

.interaction-source {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

.interaction-toggle {
    background: none;
    border: none;
    color: var(--teal);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.interaction-toggle:hover { text-decoration: underline; }

.interaction-details { display: none; }
.interaction-details.show { display: block; }

/* ===== Trial Trend Chart ===== */
.trend-section {
    background: white;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.trend-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trend-title i { color: #f59e0b; }

.trend-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    min-height: 60px;
    padding-top: 0.5rem;
}

.trend-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.trend-bar {
    width: 100%;
    max-width: 32px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #22d3ee, #2563eb);
    transition: all 0.3s;
    min-height: 2px;
    position: relative;
}

.trend-bar:hover {
    opacity: 0.8;
    transform: scaleY(1.05);
    transform-origin: bottom;
}

.trend-bar-count {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.trend-bar-wrap:hover .trend-bar-count { opacity: 1; }

.trend-bar-year {
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-top: 3px;
    transform: rotate(-45deg);
    white-space: nowrap;
}

.trend-insight {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-body);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trend-insight i { color: var(--teal); font-size: 1rem; }

/* ===== Trial Map Section ===== */
.trial-map-section {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.trial-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.trial-map-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trial-map-title i { color: var(--teal); }

.trial-map-toggle {
    background: none;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.trial-map-toggle:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.trial-map-container {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.trial-map-container iframe {
    display: block;
    width: 100%;
    height: 400px;
    border: none;
}

.trial-map-legend {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.trial-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.recruiting { background: var(--blue); }

/* ===== Eligibility Check Inline ===== */
.btn-eligibility {
    background: white;
    color: var(--green-dark);
    border: 2px solid var(--green-dark);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-eligibility:hover {
    background: var(--green-dark);
    color: white;
}

.btn-eligibility:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.eligibility-inline {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.eligibility-inline.likely { background: #ecfdf5; border: 1px solid #a7f3d0; }
.eligibility-inline.possible { background: #fffbeb; border: 1px solid #fde68a; }
.eligibility-inline.unlikely { background: #fef2f2; border: 1px solid #fecaca; }
.eligibility-inline.unknown { background: var(--bg-body); border: 1px solid var(--border-color); }

.eligibility-inline-score {
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1;
    min-width: 50px;
    text-align: center;
}

.eligibility-inline.likely .eligibility-inline-score { color: var(--green-dark); }
.eligibility-inline.possible .eligibility-inline-score { color: var(--amber-dark); }
.eligibility-inline.unlikely .eligibility-inline-score { color: var(--color-red-dark); }
.eligibility-inline.unknown .eligibility-inline-score { color: var(--text-secondary); }

.eligibility-inline-text {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.eligibility-inline-text strong {
    display: block;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.eligibility-inline-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--teal);
    text-decoration: none;
    white-space: nowrap;
}

.eligibility-inline-link:hover { text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .medication-hero h1 {
        font-size: 1.75rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .trial-header {
        flex-direction: column;
    }
    
    .filter-tabs {
        flex-direction: column;
    }
    
    .filter-tab {
        width: 100%;
        text-align: center;
    }
}

/* ===== Clases auxiliares (extraídas de inline styles) ===== */

/* Detalles de interacción medicamentosa (texto pequeño slate) */
.interaction-detail-line {
    font-size: 0.8rem;
    color: #475569;
    margin: 0.4rem 0 0.2rem;
}

.interaction-detail-line + .interaction-detail-line {
    margin: 0.2rem 0;
}

/* Iconos de tendencia en estadísticas (semánticos) */
.trend-icon-up    { color: #059669; }   /* verde — incremento */
.trend-icon-down  { color: #dc2626; }   /* rojo — descenso */
.trend-icon-flat  { color: #d97706; }   /* ámbar — estable */

/* Etiqueta secundaria pequeña en filtros (slate) */
.filter-label-secondary {
    color: #64748b;
    font-size: 0.85rem;
}

/* Botón de eligibility cuando no se está logueado */
.btn-eligibility-link {
    text-decoration: none;
}
