/* ═══════════════════════════════════════════════════════
   Analysis Styles — Manufacturer, Label Change, Regulatory
   Shared .lc- prefixed classes
   ═══════════════════════════════════════════════════════ */

/* ── Animations ── */
@keyframes lcSpin {
    to { transform: rotate(360deg); }
}
@keyframes lcFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes lcPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* ── Search Dropdown ── */
.lc-inline-dropdown {
    position: relative;
    max-width: 56rem;
    margin: 0 auto;
    width: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.06);
    max-height: 360px;
    overflow-y: auto;
    z-index: 50;
    animation: lcFadeIn .2s ease;
}

.lc-inline-dropdown::-webkit-scrollbar {
    width: 6px;
}
.lc-inline-dropdown::-webkit-scrollbar-track {
    background: transparent;
}
.lc-inline-dropdown::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* ── Loading & Spinner ── */
.lc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px 16px;
    font-size: 13px;
    color: #6b7280;
}

.lc-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid #e5e7eb;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: lcSpin .7s linear infinite;
    flex-shrink: 0;
}

/* ── No Results ── */
.lc-no-results {
    padding: 24px 16px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.5;
}

/* ── Drug / Manufacturer Card (search result) ── */
.lc-drug-card {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    background: transparent;
    cursor: pointer;
    transition: background .15s ease;
    font-family: inherit;
}
.lc-drug-card:last-child {
    border-bottom: none;
}
.lc-drug-card:hover {
    background: #f9fafb;
}
.lc-drug-card:active {
    background: #f3f4f6;
}

.lc-drug-name {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lc-drug-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

/* ── Version / Count Badge ── */
.lc-version-count {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #374151;
}

/* ── Pill Bar & Pills ── */
.lc-pill-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.lc-drug-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 999px;
    background: #f9fafb;
    font-size: 13px;
    color: #0f172a;
    animation: lcFadeIn .2s ease;
}

.lc-pill-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.lc-pill-name {
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.lc-pill-mfr {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.lc-pill-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.lc-pill-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

.lc-pill-warning {
    font-size: 12px;
    color: #92400e;
    background: #fef3c7;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #fde68a;
}

/* ── Version Select ── */
.lc-version-select {
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    transition: border-color .15s ease;
    min-width: 100px;
}
.lc-version-select:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

/* ── Analysis Loader ── */
.lc-analysis-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 16px;
    animation: lcFadeIn .3s ease;
}

.lc-loader-icon {
    width: 36px;
    height: 36px;
    border: 3.5px solid #ede9fe;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: lcSpin .8s linear infinite;
}

.lc-loader-text {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}

.lc-loader-sub {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    max-width: 360px;
    line-height: 1.5;
}

/* ── Report Card (main container) ── */
.lc-prec-drug-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    margin-bottom: 16px;
    animation: lcFadeIn .3s ease;
}

.lc-prec-drug-info {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    background: transparent;
}

/* ── Stat Boxes Grid ── */
.lc-prec-stat-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding: 16px 20px;
    background: transparent;
}

.lc-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s ease;
}
.lc-stat-box:hover {
    border-color: #c4b5fd;
    box-shadow: 0 2px 8px rgba(124,58,237,.08);
    transform: translateY(-1px);
}

.lc-stat-num {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.lc-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 4px;
}

/* ── Collapsible Sections ── */
.lc-section {
    margin: 4px 0;
}

.lc-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s ease;
    user-select: none;
}
.lc-section-header:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.lc-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.lc-section-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lc-section-chevron {
    font-size: 12px;
    color: #9ca3af;
    transition: transform .2s ease;
    flex-shrink: 0;
}

.lc-section.open .lc-section-chevron {
    transform: rotate(90deg);
}

.lc-section.open .lc-section-header {
    border-radius: 10px 10px 0 0;
    border-bottom-color: transparent;
}

.lc-section-body {
    display: none;
    padding: 12px 0;
    animation: lcFadeIn .2s ease;
}

.lc-section.open .lc-section-body {
    display: block;
}

/* ── Card-level Toggle ── */
.lc-card-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.lc-card-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s ease;
    flex-shrink: 0;
    margin-top: 2px;
}
.lc-card-toggle:hover {
    background: #f3f4f6;
    color: #374151;
}

.lc-card-chevron {
    transition: transform .2s ease;
}

.lc-prec-drug-card.collapsed .lc-card-body {
    display: none;
}

.lc-prec-drug-card.collapsed .lc-card-chevron {
    transform: rotate(-90deg);
}

.lc-card-body {
    border-top: 1px solid #f3f4f6;
}

/* ── Sections inside card ── */
.lc-card-sections {
    padding: 8px 16px 16px;
}

/* ── Inspection classification explanation ── */
.lc-class-meaning {
    font-size: 11px;
    color: #6b7280;
    padding: 2px 14px 6px;
    line-height: 1.4;
    font-style: italic;
}

/* ── Sub-cards (inspections, citations, compliance, recalls, refusals, submissions) ── */
.lc-sub-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #ffffff;
    overflow: hidden;
    transition: box-shadow .15s ease, border-color .15s ease;
    animation: lcFadeIn .25s ease;
}
.lc-sub-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    border-color: #d1d5db;
}

.lc-sub-card.crl {
    border-left: 3px solid #dc2626;
    background: #fffbfb;
}

.lc-sub-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
}

.lc-sub-date {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

.lc-sub-type {
    font-size: 11px;
    font-weight: 700;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.lc-sub-desc {
    flex: 1;
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
    min-width: 0;
}

.lc-sub-status {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.lc-sub-crl {
    background: #fee2e2;
    color: #991b1b;
}

.lc-sub-approved {
    background: #dcfce7;
    color: #166534;
}

.lc-sub-priority {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f5f3ff;
    color: #7c3aed;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ── Document Link Pills ── */
.lc-sub-card-docs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 14px 10px;
}

.lc-doc-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #374151;
    text-decoration: none;
    transition: all .15s ease;
    cursor: pointer;
    white-space: nowrap;
}
.lc-doc-pill:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.lc-doc-icon {
    font-size: 12px;
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 6px;
    transition: all .15s ease;
}
.lc-doc-icon:hover {
    opacity: .85;
}

/* ── Link Buttons ── */
.lc-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border: 1.5px solid #c4b5fd;
    border-radius: 8px;
    background: #f5f3ff;
    color: #7c3aed;
    text-decoration: none;
    transition: all .15s ease;
    cursor: pointer;
    white-space: nowrap;
}
.lc-link-btn:hover {
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 2px 8px rgba(124,58,237,.2);
}

/* ── Source Note ── */
.lc-source-note {
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
    padding: 12px 0 4px;
    line-height: 1.5;
}

/* ── Precedent Links Row ── */
.lc-precedent-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

/* ── Submissions List (Regulatory) ── */
.lc-submissions-list {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin: 12px 0;
}
.lc-submissions-list::-webkit-scrollbar {
    width: 6px;
}
.lc-submissions-list::-webkit-scrollbar-track {
    background: transparent;
}
.lc-submissions-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.lc-sub-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    transition: background .1s ease;
}
.lc-sub-row:last-child {
    border-bottom: none;
}
.lc-sub-row:hover {
    background: #f9fafb;
}
.lc-sub-row.crl {
    background: #fef2f2;
    border-left: 3px solid #dc2626;
}
.lc-sub-row.crl:hover {
    background: #fee2e2;
}

/* ── CRL Expand / Toggle ── */
.lc-crl-expand {
    width: 100%;
    margin-top: 8px;
}

.lc-crl-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all .15s ease;
}
.lc-crl-toggle:hover {
    background: #f3f4f6;
    color: #374151;
}

.lc-crl-text {
    display: none;
    margin-top: 8px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 12px;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
}

.lc-crl-expand.open .lc-crl-text {
    display: block;
    animation: lcFadeIn .2s ease;
}

/* ── Label Change: Version Comparison ── */
.lc-version-info {
    padding: 12px 0;
}

.lc-drug-header {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.lc-mfr {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
}

.lc-single-version {
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    color: #374151;
}

.lc-version-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 12px 0;
}

.lc-version-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 14px 16px;
    transition: border-color .15s ease;
}
.lc-version-box:hover {
    border-color: #d1d5db;
}

.lc-version-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 8px;
}

.lc-version-dropdown {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
}
.lc-version-dropdown:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}

.lc-compare-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #ffffff;
    cursor: pointer;
    transition: all .2s ease;
    margin-top: 8px;
}
.lc-compare-btn:hover {
    background: linear-gradient(135deg, #6d28d9, #5b21b6);
    box-shadow: 0 4px 12px rgba(124,58,237,.25);
    transform: translateY(-1px);
}
.lc-compare-btn:active {
    transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .lc-prec-stat-boxes {
        grid-template-columns: repeat(3, 1fr);
    }
    .lc-stat-num {
        font-size: 20px;
    }
    .lc-version-pair {
        grid-template-columns: 1fr;
    }
    .lc-pill-name {
        max-width: 160px;
    }
    .lc-pill-mfr {
        max-width: 120px;
    }
    .lc-sub-card-header {
        padding: 8px 10px;
    }
    .lc-inline-dropdown {
        max-height: 280px;
    }
}

@media (max-width: 480px) {
    .lc-prec-stat-boxes {
        grid-template-columns: repeat(2, 1fr);
    }
    .lc-stat-num {
        font-size: 18px;
    }
    .lc-precedent-links {
        flex-direction: column;
    }
}
