/* =========================================================
   SC ACADEMY DIRECTORY — FRONT-END, ADMIN & PRINT
   Version 1.2.5
   ========================================================= */

:root {
    --sca-blue: #0088cc;
    --sca-blue-hover: #0073ad;
    --sca-dark: #17365d;
    --sca-text: #3e4851;
    --sca-muted: #69737c;
    --sca-border: #dde4ea;
    --sca-border-light: #e7ebef;
    --sca-soft: #f7f9fb;
    --sca-row-alt: #fafbfd;
    --sca-row-hover: #f0f7fb;
}

/* =========================================================
   CONTENEUR
   ========================================================= */

.sca-directory {
    margin-top: 25px;
}

/* =========================================================
   BARRE D'ACTIONS / BOUTONS
   ========================================================= */

.sca-directory-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin: 0 0 22px;
}

/* Les boutons du shortcode utilisent uniquement la classe du thème
   .lien_sleepmobile afin de reprendre exactement le style du site. */

/* =========================================================
   FORMULAIRE / FILTRES
   ========================================================= */

.sca-directory-toolbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(170px, 1fr)) auto;
    gap: 14px;
    align-items: end;
    margin: 0 0 25px;
    padding: 20px;
    background: var(--sca-soft);
    border: 1px solid #e2e8ee;
    border-radius: 6px;
}

.sca-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.sca-field > span {
    margin: 0;
    color: #333;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-transform: none;
    letter-spacing: 0;
}

.sca-field input[type="text"],
.sca-field input[type="search"],
.sca-field select {
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ccd5dd;
    border-radius: 4px;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.sca-field input[type="text"]:focus,
.sca-field input[type="search"]:focus,
.sca-field select:focus {
    border-color: var(--sca-blue);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 136, 204, .10);
}

.sca-field input::placeholder {
    color: #8a949c;
    opacity: 1;
}


/* Réinitialiser est désormais un lien <a>, comme le bouton Télécharger.
   Les deux utilisent uniquement .lien_sleepmobile et héritent donc exactement
   du même style défini par le thème. */

/* =========================================================
   NOMBRE DE RÉSULTATS
   ========================================================= */

.sca-directory-count {
    margin: 0 0 12px;
    color: var(--sca-muted);
    font-size: 13px;
}

/* =========================================================
   TABLEAU
   ========================================================= */

.sca-table-wrap {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--sca-border);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(30, 55, 75, .05);
}

.sca-directory-table {
    width: 100%;
    margin: 0;
    border: 0;
    border-collapse: collapse;
    border-spacing: 0;
    background: #fff;
    font-size: 14px;
}

.sca-directory-table thead th {
    padding: 13px 14px;
    background: var(--sca-blue);
    color: #fff;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, .18);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    vertical-align: middle;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}

.sca-directory-table thead th:last-child {
    border-right: 0;
}

.sca-directory-table tbody td {
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--sca-border-light);
    color: var(--sca-text);
    line-height: 1.45;
    text-align: left;
    vertical-align: middle;
}

.sca-directory-table tbody tr:nth-child(even) {
    background: var(--sca-row-alt);
}

.sca-directory-table tbody tr {
    transition: background-color .15s ease;
}

.sca-directory-table tbody tr:hover {
    background: var(--sca-row-hover);
}

.sca-directory-table tbody tr:last-child td {
    border-bottom: 0;
}

.sca-directory-table tbody tr[hidden] {
    display: none !important;
}

.sca-directory-table td:first-child {
    font-weight: 600;
    white-space: nowrap;
}

.sca-directory-table td:nth-child(2) {
    color: #273746;
    font-weight: 600;
}

.sca-directory-table a {
    color: var(--sca-blue);
    text-decoration: none;
}

.sca-directory-table a:hover {
    color: #006fa6;
    text-decoration: underline;
}

.sca-directory-table td:last-child {
    font-weight: 600;
    color: #0077b3;
}

/* =========================================================
   GROUPES RÉGION / PAYS
   ========================================================= */

.sca-directory-table .sca-region-group-row {
    background: #eaf6fc !important;
}

.sca-directory-table .sca-region-group-row:hover {
    background: #eaf6fc !important;
}

.sca-directory-table .sca-region-group-row td {
    padding: 10px 14px;
    border-top: 2px solid #cfe8f4;
    border-bottom: 1px solid #cfe8f4;
    color: var(--sca-dark);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
}

.sca-directory-table .sca-region-group-row td::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 9px;
    background: var(--sca-blue);
    border-radius: 50%;
    vertical-align: 1px;
}

.sca-directory-table .sca-region-group-row[hidden] {
    display: none !important;
}

/* Bandeau unique affiché lorsqu'une région précise est filtrée */
.sca-directory-table .sca-region-filtered-row td {
    border-top: 0;
}

/* =========================================================
   AUCUN RÉSULTAT
   ========================================================= */

.sca-empty {
    padding: 22px;
    background: var(--sca-soft);
    border-top: 1px solid #e2e8ee;
    color: #5f6972;
    text-align: center;
}

/* =========================================================
   TABLETTE / MOBILE
   ========================================================= */

@media (max-width: 991px) {
    .sca-directory-toolbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

@media (max-width: 600px) {
    .sca-directory-actions {
        justify-content: stretch;
    }

    .sca-directory-actions .lien_sleepmobile {
        width: 100%;
    }

    .sca-directory-toolbar {
        grid-template-columns: 1fr;
        padding: 16px;
    }


    .sca-directory-toolbar > .lien_sleepmobile {
        width: 100%;
    }

    .sca-directory-table {
        min-width: 720px;
    }

    .sca-directory-table thead th,
    .sca-directory-table tbody td {
        padding: 11px 12px;
    }
}

/* =========================================================
   ADMIN — DOCUMENTATION / IMPORT
   Toutes les règles propres au plugin restent dans ce fichier.
   ========================================================= */

.sca-admin-docs .sca-doc-table {
    max-width: 1000px;
}

.sca-admin-docs code,
.sca-admin-import code {
    font-size: 13px;
}

/* =========================================================
   EXPORT / IMPRESSION PDF
   ========================================================= */

@page {
    size: A4 portrait;
    margin: 12mm;
}

.sca-print-page,
.sca-print-page * {
    box-sizing: border-box;
}

.sca-print-page {
    margin: 0;
    background: #fff;
    color: #222;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 10pt;
}

.sca-print-toolbar {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 15px;
    display: flex;
    gap: 10px;
}

.sca-print-toolbar button {
    padding: 10px 16px;
    border: 1px solid var(--sca-blue);
    border-radius: 4px;
    background: var(--sca-blue);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.sca-print-toolbar button:hover {
    background: var(--sca-blue-hover);
    border-color: var(--sca-blue-hover);
}

.sca-print-document {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px 25px;
}

.sca-print-document h1 {
    margin: 0 0 5px;
    color: var(--sca-dark);
    font-size: 20pt;
}

.sca-print-document .date {
    margin: 0 0 18px;
    color: #666;
}

.sca-print-table {
    width: 100%;
    border-collapse: collapse;
}

.sca-print-table th,
.sca-print-table td {
    padding: 6px 7px;
    border-bottom: 1px solid #d9d9d9;
    text-align: left;
    vertical-align: top;
}

.sca-print-table th {
    background: #f0f0f0;
    color: var(--sca-dark);
    font-size: 9pt;
    text-transform: uppercase;
}

.sca-print-table td:nth-child(1) {
    white-space: nowrap;
}

.sca-print-table a {
    color: #222;
    text-decoration: none;
}

.sca-print-table tr {
    break-inside: avoid;
}

.sca-print-document .count {
    margin-top: 12px;
    color: #666;
    font-size: 9pt;
}

.sca-print-table .sca-print-region-row td {
    padding: 7px;
    background: #eaf6fc;
    color: var(--sca-dark);
    border-top: 2px solid #bcddea;
    border-bottom: 1px solid #bcddea;
    font-weight: 700;
    font-size: 10pt;
}

@media print {
    .sca-print-toolbar {
        display: none !important;
    }

    .sca-print-document {
        max-width: none;
        padding: 0;
    }

    .sca-print-page {
        font-size: 8.5pt;
    }

    .sca-print-table th,
    .sca-print-table td {
        padding: 4px 5px;
    }

    .sca-print-page a {
        color: #000 !important;
        text-decoration: none !important;
    }
}
