/* =====================================================
   CRC Warriors — Drug Glossary (medications.php)
   Refactor 23-abr-2026 — Paso 1 de Opción B

   Cambios:
   • CSS extraído de inline a archivo externo
   • Paleta armonizada con homepage.css: cyan + azules + amber
     (antes: teal + violet + pink, desalineado con el resto del site)
   • Tokens de texto, border, bg-body heredan de theme-variables.css
     endurecido (ratio AA 15:1 en todos los textos)
   ===================================================== */

/* =====================================================
   Paleta local de medications — armonizada con homepage.css
   (azules, cianes, amber). No sobrescribimos los tokens
   globales de texto/border/fondo base — esos heredan del
   theme-variables.css endurecido.
   ===================================================== */
:root {
    /* ===== Brand blues & cyans ===== */
    --cyan:              #0891b2;  /* ex-teal principal */
    --cyan-light:        #06b6d4;  /* ex-teal-light */
    --cyan-dark:         #0e7490;  /* ex-teal-dark */
    --cyan-accent:       #06b6d4;  /* ex-pink: dianas moleculares en modal */
    --cyan-accent-light: #67e8f9;  /* ex-pink-light */

    --blue-medium:       #2563eb;  /* ex-violet */
    --blue-light:        #3b82f6;  /* ex-violet-light / ex-primary / ex-blue */
    --blue-deep:         #1d4ed8;  /* ex-primary-dark */
    --blue-dark:         #003d7a;  /* navy de home, para hero */

    /* ===== Amber accent (unchanged, como en home) ===== */
    --amber:             #f59e0b;
    --amber-light:       #fbbf24;

    /* ===== Status/feedback colors ===== */
    --green:             #10b981;
    --green-light:       #34d399;
    --green-dark:        #065f46;
    --red-light:         #f87171;

    /* ===== Soft backgrounds (badges, alerts) ===== */
    --bg-cyan-soft:      #ecfeff;  /* ex-bg-teal-soft, ex-bg-pink-soft */
    --bg-blue-soft:      #eff6ff;  /* ex-bg-violet-soft */
    --bg-amber-soft:     #fffbeb;  /* unchanged */
    --bg-red-soft:       #fef2f2;  /* unchanged */
}

body { 
    background-color: var(--bg-body); 
    color: var(--text-primary); 
    transition: all 0.3s ease; 
}

/* ===== Hero Section ===== */
.meds-hero {
    background: linear-gradient(135deg, var(--blue-light) 0%, var(--blue-deep) 100%);
    padding: 50px 0;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.meds-hero::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 70%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -20px); }
}

.meds-hero h1 {
    color: white;
    font-weight: 800;
    font-size: 2.2rem;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}

.meds-hero p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
    margin-bottom: 0;
    position: relative;
    z-index: 2;
}

.btn-hero {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.btn-hero:hover {
    background: white;
    color: var(--blue-medium);
    border-color: white;
}

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

.stat-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transform: scaleX(0);
    transition: transform 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.15);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:nth-child(1)::before { background: linear-gradient(90deg, var(--cyan), var(--blue-medium)); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--cyan-accent), var(--cyan-accent-light)); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, var(--cyan), var(--cyan-light)); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, var(--blue-medium), var(--blue-light)); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--blue-medium) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card:nth-child(2) .stat-value {
    background: linear-gradient(135deg, var(--cyan-accent) 0%, var(--cyan-accent-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card:nth-child(3) .stat-value {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-card:nth-child(4) .stat-value {
    background: linear-gradient(135deg, var(--blue-medium) 0%, var(--blue-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 5px;
}

/* ===== Filters Section ===== */
.drug-filters {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 25px;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.drug-filters label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.drug-filters .form-control,
.drug-filters .form-select {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    /* background-color explícito: Firefox usa el color del SO para <select>
       nativo si no se especifica (sale gris en Windows); Chrome/Edge usan
       blanco por defecto. Forzamos blanco para uniformidad cross-browser. */
    background-color: var(--bg-card);
    transition: all 0.3s;
}

.drug-filters .form-control:focus,
.drug-filters .form-select:focus {
    border-color: var(--blue-medium);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ===== Profile Filter ===== */
.profile-banner {
    background: linear-gradient(135deg, #f0fdfa, #ecfdf5);
    border: 2px solid #99f6e4;
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }
.profile-mutation-badge {
    background: #0d9488;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.profile-mutation-badge.msi {
    background: #7c3aed;
}
.profile-filter-btn {
    border-width: 2px;
}
.badge-relevance {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-relevance.high {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}
.badge-relevance.medium {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
}
.badge-relevance.low {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* ===== Alphabet Nav ===== */
.alphabet-nav {
    margin-bottom: 25px;
    text-align: center;
    background: var(--bg-card);
    padding: 15px;
    border-radius: 16px;
    border: 2px solid var(--border-color);
}

.alphabet-nav button {
    margin: 3px;
    min-width: 38px;
    height: 38px;
    font-weight: 700;
    padding: 0;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    transition: all 0.2s;
}

.alphabet-nav button:hover {
    border-color: var(--blue-medium);
    color: var(--blue-medium);
}

.alphabet-nav button.active {
    background: linear-gradient(135deg, var(--blue-medium), var(--blue-light));
    border-color: var(--blue-medium);
    color: white;
}

/* ===== View Toggle ===== */
.view-toggle .btn {
    border-radius: 10px;
    font-weight: 600;
    border: 2px solid var(--border-color);
}

.view-toggle .btn.active {
    background: linear-gradient(135deg, var(--cyan), var(--cyan-light));
    border-color: var(--cyan);
    color: white;
}

/* Hover sobre un botón NO activo: fondo cyan sólido + texto/icono blanco.
   Forzamos color en el <i> además del <button> porque Bootstrap a veces
   no propaga el color al icono en pseudo-estados. */
.view-toggle .btn:hover:not(.active),
.view-toggle .btn:hover:not(.active) i {
    background-color: var(--cyan);
    border-color: var(--cyan);
    color: white;
}

/* ===== Skeleton Loading ===== */
@keyframes shimmer {
    0% { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-body) 25%, var(--border-color) 50%, var(--bg-body) 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite ease-in-out;
    border-radius: 8px;
}

.skeleton-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 15px;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 10px;
}

.skeleton-line-short { width: 40%; }
.skeleton-line-medium { width: 65%; }
.skeleton-line-long { width: 90%; }
.skeleton-line-title { height: 20px; width: 50%; margin-bottom: 14px; }
.skeleton-badge { display: inline-block; width: 80px; height: 24px; border-radius: 6px; margin-right: 8px; }
.skeleton-btn { display: inline-block; width: 90px; height: 32px; border-radius: 10px; margin-right: 8px; margin-top: 10px; }

.grid-view .skeleton-card { padding: 20px; }

.skeleton-table-row td { padding: 14px 12px; }
.skeleton-table-cell { height: 16px; }

/* ===== Regimens Banner ===== */
/* ===== FDA Approval Timeline ===== */
.timeline-section {
    background: white;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

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

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

.timeline-title i { color: var(--blue-light); }

.timeline-toggle {
    background: none;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.timeline-toggle:hover { border-color: var(--blue-light); color: var(--blue-light); }

.timeline-container {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.timeline-container::-webkit-scrollbar { height: 6px; }
.timeline-container::-webkit-scrollbar-track { background: var(--bg-subtle); border-radius: 3px; }
.timeline-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.timeline-track {
    display: flex;
    align-items: flex-end;
    gap: 0;
    min-width: max-content;
    padding: 0.5rem 0 2.5rem;
    position: relative;
}

.timeline-track::before {
    content: "";
    position: absolute;
    bottom: 32px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue-light), var(--blue-medium), #06b6d4);
    border-radius: 2px;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
    position: relative;
    padding-bottom: 0;
}

.timeline-year {
    position: absolute;
    bottom: -22px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-primary);
    background: white;
    padding: 0 4px;
    z-index: 2;
}

.timeline-drug {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.6rem;
    margin-bottom: 22px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    border: 1.5px solid transparent;
    position: relative;
}

.timeline-drug::after {
    content: "";
    position: absolute;
    bottom: -18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    z-index: 1;
}

.timeline-drug:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.timeline-drug-name {
    font-weight: 700;
    font-size: 0.78rem;
    white-space: nowrap;
    line-height: 1.2;
}

.timeline-drug-target {
    font-size: 0.62rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Category colors */
.tl-chemo .timeline-drug { background: var(--bg-amber-soft); }
.tl-chemo .timeline-drug-name { color: #92400e; }
.tl-chemo .timeline-drug::after { background: var(--amber); }

.tl-targeted .timeline-drug { background: var(--bg-blue-soft); }
.tl-targeted .timeline-drug-name { color: #5b21b6; }
.tl-targeted .timeline-drug::after { background: var(--blue-medium); }

.tl-immuno .timeline-drug { background: #ecfdf5; }
.tl-immuno .timeline-drug-name { color: var(--cyan-dark); }
.tl-immuno .timeline-drug::after { background: var(--green); }

.tl-angio .timeline-drug { background: #dbeafe; }
.tl-angio .timeline-drug-name { color: #1e40af; }
.tl-angio .timeline-drug::after { background: var(--blue-light); }

.tl-kinase .timeline-drug { background: var(--bg-cyan-soft); }
.tl-kinase .timeline-drug-name { color: #9d174d; }
.tl-kinase .timeline-drug::after { background: var(--cyan-accent); }

.tl-other .timeline-drug { background: var(--bg-subtle); }
.tl-other .timeline-drug-name { color: var(--text-primary); }
.tl-other .timeline-drug::after { background: var(--text-secondary); }

.regimens-banner {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 25px 30px;
    margin-bottom: 25px;
}
.regimens-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.regimens-title i { color: var(--blue-medium); }
.regimens-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.regimen-chip {
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
    min-width: 140px;
}
.regimen-chip:hover {
    border-color: var(--blue-medium);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37,99,235,0.15);
    color: var(--text-primary);
}
.regimen-chip-name { font-weight: 700; font-size: .95rem; }
.regimen-chip-info { font-size: .75rem; color: var(--text-secondary); margin-top: 2px; }

/* ===== Pagination ===== */
.pagination-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.pagination-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-wrapper button {
    min-width: 36px;
    height: 36px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0 10px;
}

.pagination-wrapper button:hover:not(:disabled) {
    border-color: var(--blue-medium);
    color: var(--blue-medium);
}

.pagination-wrapper button.active {
    background: linear-gradient(135deg, var(--blue-medium), var(--blue-light));
    border-color: var(--blue-medium);
    color: white;
}

.pagination-wrapper button:disabled {
    opacity: 0.4;
    cursor: default;
}

.pagination-wrapper .page-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0 4px;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.page-size-selector select {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* ===== FDA / Route / Target Badges ===== */
.badge-fda {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-fda-approved { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.badge-fda-experimental { background: var(--bg-amber-soft); color: #92400e; border: 1px solid #fcd34d; }
.badge-fda-off_label { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.badge-fda-withdrawn { background: var(--bg-red-soft); color: #991b1b; border: 1px solid var(--red-light); }
.badge-fda-unknown { background: var(--bg-subtle); color: var(--text-secondary); border: 1px solid #cbd5e1; }

.badge-route {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-target {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 5px;
    background: linear-gradient(135deg, var(--bg-blue-soft), #e0e7ff);
    color: #4338ca;
    border: 1px solid #c7d2fe;
    display: inline-block;
    margin: 1px;
    cursor: pointer;
    transition: all 0.2s;
}

.badge-target:hover {
    background: linear-gradient(135deg, #c4b5fd, #a5b4fc);
    color: white;
}

.drug-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}

/* ===== Drug Cards ===== */
.drug-card {
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s;
    background: var(--bg-card);
    position: relative;
    overflow: visible;
}

.drug-card::before {
    content: "";
    position: absolute;
    /* Recortado respecto a las esquinas redondeadas de la card (border-radius
       20px) para evitar que la línea asome fuera por los corners, tanto en
       hover como en mobile. top/bottom = 20px evitan la curva superior e
       inferior; border-radius 2px es acorde al ancho de 4px. */
    top: 20px;
    left: 0;
    width: 4px;
    height: calc(100% - 40px);
    background: linear-gradient(180deg, var(--cyan), var(--blue-medium), var(--cyan-accent));
    transform: scaleY(0);
    transition: transform 0.3s;
    transform-origin: top;
    border-radius: 2px;
}

.drug-card:hover {
    box-shadow: 0 15px 40px rgba(37, 99, 235, 0.15);
    transform: translateY(-4px);
    border-color: var(--blue-medium);
}

.drug-card:hover::before {
    transform: scaleY(1);
}

.drug-card.selected-compare {
    border: 2px solid var(--amber);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

/* Cuando la card está seleccionada para comparar, el borde amber hace el
   trabajo visual — ocultamos la barra lateral del ::before (incluso en
   hover) para que no sobresalga al no cuadrar con el nuevo borde. */
.drug-card.selected-compare::before,
.drug-card.selected-compare:hover::before {
    transform: scaleY(0);
}

.drug-name {
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
    transition: color 0.3s;
}

.drug-card:hover .drug-name {
    color: var(--blue-medium);
}

.drug-generic {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.drug-class {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 10px;
    background: linear-gradient(135deg, var(--bg-cyan-soft), var(--bg-blue-soft));
    color: var(--cyan);
    border: 1px solid var(--cyan);
}

/* ===== Drug Types ===== */
.drug-type {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    margin-right: 5px;
}

.type-chemo { background: linear-gradient(135deg, var(--cyan-accent), var(--cyan-accent-light)); }
.type-targeted { background: linear-gradient(135deg, var(--cyan), var(--cyan-light)); }
.type-immuno { background: linear-gradient(135deg, var(--blue-medium), var(--blue-light)); }
.type-multi { background: linear-gradient(135deg, #6366f1, #818cf8); }
.type-experimental { background: linear-gradient(135deg, var(--amber), var(--amber-light)); }
.type-parp { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.type-other { background: linear-gradient(135deg, var(--text-secondary), var(--text-secondary)); }

.drug-description {
    margin-top: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.pending-description {
    color: #92400e;
    background: linear-gradient(135deg, var(--bg-amber-soft), #fde68a);
    border: 1px solid var(--amber-light);
    padding: 12px 15px;
    border-radius: 12px;
    font-style: italic;
}

/* ===== Trial Count Badge ===== */
.trial-count-badge {
    background: linear-gradient(135deg, var(--blue-medium), var(--blue-light));
    color: white;
    padding: 6px 14px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.trial-count-badge:hover {
    background: linear-gradient(135deg, var(--cyan), var(--cyan-light));
    color: white;
    transform: scale(1.05);
}

/* ===== NEW Badge ===== */
.badge-new {
    background: linear-gradient(135deg, var(--cyan-accent), var(--cyan-accent-light));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    margin-left: 10px;
    animation: pulse 2s infinite;
    display: inline-block;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ===== Action Buttons ===== */
.drug-card .btn-outline-primary {
    border-color: var(--blue-medium);
    color: var(--blue-medium);
    border-radius: 10px;
    font-weight: 600;
}

.drug-card .btn-outline-primary:hover {
    background: linear-gradient(135deg, var(--blue-medium), var(--blue-light));
    border-color: var(--blue-medium);
    color: white;
}

.drug-card .btn-outline-success {
    border-color: var(--cyan);
    color: var(--cyan);
    border-radius: 10px;
    font-weight: 600;
}

.drug-card .btn-outline-success:hover {
    background: linear-gradient(135deg, var(--cyan), var(--cyan-light));
    border-color: var(--cyan);
    color: white;
}

.drug-card .btn-outline-warning {
    border-color: var(--amber);
    color: var(--amber);
    border-radius: 10px;
    font-weight: 600;
}

.drug-card .btn-outline-warning:hover {
    background: linear-gradient(135deg, var(--amber), var(--amber-light));
    border-color: var(--amber);
    color: white;
}

/* ===== Favorite Button ===== */
.favorite-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #cbd5e1;
    transition: all 0.3s;
}

.favorite-btn:hover {
    color: var(--amber);
    transform: scale(1.2);
}

.favorite-btn.active {
    color: var(--amber);
}

/* ===== Grid View ===== */
.list-view .drug-card {
    width: 100%;
    max-width: 100%;
}

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 25px;
}

.grid-view .drug-card {
    margin-bottom: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.grid-view .drug-card .drug-description {
    flex-grow: 1;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-view .drug-card .mt-3 {
    margin-top: auto !important;
}

/* ===== Compare Panel ===== */
.compare-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--blue-medium) 0%, var(--cyan-accent) 100%);
    color: white;
    padding: 18px 25px;
    display: none;
    z-index: 999;
    box-shadow: 0 -8px 30px rgba(37, 99, 235, 0.3);
}

.compare-panel.active {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.compare-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.compare-item {
    background: rgba(255,255,255,0.2);
    padding: 6px 16px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.compare-item .remove {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
}

/* ===== Theme Toggle ===== */
/* ===== Scroll Top Button ===== */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #056401;
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 1000;
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.35);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(13, 148, 136, 0.45);
}

/* ===== Admin Notice ===== */
.admin-notice {
    background: linear-gradient(135deg, var(--blue-medium) 0%, var(--cyan-accent) 100%);
    color: white;
    padding: 18px 25px;
    border-radius: 16px;
    margin-bottom: 25px;
    font-weight: 500;
}

.admin-notice a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

/* ===== Progress Info ===== */
.progress-info {
    background: linear-gradient(135deg, var(--bg-cyan-soft), var(--bg-blue-soft));
    border: 2px solid var(--cyan);
    color: var(--cyan);
    padding: 18px 25px;
    border-radius: 16px;
    margin-bottom: 25px;
    font-weight: 500;
}

.progress-info a {
    color: var(--blue-medium);
    font-weight: 600;
}

/* ===== Mechanism Panel (click-to-toggle inline) ===== */
.mechanism-toggle {
    cursor: pointer;
    color: var(--cyan);
    transition: color 0.2s;
}

.mechanism-toggle:hover {
    color: var(--blue-medium);
}

.mechanism-panel {
    display: none;
    background: linear-gradient(135deg, rgba(6,182,212,0.06), rgba(37,99,235,0.06));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 15px;
    margin-top: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    position: relative;
    animation: panelSlideDown 0.2s ease-out;
}

@keyframes panelSlideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 300px; }
}

.mechanism-panel.open {
    display: block;
}

.mechanism-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.mechanism-panel-header strong {
    color: var(--cyan);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mechanism-panel-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 2px;
    font-size: 1.1rem;
    line-height: 1;
}

.mechanism-panel-close:hover {
    color: var(--text-primary);
}

/* ===== Modal Styling ===== */
.modal-content {
    border-radius: 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 25px;
}

.modal-title {
    font-weight: 800;
    color: var(--text-primary);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 15px 25px;
}

/* ===== Table Styling ===== */
.table {
    color: var(--text-primary);
}

.table thead tr {
    background: linear-gradient(135deg, var(--blue-light) 0%, var(--blue-deep) 100%);
}

.table thead th {
    background: transparent;
    color: white;
    border: none;
    font-weight: 700;
    padding: 15px;
}

.table tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .meds-hero h1 {
        font-size: 1.8rem;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-view {
        grid-template-columns: 1fr;
    }
}
/* =====================================================
   Scroll-top button: botón flotante abajo-derecha.
   Los estilos visuales están aquí (antes estaban inline
   en medications.php). El JS solo togglea display+opacity
   según scrollY; el resto (posición, colores, hover) es
   puramente CSS.
   ===================================================== */
#scrollTopBtn {
    display: none;
    opacity: 0;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--cyan), var(--blue-light));
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.35);
    transition: all 0.3s;
}

#scrollTopBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.5);
}

/* Cuando la barra sticky del comparador está activa
   (sincronizada desde JS en updateComparePanel()),
   subimos el scroll-top para que no tape los botones
   "Comparar" y "Limpiar". */
body.comparing-active #scrollTopBtn {
    bottom: 110px;
}


/* ============================================================
 * G2 Sub-lote 4A — Clases utility para reemplazar inline styles
 * Prefijo `med-` (medications) para evitar colisiones.
 * ============================================================ */

/* --- Botones con border-radius 10px (patrón frecuente) --- */
.med-btn-r10 { border-radius: 10px; }

/* --- Botón gradient azul para CTAs (related trials, export comparison) --- */
.med-btn-gradient-blue {
    background: linear-gradient(135deg, var(--blue-medium), var(--blue-light));
    border: none;
}

/* --- Breadcrumb en hero --- */
.med-breadcrumb-list {
    font-size: .85rem;
    margin-bottom: 0;
}
.med-breadcrumb-link {
    color: var(--blue-light);
    text-decoration: none;
}

/* --- Subtítulo del regimen --- */
.med-regimen-subtitle {
    font-size: .9rem;
}

/* --- Banner de perfil de paciente (icono + texto auxiliar) --- */
.med-profile-icon {
    font-size: 1.2rem;
    color: var(--cyan);
}
.med-profile-hint {
    color: var(--text-muted);
}

/* --- Botón filtro perfil (no rompe línea) --- */
.med-btn-nowrap {
    white-space: nowrap;
}

/* --- Layout flex 1 (ej. dentro de cards de comparación) --- */
.med-flex-1 { flex: 1; }
