/* Payer List shortcode styles. Ported off the Tailwind CDN classes the old WPBakery
 * Raw Code block relied on - see UI-PLAN.md section 5. Everything below is scoped
 * under .payer-lookup so it can't leak onto/collide with the rest of the page. */

.payer-lookup {
    background: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    border-bottom: 1px solid #e5e7eb;
    flex-grow: 1;
}

.payer-lookup__inner {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 1rem;
}

@media screen and (min-width: 768px) {
    .payer-lookup__inner { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media screen and (min-width: 1024px) {
    .payer-lookup__inner { padding-left: 2rem; padding-right: 2rem; }
}

/* ------------------------------------------------------------------ */
/* Tabs                                                                */
/* ------------------------------------------------------------------ */

.payer-lookup__tabs {
    width: 100%;
    padding: 0.375rem;
    background-color: rgb(243 244 246 / 0.8);
    border-radius: 9999px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
    margin-bottom: 3rem;
}

@media screen and (min-width: 768px) {
    .payer-lookup__tabs { gap: 0; }
}

.payer-lookup .tab-trigger {
    flex: 1 1 0%;
    border: 0;
    background: transparent;
    border-radius: 36px !important;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.payer-lookup .tab-trigger.active {
    background: #fff;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    color: #111827;
}

.payer-lookup .tab-content.hidden {
    display: none;
}

.payer-lookup__tab-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.payer-lookup__title {
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #111827;
    margin: 0 0 1rem;
}

.payer-lookup__intro {
    font-size: 1.125rem;
    line-height: 1.75rem;
    color: #6b7280;
    max-width: 48rem;
    margin: 0 auto;
}

.payer-lookup__intro a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

.payer-lookup__intro a:hover {
    color: #1e40af;
    text-decoration: underline;
}

.payer-lookup .new-line {
    display: block;
    margin-top: 12px;
}

/* ------------------------------------------------------------------ */
/* Body / controls                                                    */
/* ------------------------------------------------------------------ */

.payer-lookup__body > * + * {
    margin-top: 1.5rem;
}

.payer-lookup__controls {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

@media screen and (min-width: 640px) {
    .payer-lookup__controls { flex-direction: row; }
}

.payer-lookup__controls-left {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.payer-lookup__search-wrap {
    position: relative;
    width: 100%;
}

@media screen and (min-width: 640px) {
    .payer-lookup__search-wrap { width: 300px; }
}

.payer-lookup__search-icon {
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.payer-lookup__search-icon svg {
    width: 1rem;
    height: 1rem;
    color: #6b7280;
}

.payer-lookup #searchInput {
    display: flex;
    height: 2.5rem;
    width: 100%;
    border-radius: 0.375rem;
    border: solid 1px #cbd2df;
    background: #fff;
    padding: 0.5rem 0.75rem 0.5rem 33px !important;
    font-size: 0.875rem;
}

.payer-lookup #searchInput:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #0f172a, 0 0 0 4px #fff;
}

.payer-lookup__filter-wrap {
    position: relative;
}

.payer-lookup__filter-menu {
    position: absolute;
    left: 0;
    z-index: 10;
    margin-top: 0.25rem;
    width: 14rem;
    max-height: 16rem;
    overflow-y: auto;
    background: #fff;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
}

.payer-lookup__filter-menu.hidden {
    display: none;
}

.payer-lookup__filter-menu-actions {
    display: flex;
    justify-content: space-between;
    padding: 0 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.payer-lookup__filter-menu-link {
    background: none;
    border: 0;
    padding: 0;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
}

.payer-lookup__filter-menu-link:hover {
    text-decoration: underline;
}

.payer-lookup__filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}

.payer-lookup__filter-item:hover {
    background: #f3f4f6;
}

.payer-lookup__filter-item input[type="checkbox"] {
    cursor: pointer;
}

.payer-lookup__actions {
    display: flex;
    gap: 0.5rem;
}

.payer-lookup__download-wrap {
    position: relative;
}

/* Buttons (Payer Forms / Download Payer List) */

.payer-lookup__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    height: 2.5rem;
    padding: 0 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.payer-lookup__btn svg {
    width: 1rem;
    height: 1rem;
    margin-right: 0.25rem;
}

.payer-lookup__btn--outline {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #2563eb;
}

.payer-lookup__btn--outline:hover {
    background: #f9fafb;
}

/* Payer Forms only shows on Claims/Remits - mirrors the site's own tab-scoped
 * visibility rules. */
.payer-forms-btn { display: none; }
.payer-lookup:has(.tab-trigger[data-tab="claims"].active) .payer-forms-btn,
.payer-lookup:has(.tab-trigger[data-tab="remits"].active) .payer-forms-btn { display: inline-flex; }

.payer-lookup__download-menu {
    position: absolute;
    right: 0;
    z-index: 10;
    margin-top: 0.25rem;
    width: 12rem;
    background: #fff;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    padding: 0.25rem 0;
}

.payer-lookup__download-menu.hidden {
    display: none;
}

.payer-lookup .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}

.payer-lookup .dropdown-item:hover {
    background: #f3f4f6;
}

.payer-lookup .dropdown-item svg {
    width: 1rem;
    height: 1rem;
}

/* ------------------------------------------------------------------ */
/* Loading indicator                                                   */
/* ------------------------------------------------------------------ */

.payer-lookup__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.payer-lookup__loading.hidden {
    display: none;
}

.payer-lookup__loading-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.payer-lookup__loading-inner svg {
    height: 2rem;
    width: 2rem;
    color: #2563eb;
}

.payer-lookup__loading-inner p {
    font-size: 0.875rem;
    color: #4b5563;
    margin: 0;
}

.payer-lookup .animate-spin {
    animation: payer-lookup-spin 1s linear infinite;
}

.payer-lookup__spinner-track {
    opacity: 0.25;
}

.payer-lookup__spinner-head {
    opacity: 0.75;
}

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

.payer-lookup__table-container.is-loading {
    opacity: 0.5;
}

/* ------------------------------------------------------------------ */
/* Table                                                               */
/* ------------------------------------------------------------------ */

.payer-lookup__table-container {
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    background: #fff;
    width: 100%;
    overflow: hidden;
}

@media screen and (max-width: 767px) {
    .payer-lookup__table-container {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
}

.payer-lookup .text-left { text-align: left; }
.payer-lookup .text-center { text-align: center; }

.payer-lookup__table#payerTable {
    border-collapse: collapse !important;
    width: 100% !important;
    caption-side: bottom;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    min-width: 100%;
}

.payer-lookup__table thead tr {
    background-color: hsl(210 40% 96.1%) !important;
    border-bottom: 1px solid hsl(214.3 31.8% 91.4%) !important;
}

.payer-lookup__table thead th {
    background: transparent !important;
    height: 3rem !important;
    padding: 0 1rem !important;
    vertical-align: middle !important;
    font-weight: 500 !important;
    color: #000 !important;
    border-bottom: 1px solid hsl(214.3 31.8% 91.4%) !important;
    font-size: 13px;
}

.payer-lookup__table tbody tr {
    border-bottom: 1px solid hsl(214.3 31.8% 91.4%) !important;
    transition: background-color 0.2s ease !important;
    cursor: pointer;
}

.payer-lookup__table tbody tr:hover {
    background-color: hsl(210 40% 96.1% / 0.5) !important;
}

.payer-lookup__table tbody tr.selected {
    background-color: hsl(210 40% 96.1%) !important;
}

.payer-lookup__table tbody tr:last-child {
    border-bottom: 0 !important;
}

.payer-lookup__table tbody td {
    padding: 1rem !important;
    vertical-align: middle !important;
}

/* Status circle (Enrollment / Attachment / WC-Auto cells) */

.payer-lookup__status-dot-wrap {
    display: flex;
    justify-content: center;
}

.payer-lookup__status-dot {
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    background: #e5e7eb;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.payer-lookup__status-dot.is-active {
    background: #3b82f6;
}

.payer-lookup__status-dot:hover {
    transform: scale(1.1);
}

/* Transaction badge */

.payer-lookup__badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    border: 1px solid transparent;
    background-color: hsl(210 40% 96.1%);
    color: hsl(222.2 47.4% 11.2%);
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Product link */

.payer-lookup__product-link {
    color: #2563eb;
    font-weight: 500;
    text-decoration: none;
}

.payer-lookup__product-link:hover {
    color: #1e40af;
    text-decoration: underline;
}

.payer-lookup__product-plain {
    color: #374151;
}

/* Hide DataTables' own default length/filter controls - the search box above
 * drives filtering instead. */
.payer-lookup .dataTables_length,
.payer-lookup .dataTables_filter {
    display: none !important;
}

/* ------------------------------------------------------------------ */
/* Footer / pagination                                                 */
/* ------------------------------------------------------------------ */

.payer-lookup__footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

@media screen and (min-width: 768px) {
    .payer-lookup__footer { flex-direction: row; }
}

.payer-lookup__pagination-info,
.payer-lookup__pagination-info .dataTables_info {
    font-size: 0.875rem;
    color: #6b7280;
}

.payer-lookup__pagination-controls {
    display: flex;
    align-items: center;
}

.payer-lookup .dataTables_paginate {
    margin-top: 1rem !important;
    display: flex;
    align-items: center;
    gap: 0.125rem;
}

/* CSV/Excel/PDF DataTables buttons are only triggered programmatically by the
   "Download Payer List" dropdown (see payer-list.js) and must never render. */
.payer-lookup .dt-button-hidden {
    display: none !important;
}

.payer-lookup .paginate_button {
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem !important;
    background: #fff;
    color: #6b7280;
    text-decoration: none !important;
    margin: 0 0.125rem !important;
    transition: background-color 0.15s ease;
}

.payer-lookup .paginate_button:first-child { border-radius: 0.375rem 0 0 0.375rem !important; }
.payer-lookup .paginate_button:last-child { border-radius: 0 0.375rem 0.375rem 0 !important; }

.payer-lookup .paginate_button:hover {
    background: #f9fafb;
}

.payer-lookup .paginate_button.current {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
}

.payer-lookup .paginate_button.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.payer-lookup__request {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.payer-lookup__request-label {
    color: #6b7280;
}

/* "Request a new payer" reuses the theme's own .nectar-button/.request-link classes,
 * so its overrides stay theme-scoped rather than living under .payer-lookup. */
a.request-link.nectar-button.small.regular.accent-color.regular-button.download-pdf {
    padding: 0 !important;
    color: black;
    background: none !important;
    font-size: 14px !important;
    line-height: 1 !important;
    font-weight: 600 !important;
    color: rgb(37 99 235 / var(--tw-text-opacity, 1));
    transition: all 0.3s ease;
}

a.request-link.nectar-button.small.regular.accent-color.regular-button.download-pdf span {
    text-decoration: underline;
}

a.request-link.nectar-button.small.regular.accent-color.regular-button.download-pdf:hover {
    top: 0;
    margin-top: 0;
    transform: translateY(-1px) !important;
    box-shadow: none !important;
}

a.request-link.nectar-button.small.regular.accent-color.regular-button.download-pdf:hover span {
    text-decoration: none !important;
}

/* ------------------------------------------------------------------ */
/* Toast                                                               */
/* ------------------------------------------------------------------ */

.payer-lookup__toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 50;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #111827;
    color: #fff;
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2);
    max-width: 20rem;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.payer-lookup__toast.is-visible {
    transform: translateX(0);
}

.payer-lookup__toast-body strong {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.payer-lookup__toast-body p {
    font-size: 0.8125rem;
    color: #d1d5db;
    margin: 0;
}

.payer-lookup__toast-close {
    background: none;
    border: 0;
    color: #9ca3af;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.payer-lookup__toast-close:hover {
    color: #fff;
}

/* ------------------------------------------------------------------ */
/* Layout: prevent this shortcode from being clipped inside a WPBakery
 * 1/4-width column row, same override the raw code carried before.    */
/* ------------------------------------------------------------------ */

.col.span_3.one-fourths.clear-both {
    clear: none;
}

/* ------------------------------------------------------------------ */
/* Mobile                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
    .payer-lookup__table#payerTable {
        min-width: 1000px;
    }

    .payer-lookup__table td {
        white-space: nowrap;
    }

    .payer-lookup__table th,
    .payer-lookup__table td {
        font-size: 0.875rem;
        padding: 0.75rem 0.5rem !important;
    }

    #tableFooter {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .payer-lookup__pagination-info {
        text-align: center;
        order: 1;
    }

    .payer-lookup__pagination-controls {
        order: 2;
        display: flex;
        justify-content: center;
    }

    .payer-lookup .paginate_button {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
        min-width: 2rem;
    }

    #tableFooter > .payer-lookup__request {
        order: 3;
        align-items: center;
        text-align: center;
    }

    /* Controls-left (Search/Filter) and actions (Payer Forms/Download) are two separate
     * flex rows in markup, but on mobile we want Filter and Download paired 50/50 on one
     * row regardless of that grouping. display:contents flattens both wrappers so their
     * children become direct items of this grid, and `order` re-sequences them since DOM
     * order (Search, Filter, Payer Forms, Download) doesn't match the wanted layout. Each
     * wrapper keeps its own `position: relative` (see base styles) so its dropdown menu
     * still anchors correctly once its parent is no longer a real box. */
    .payer-lookup__controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .payer-lookup__controls-left,
    .payer-lookup__actions {
        display: contents;
    }

    .payer-lookup__search-wrap,
    .payer-forms-btn {
        grid-column: 1 / -1;
    }

    .payer-lookup__search-wrap { order: 1; }
    .payer-forms-btn { order: 2; }
    .payer-lookup__filter-wrap { order: 3; }
    .payer-lookup__download-wrap { order: 4; }

    .payer-lookup__filter-wrap,
    .payer-lookup__download-wrap {
        width: 100%;
    }

    .payer-lookup__filter-wrap .payer-lookup__btn,
    .payer-lookup__download-wrap .payer-lookup__btn {
        width: 100%;
    }

    /* The "(N of M)" count crowds out "Filter by Product" at 50% width - just the count is
     * dropped, so the button still reflects an active filter via the checklist itself. */
    .payer-lookup__filter-count {
        display: none;
    }
}

@media (max-width: 480px) {
    .payer-lookup__table th,
    .payer-lookup__table td {
        font-size: 0.8125rem;
        padding: 0.625rem 0.375rem !important;
    }

    .payer-lookup__table#payerTable {
        min-width: 900px;
    }

    .payer-lookup .paginate_button {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
        min-width: 1.75rem;
    }
}
