/**
 * Xcel Peptides Elementor Addons — Lab Reports
 * v1.5.0 — Fronteras.io
 */

.xcel-lr-wrapper { width: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif; }

/* ═══ SEARCH ═══ */
.xcel-lr-search {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.xcel-lr-search-wrap {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #fff;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.xcel-lr-search-wrap:focus-within {
    border-color: #1B3A5C;
    box-shadow: 0 0 0 3px rgba(27, 58, 92, .12);
}

.xcel-lr-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #999;
    pointer-events: none;
}

.xcel-lr-search-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    padding: 12px 16px 12px 44px;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    -webkit-appearance: none;
    appearance: none;
}

.xcel-lr-search-input::placeholder { color: #999; }

/* ═══ FILTERS ═══ */
.xcel-lr-filters {
    margin-bottom: 24px;
    padding: 4px 0;
    overflow: visible;
}

.xcel-lr-filters-scroll {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.xcel-lr-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .3px;
    line-height: 1.4;
    color: #fff;
    background: #1B3A5C;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all .3s ease;
    white-space: nowrap;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.xcel-lr-filter-btn:hover { background: #2E8B57; transform: translateY(-1px); }
.xcel-lr-filter-btn.active { background: #2E8B57; color: #fff; }
.xcel-lr-filter-btn:focus-visible { box-shadow: 0 0 0 3px rgba(46,139,87,.3); }

/* ═══ TOOLBAR ═══ */
.xcel-lr-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.xcel-lr-result-count { font-size: 14px; color: #666; margin: 0; }

/* ═══ GRID ═══ */
.xcel-lr-container { position: relative; }
.xcel-lr-grid { display: grid; gap: 24px; }
.xcel-lr-grid.xcel-lr-cols-2 { grid-template-columns: repeat(2,1fr); }
.xcel-lr-grid.xcel-lr-cols-3 { grid-template-columns: repeat(3,1fr); }
.xcel-lr-grid.xcel-lr-cols-4 { grid-template-columns: repeat(4,1fr); }
.xcel-lr-grid.xcel-lr-cols-5 { grid-template-columns: repeat(5,1fr); }
.xcel-lr-grid.xcel-lr-cols-6 { grid-template-columns: repeat(6,1fr); }

/* ═══ REPORT CARD ═══ */
.xcel-lr-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    transition: opacity .4s ease, transform .4s ease, box-shadow .3s ease;
    padding: 24px 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    text-align: center;
    contain: layout style;
    content-visibility: auto;
    contain-intrinsic-size: auto 200px;
}
.xcel-lr-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,.08);
    transform: translateY(-2px);
    will-change: transform;
}

.xcel-lr-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-grow: 1;
}

/* ═══ CARD ICON ═══ */
.xcel-lr-card-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 12px;
    margin-bottom: 16px;
    transition: background .3s ease, transform .3s ease;
    flex-shrink: 0;
}

.xcel-lr-card-icon svg {
    width: 48px;
    height: 48px;
    color: #1B3A5C;
    fill: none;
    transition: color .3s ease;
}

.xcel-lr-card-icon img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    transition: transform .3s ease;
}

.xcel-lr-card:hover .xcel-lr-card-icon {
    transform: scale(1.05);
}

/* ═══ CARD TEXT ═══ */
.xcel-lr-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px 0;
    line-height: 1.35;
    transition: color .2s ease;
    word-break: break-word;
}
.xcel-lr-card:hover .xcel-lr-card-title { color: #1B3A5C; }

.xcel-lr-card-category {
    font-size: 11px;
    font-weight: 500;
    color: #999;
    text-transform: capitalize;
    letter-spacing: .3px;
    line-height: 1.3;
}

.xcel-lr-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #1B3A5C;
    background: #EBF0F5;
    border-radius: 4px;
    text-transform: uppercase;
    margin-top: 8px;
}

/* ═══ SHOW MORE ═══ */
.xcel-lr-load-more-wrap { display: flex; justify-content: center; margin-top: 30px; }
.xcel-lr-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 40px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #1B3A5C;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all .3s ease;
    letter-spacing: .3px;
    outline: none;
}
.xcel-lr-load-more-btn:hover { background: #2E8B57; transform: translateY(-1px); }
.xcel-lr-load-more-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ═══ LOADING ═══ */
.xcel-lr-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,.7);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}
.xcel-lr-spinner { width: 40px; height: 40px; border: 3px solid #E5E7EB; border-top-color: #1B3A5C; border-radius: 50%; animation: xcel-lr-spin .8s linear infinite; }
@keyframes xcel-lr-spin { to { transform: rotate(360deg); } }

.xcel-lr-no-reports { text-align: center; padding: 60px 20px; color: #999; font-size: 16px; grid-column: 1 / -1; }

/* AJAX animations */
.xcel-lr-grid.is-loading { opacity: .4; pointer-events: none; transition: opacity .2s ease; }
.xcel-lr-grid.is-loaded { animation: xcel-lr-fadeIn .4s ease forwards; }
@keyframes xcel-lr-fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Load more card enter animation */
.xcel-lr-card.xcel-lr-card-enter { opacity: 0; transform: translateY(10px); }

/* ═══ MODAL / LIGHTBOX ═══ */
.xcel-lr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,.8);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .3s ease;
}
.xcel-lr-modal-overlay.is-visible { opacity: 1; }

.xcel-lr-modal-content {
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transform: scale(.95) translateY(10px);
    transition: transform .3s ease;
}
.xcel-lr-modal-overlay.is-visible .xcel-lr-modal-content {
    transform: scale(1) translateY(0);
}

.xcel-lr-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.9);
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    transition: all .2s ease;
    padding: 0;
    color: #666;
}
.xcel-lr-modal-close svg { width: 18px; height: 18px; }
.xcel-lr-modal-close:hover { color: #1a1a1a; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.1); }

.xcel-lr-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    padding: 20px 50px 16px 24px;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.xcel-lr-modal-body {
    flex-grow: 1;
    overflow: auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* ═══ ZOOM CONTAINER ═══ */
.xcel-lr-zoom-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.xcel-lr-zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid #E5E7EB;
    background: #F9FAFB;
    flex-shrink: 0;
}

.xcel-lr-zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    background: #fff;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    cursor: pointer;
    transition: all .2s ease;
    padding: 0;
    line-height: 1;
}
.xcel-lr-zoom-btn:hover { background: #F3F4F6; border-color: #9CA3AF; }
.xcel-lr-zoom-btn.xcel-lr-zoom-reset { width: auto; padding: 0 12px; font-size: 12px; }

.xcel-lr-zoom-level {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    min-width: 40px;
    text-align: center;
}

.xcel-lr-zoom-viewport {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    position: relative;
}

.xcel-lr-zoom-viewport.is-zoomed { cursor: grab; }
.xcel-lr-zoom-viewport.is-panning { cursor: grabbing; }

.xcel-lr-zoom-viewport img {
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    padding: 16px;
    transition: transform .15s ease;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
}

.xcel-lr-zoom-viewport.is-panning img { transition: none; }

.xcel-lr-modal-body iframe {
    width: 100%;
    height: 75vh;
    border: none;
    display: block;
}

.xcel-lr-modal-body .xcel-lr-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #999;
    font-size: 14px;
}

/* PDF fallback link */
.xcel-lr-modal-pdf-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
    text-align: center;
}

.xcel-lr-modal-pdf-fallback svg {
    width: 48px;
    height: 48px;
    color: #1B3A5C;
}

.xcel-lr-modal-pdf-fallback a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #1B3A5C;
    border-radius: 6px;
    text-decoration: none;
    transition: background .3s ease;
}
.xcel-lr-modal-pdf-fallback a:hover { background: #2E8B57; }

/* ═══ RESPONSIVE — TABLET (≤ 1024px) ═══ */
@media (max-width: 1024px) {
    .xcel-lr-grid.xcel-lr-cols-4,
    .xcel-lr-grid.xcel-lr-cols-5,
    .xcel-lr-grid.xcel-lr-cols-6 { grid-template-columns: repeat(3,1fr); }
    .xcel-lr-grid[data-cols-tablet="1"] { grid-template-columns: 1fr; }
    .xcel-lr-grid[data-cols-tablet="2"] { grid-template-columns: repeat(2,1fr); }
    .xcel-lr-grid[data-cols-tablet="3"] { grid-template-columns: repeat(3,1fr); }
    .xcel-lr-grid[data-cols-tablet="4"] { grid-template-columns: repeat(4,1fr); }

    .xcel-lr-filters-scroll { gap: 6px; }
    .xcel-lr-filter-btn { padding: 7px 18px; font-size: 12px; }

    .xcel-lr-card { padding: 20px 12px; }
    .xcel-lr-card-icon { width: 64px; height: 64px; }
    .xcel-lr-card-icon svg, .xcel-lr-card-icon img { width: 40px; height: 40px; }
    .xcel-lr-card-title { font-size: 13px; }

    .xcel-lr-modal-content { max-width: 90vw; }
}

/* ═══ RESPONSIVE — MOBILE (≤ 767px) ═══ */
@media (max-width: 767px) {
    .xcel-lr-grid { grid-template-columns: repeat(2,1fr) !important; gap: 16px 12px; }
    .xcel-lr-grid[data-cols-mobile="1"] { grid-template-columns: 1fr !important; }

    .xcel-lr-card { padding: 16px 10px; transition: none; }
    .xcel-lr-card:hover { transform: none; box-shadow: none; }
    .xcel-lr-card-icon { width: 48px; height: 48px; margin-bottom: 12px; transition: none; }
    .xcel-lr-card-icon svg, .xcel-lr-card-icon img { width: 32px; height: 32px; }
    .xcel-lr-card-title { font-size: 12px; }
    .xcel-lr-card-category { font-size: 10px; }
    .xcel-lr-card-badge { font-size: 9px; padding: 2px 8px; }

    .xcel-lr-filters-scroll { gap: 6px; justify-content: center; }
    .xcel-lr-filter-btn { padding: 6px 14px; font-size: 11px; }

    .xcel-lr-search-wrap { max-width: 100%; }

    .xcel-lr-toolbar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .xcel-lr-load-more-btn { width: 100%; }

    /* Modal: full screen on mobile */
    .xcel-lr-modal-overlay { padding: 10px; }
    .xcel-lr-modal-content { max-width: 100%; max-height: 95vh; border-radius: 8px; }
    .xcel-lr-modal-title { font-size: 15px; padding: 16px 44px 12px 16px; }
    .xcel-lr-modal-body iframe { height: 65vh; }
    .xcel-lr-zoom-viewport img { padding: 8px; }
    .xcel-lr-zoom-controls { padding: 6px 12px; gap: 6px; }
    .xcel-lr-zoom-btn { width: 28px; height: 28px; font-size: 14px; }
    .xcel-lr-zoom-btn.xcel-lr-zoom-reset { padding: 0 8px; font-size: 11px; }
}

/* ═══ RESPONSIVE — SMALL MOBILE (≤ 480px) ═══ */
@media (max-width: 480px) {
    .xcel-lr-card-icon { width: 40px; height: 40px; margin-bottom: 10px; border-radius: 8px; }
    .xcel-lr-card-icon svg, .xcel-lr-card-icon img { width: 24px; height: 24px; }
    .xcel-lr-card-title { font-size: 11px; }
}
