/* Alert */
.c-snackbar-container {
    position: absolute;
    top: 1em;
    right: 1em;
    z-index: 1000;
    background-color: var(--background-raised-grey);
}
.c-snackbar-container .fr-alert  {
    display: none;
}

/* Header */
.ademe_user_name {
    color: var(--text-title-grey) !important;
}
.ademe_user_role {
    font-size: 14px !important;
    color: var(--text-disabled-grey) !important;
}

/* DataTable */
.dt-info, .dt-search, .dt-paging, .dt-empty, .dt-orderable-none .dt-column-order, .dt-orderable-none .sort-icon
{
    display: none;
}
.dt-orderable-asc, .dt-orderable-desc
{
    cursor: pointer;
}
.dt-orderable-none, .ademe_user_name, .ademe_user_role
{
    cursor: default
}

/* Formulaire - Summary */
.col-summary
{
    min-width: 10em;
}
.col-summary-error
{
    margin-top: 0 !important;

}

.file-virus-pending.fr-error-text {
    /* DSFR token for action-high blue */
    color: var(--text-action-high-blue-france, #000091) !important;
}

.file-virus-info.fr-error-text {
    /* DSFR token for action-high blue */
    color: var(--text-action-high-blue-france, #000091) !important;
}

/* Follow up exchange */

.c-timeline__event__title,
.c-timeline__event__user,
.c-timeline__event__date,
.c-timeline__event__message,
.c-timeline__event__info {
    transform: translateY(-0.25rem);
    margin: 0;
    padding: 0;
}

.c-timeline__event__info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.c-timeline {
    position: relative;
    min-width: 40rem;
    flex: 1;
    list-style-type: none;
    padding: 0 0 0 1.75rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;

    &::before {
        background-color: var(--border-default-grey);
        content: "";
        margin-left: -1px;
        position: absolute;
        top: 0;
        left: 0;
        width: 1px;
        height: 100%;
    }
}

.c-timeline__event {
    position: relative;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    &::before {
        content: "";
        background-color: var(--background-default-grey);
        border: 2px solid var(--background-action-high-blue-france);
        display: block;
        position: absolute;
        border-radius: 50%;
        top: 0;
        left: -2.25rem;
        width: 1rem;
        height: 1rem;
    }

    p {
        margin-bottom: 0;
    }
}

.c-timeline__event__message {
    color: var(--text-label-grey);
    font-style: italic;
    font-weight: 400;
    padding: 1rem;
    background-color: var(--background-contrast-grey);
}

.c-timeline__event:last-child::after {
    content: "";
    background-color: var(--background-default-grey);
    height: 100%;
    width: 1px;
    position: absolute;
    display: block;
    left: -1.8rem;
    top: 1rem;
}

/* ============================================
   Bonus Record - Custom Icons
   ============================================ */

/* Icône custom pour le bouton de duplication */
.fr-icon-duplicate-custom::before,
.fr-icon-duplicate-custom::after {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2V8H3V20C3 20.5523 3.44772 21 4 21H16C16.5523 21 17 20.5523 17 20V16H20C20.5523 16 21 15.5523 21 15V2C21 1.44772 20.5523 1 20 1H8C7.44772 1 7 1.44772 7 2ZM9 3H19V14H17V8C17 7.44772 16.5523 7 16 7H9V3ZM5 9H15V19H5V9Z' fill='currentColor'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2V8H3V20C3 20.5523 3.44772 21 4 21H16C16.5523 21 17 20.5523 17 20V16H20C20.5523 16 21 15.5523 21 15V2C21 1.44772 20.5523 1 20 1H8C7.44772 1 7 1.44772 7 2ZM9 3H19V14H17V8C17 7.44772 16.5523 7 16 7H9V3ZM5 9H15V19H5V9Z' fill='currentColor'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    background-color: currentColor;
    width: 1rem;
    height: 1rem;
    content: "";
    display: inline-block;
}

/* Picto info bleu DSFR avec texte sur la même ligne */
.import-summary-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #161616; /* Noir en mode clair */
}

.import-summary-info .fr-icon-info-fill {
    color: var(--text-action-high-blue-france, #000091);
    flex-shrink: 0;
}

/* ============================================
    DataTable overrides (moved from datatable-overrides.css)
    ============================================ */
#bonus-records-datatable thead th { position: relative; }
/* Use flex to vertically center title and arrow */
#bonus-records-datatable thead th .dt-column-header { display: inline-flex; align-items: center; gap: .25rem; }
#bonus-records-datatable thead th.multiline-header .dt-column-header { align-items: flex-start; }
#bonus-records-datatable thead th .dt-column-header .dt-column-title { display: inline-block; line-height: 1.2; }
#bonus-records-datatable thead th .dt-column-title { white-space: nowrap; }
#bonus-records-datatable thead th.multiline-header .dt-column-header .dt-column-title { white-space: normal !important; }
#bonus-records-datatable thead th.multiline-header .dt-column-header .dt-column-title { display:inline-block; }
/* Prevent internal automatic wrap of each line fragment before/after <br> */
#bonus-records-datatable thead th.multiline-header .dt-column-header .dt-column-title br { line-height:1.2; }
#bonus-records-datatable thead th .dt-column-header .sort-icon { align-self: center; }
/* Adjust arrow opacity / alignment explicitly for consistency */
#bonus-records-datatable thead th.multiline-header .sort-icon { margin-top: 0; position: relative; top: 0; }
/* Hide sort arrow in non-orderable Actions column explicitly */
#bonus-records-datatable thead th.dt-orderable-none .sort-icon { display: none !important; }

/* ============================================
    Landing Page - Section 2 Tabs
    ============================================ */

.landing-page__section-2 .fr-tabs__content-container {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.landing-page__section-2 .tab-content-item {
    flex: 1;
    text-align: center;
}

.landing-page__section-2 .fr-tabs__content-container--align-buttons .tab-content-item {
    position: relative;
    padding-bottom: 4rem;
}

.landing-page__section-2 .fr-tabs__content-container--align-buttons .tab-content-item .fr-mt-2w {
    position: absolute;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.landing-page__section-2 .tab-content-item-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.landing-page__section-2 .tab-content-item-icon img {
    width: 80px;
    height: 80px;
}

.landing-page__section-2 .tab-content-button {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.table-with-line-break {
    width: 100%;
    table-layout: fixed;
}

/* =====================================================
   Section Éligibilité publique
   ===================================================== */

/* Date de mise à jour */
.eligibility-update-date {
    color: var(--text-action-high-blue-france);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

/* Sous-titre — gras */
.eligibility-subtitle {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Textes descriptifs — même taille partout (16px) */
.eligibility-description {
    font-size: 1rem;
    line-height: 1.5;
}

/* ---- Bloc Recherche : alignement des labels ---- */

/* Le label dans le search-bar doit se comporter comme les labels des selects */
.eligibility-search-group {
    display: block;
}

.eligibility-search-group .fr-label {
    display: block;
    margin-bottom: 0.5rem;
}

.eligibility-search-group .fr-search-bar {
    display: flex;
}
.eligibility-search-group .fr-input {
    flex: 1;
}

/* Alignement vertical des 3 colonnes par le bas */
.eligibility-filters > [class^="fr-col"] {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* ---- Tuiles ---- */

/* Tags Groupe / Sous-groupe — tronqués si trop longs */
.eligibility-card__tag {
    max-width: 45%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Titre modèle — bleu, tronqué */
.eligibility-card .fr-card__title {
    color: var(--text-action-high-blue-france);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.75rem;
    min-height: 1.75rem;
}

/* Description (référence) — tronquée */
.eligibility-card .fr-card__desc {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5rem;
    min-height: 1.5rem;
}

/* Référence commerciale — tronquée avec ellipsis */
.eligibility-card .fr-card__detail {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
    min-width: 0;
    line-height: 1.25rem;
    min-height: 1.25rem;
}

/* ---- Grille tuiles : gouttières réduites ---- */

.eligibility-cards-grid.fr-grid-row--gutters {
    margin-left: -0.375rem;
    margin-right: -0.375rem;
}

.eligibility-cards-grid.fr-grid-row--gutters > [class^="fr-col"] {
    padding-left: 0.375rem !important;
    padding-right: 0.375rem !important;
    margin-bottom: 0.75rem;
}

/* ---- Pagination centrée ---- */

.fr-pagination[data-eligibility-pagination] {
    display: flex;
    justify-content: center;
}

.fr-pagination[data-eligibility-pagination] .fr-pagination__list {
    justify-content: center;
}
