/* =============================================================================
   CPT Listing — shared styles for dispozitii / hcl / proiecte_* pages
   Loaded via wp_enqueue_style('avada-child-cpt-listing') in functions.php
   ============================================================================= */

/* ── Section wrapper ─────────────────────────────────────────────────────── */
.avada-cpt-listing-section { padding: 0 0 0; overflow-x: hidden; }

/* ── Filters form ─────────────────────────────────────────────────────────── */
.avada-cpt-listing-section .avada-child-doc-filters { padding: 0.5rem 0.5rem; margin: 0 0 1.5rem; }
.avada-cpt-listing-section .doc-filters-row { display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 1rem; margin: 0; padding: 0; }
.avada-cpt-listing-section .doc-filter-item { display: flex; flex-direction: column; flex: 0 0 auto; width: auto; gap: 0.3rem; margin: 0; padding: 0; }
.avada-cpt-listing-section .doc-filter-item label { display: block; font-size: 11px; font-weight: 700; color: #555; text-transform: uppercase; letter-spacing: .05em; margin: 0; width: auto; }
.avada-cpt-listing-section .avada-child-doc-filters input[type="text"]   { display: block; width: 130px; height: 36px; padding: 0 10px; border: 1px solid #cecece; background: #fff; font-size: 12px; color: #333; box-sizing: border-box; margin: 0; }
.avada-cpt-listing-section .avada-child-doc-filters input[type="number"] { display: block; width: 80px;  height: 36px; padding: 0 10px; border: 1px solid #cecece; background: #fff; font-size: 12px; color: #333; box-sizing: border-box; margin: 0; }
.avada-cpt-listing-section .avada-child-doc-filters input[type="date"]   { display: block; width: 130px; height: 36px; padding: 0 10px; border: 1px solid #cecece; background: #fff; font-size: 10px; color: #333; box-sizing: border-box; margin: 0; }
.avada-cpt-listing-section .avada-child-doc-filters select               { display: block; width: 130px; height: 36px; padding: 0 10px; border: 1px solid #cecece; background: #fff; font-size: 10px; color: #333; box-sizing: border-box; margin: 0; }
.avada-cpt-listing-section .doc-filter-actions { display: flex; flex-direction: row; align-items: flex-end; flex-wrap: wrap; gap: .5rem; }

/* ── Shared button base ───────────────────────────────────────────────────── */
.avada-cpt-listing-section .avada-child-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 36px; padding: 0 18px;
    font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1;
    text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
    cursor: pointer; text-decoration: none;
    border: none; border-radius: 0; outline: none;
    box-sizing: border-box; vertical-align: middle;
    transition: background-color .2s, color .2s;
    -webkit-appearance: none; appearance: none;
}
.avada-cpt-listing-section .avada-child-btn--filter { background: #222; color: #fff; }
.avada-cpt-listing-section .avada-child-btn--filter:hover { background: #3a7bd5; color: #fff; text-decoration: none; }
.avada-cpt-listing-section .avada-child-btn--reset  { background: #222; color: #fff; padding: 0 8px; border: none; }
.avada-cpt-listing-section .avada-child-btn--reset:hover { background: #3a7bd5; color: #fff; text-decoration: none; }

/* ── Action buttons row (Print / PDF / Excel) ─────────────────────────────── */
.documente-actions { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: flex-end; margin-bottom: 1rem; }
.documente-actions .avada-child-btn,
.documente-actions .avada-child-btn--action,
.documente-actions .pdfprnt-button {
    display: inline-flex; align-items: center; justify-content: center;
    height: 32px !important; padding: 0 14px !important;
    font-size: 11px !important; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; white-space: nowrap; cursor: pointer;
    text-decoration: none; border-radius: 0; outline: none;
    box-sizing: border-box; transition: background-color .2s, color .2s;
    background: #fff; color: #202b50;
    font-family: inherit; -webkit-appearance: none; appearance: none;
}
.documente-actions a:after { color: unset !important; }
.documente-actions a:after:hover { color: #fff !important; }
.documente-actions .avada-child-btn:hover,
.documente-actions .avada-child-btn--action:hover,
.documente-actions .pdfprnt-button:hover { background: #202b50; color: #fff; text-decoration: none; }
.documente-actions .pdfprnt-button img { display: none; }
.documente-actions .pdfprnt-button-print::before { content: '🖨'; margin-right: 6px; font-size: 14px; }
.documente-actions .pdfprnt-button-pdf::before   { content: '📄'; margin-right: 6px; font-size: 14px; }
.documente-actions .avada-child-btn--action.icon-file-excel::before { content: '📊'; margin-right: 6px; font-size: 14px; }
.documente-actions .pdfprnt-button-print::after { content: 'PRINT'; }
.documente-actions .pdfprnt-button-pdf::after   { content: 'PDF'; }
@media print { .documente-actions, .avada-child-doc-filters { display: none !important; } }

/* ── Table ────────────────────────────────────────────────────────────────── */
.avada-cpt-listing-section .avada-child-doc-table-wrap { overflow-x: auto; margin: 0 0 2em; }
.avada-cpt-listing-section .avada-child-doc-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; box-shadow: 0 10px 40px 0 rgba(6,22,58,.10); }
.avada-cpt-listing-section .avada-child-doc-table th,
.avada-cpt-listing-section .avada-child-doc-table td { text-align: center; padding: 6px 10px; vertical-align: middle; border: none; }
.avada-cpt-listing-section .avada-child-doc-table th:first-child,
.avada-cpt-listing-section .avada-child-doc-table td:first-child { text-align: left; }
.avada-cpt-listing-section .avada-child-doc-table th:last-child,
.avada-cpt-listing-section .avada-child-doc-table td:last-child  { text-align: left; }
.avada-cpt-listing-section .avada-child-doc-table thead th { padding-top: 12px; padding-bottom: 8px; font-weight: 700; color: #333; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid #dbdbdb; background: none; }
.avada-cpt-listing-section .avada-child-doc-table tfoot th { padding-top: 8px; padding-bottom: 12px; font-weight: 700; color: #555; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; border-top:    2px solid #dbdbdb; background: none; }
.avada-cpt-listing-section .avada-child-doc-table tbody tr { border-bottom: 1px solid #ebebeb; background: none; }
.avada-cpt-listing-section .avada-child-doc-table tbody tr:hover { background-color: rgba(138,138,138,.18); }
.avada-cpt-listing-section .avada-child-doc-table .col-nr    { width: 70px;  white-space: nowrap; }
.avada-cpt-listing-section .avada-child-doc-table .col-data  { width: 90px;  white-space: nowrap; }
.avada-cpt-listing-section .avada-child-doc-table .col-fisier,
.avada-cpt-listing-section .avada-child-doc-table .col-anexa { width: 130px; }
.avada-cpt-listing-section .avada-child-doc-table .avada-child-no-results { padding: 2em; border: 1px dashed #ccc; text-align: center; color: #888; font-style: italic; }

/* Download links */
.avada-cpt-listing-section .doc-download-btn { display: inline-block; padding: 2px 9px 2px 4px; text-transform: uppercase; font-size: 12px; color: #202b50; font-weight: 700; text-decoration: none; white-space: nowrap; }
.avada-cpt-listing-section .doc-download-btn:hover { color: #3a7bd5; text-decoration: none; }

/* Pagination */
.avada-cpt-listing-section .avada-child-doc-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1.5em 0; }
.avada-cpt-listing-section .avada-child-doc-pagination .pagination-info { font-size: 13px; color: #666; margin: 0; }
.avada-cpt-listing-section .avada-child-doc-pagination ul.page-numbers { display: flex; flex-wrap: wrap; gap: 3px; list-style: none; padding: 0; margin: 0; }
.avada-cpt-listing-section .avada-child-doc-pagination ul.page-numbers li { display: block; margin: 0; padding: 0; }
.avada-cpt-listing-section .avada-child-doc-pagination a.page-numbers,
.avada-cpt-listing-section .avada-child-doc-pagination span.page-numbers { display: inline-block; padding: .375rem 1rem; font-size: 13px; border: 1px solid #d8d8d8; color: #444; text-decoration: none; background: #fff; line-height: 1.4; box-sizing: border-box; }
.avada-cpt-listing-section .avada-child-doc-pagination span.page-numbers.current { background: #202b50; color: #fff; border-color: #202b50; }
.avada-cpt-listing-section .avada-child-doc-pagination a.page-numbers:hover { background: #3a7bd5; color: #fff; border-color: #3a7bd5; text-decoration: none; }

/* Caracter label badge */
.avada-cpt-listing-section .caracter-label { display: inline-block; background: #202b50; color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; margin-bottom: 4px; letter-spacing: .03em; }
.avada-cpt-listing-section .caracter-label span { opacity: .6; }
.avada-cpt-listing-section .caracter-label--normativ  { background: #004990; }
.avada-cpt-listing-section .caracter-label--individual { background: #66b3ff; }

/* Repeater anexe inside descriere cell */
.avada-cpt-listing-section .avada-child-doc-table td.col-descriere { text-align: left; vertical-align: top; }
.avada-cpt-listing-section .extra-anexe { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.avada-cpt-listing-section .extra-anexe .doc-download-btn { font-size: 11px; color: #666; }
.avada-cpt-listing-section .extra-anexe .doc-download-btn:hover { color: #3a7bd5; }

/* ── Collapsible toggle column — hidden on desktop, shown on mobile via PHP inline style + media query ── */
.avada-cpt-listing-section .th-toggle,
.avada-cpt-listing-section .td-toggle { display: none; }
.avada-cpt-listing-section .th-toggle { width: 36px; padding: 0 4px; }
.avada-cpt-listing-section .td-toggle { padding: 4px 4px; vertical-align: middle; text-align: center !important; }
.avada-cpt-listing-section .cpt-toggle-btn {
    display: none; /* overridden on mobile */
    width: 28px; height: 28px;
    line-height: 26px; text-align: center;
    font-size: 18px; font-weight: 700;
    color: #202b50; background: transparent;
    border: 1px solid #202b50; border-radius: 2px;
    cursor: pointer; padding: 0;
    -webkit-appearance: none; appearance: none; outline: none;
    transition: background .15s, color .15s;
}
.avada-cpt-listing-section .cpt-toggle-btn:hover { background: #202b50; color: #fff; }

/* Expanded detail row — hidden by default, shown when .cpt-row-open is on the data <tr> */
.avada-cpt-listing-section .cpt-detail-row { display: none; }
.avada-cpt-listing-section .cpt-detail-row td { padding: 8px 12px 12px 46px; background: #f7f9fc; border-bottom: 2px solid #d0d8e8; text-align: left !important; }
.avada-cpt-listing-section .avada-child-doc-table .cpt-detail-row .cpt-detail-inner { font-size: 13px; }
.avada-cpt-listing-section .avada-child-doc-table .cpt-detail-row .cpt-detail-inner .cpt-detail-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: #888; letter-spacing: .05em; margin-bottom: 2px; }
.avada-cpt-listing-section .avada-child-doc-table .cpt-detail-row .cpt-detail-inner .cpt-detail-value { margin-bottom: 8px; }

/* ── Mobile breakpoint (≤ 640px) ─────────────────────────────────────────── */
@media (max-width: 640px) {

    /* Filters: flexible centered layout with max 130px per field */
    .avada-cpt-listing-section .doc-filters-row { gap: 0.5rem; justify-content: center; }
    .avada-cpt-listing-section .doc-filter-item { 
        flex: 0 0 auto;
        min-width: 0;
        max-width: 130px;
        flex-direction: column; 
        align-items: stretch; 
        gap: 0.3rem; 
    }
    .avada-cpt-listing-section .doc-filter-item label { 
        min-width: auto; 
        text-align: center; 
        font-size: 9px; 
        padding: 0 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .avada-cpt-listing-section .avada-child-doc-filters input[type="text"],
    .avada-cpt-listing-section .avada-child-doc-filters input[type="number"],
    .avada-cpt-listing-section .avada-child-doc-filters input[type="date"],
    .avada-cpt-listing-section .avada-child-doc-filters select { 
        width: 100%; 
        max-width: 130px;
        height: 32px; 
        font-size: 11px;
    }
    .avada-cpt-listing-section .doc-filter-actions { 
        width: 100%; 
        justify-content: center; 
        gap: 0.5rem;
    }
    .avada-cpt-listing-section .doc-filter-actions .avada-child-btn { 
        flex: 1; 
        height: 34px; 
        font-size: 10px;
        padding: 0 8px;
    }

    /* Action buttons: centered, single row, same icon size as desktop */
    .documente-actions { justify-content: center; flex-wrap: nowrap; gap: 0.3rem; }

    /* Table: show toggle column + button, hide Descriere + Document columns */
    .avada-cpt-listing-section .th-toggle,
    .avada-cpt-listing-section .td-toggle { display: table-cell; width: 36px !important; }
    .avada-cpt-listing-section .cpt-toggle-btn { display: inline-block; }
    .avada-cpt-listing-section .avada-child-doc-table th.col-descriere,
    .avada-cpt-listing-section .avada-child-doc-table td.col-descriere,
    .avada-cpt-listing-section .avada-child-doc-table th.col-fisier,
    .avada-cpt-listing-section .avada-child-doc-table td.col-fisier { display: none; }
}
