/* Répertoire téléphonique — style proche des cards sites */

.alertSuccess {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    margin: 0 auto 16px;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    text-align: center;
    max-width: 800px;
    transition: opacity 0.5s ease-in-out;
}

.alertError {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    margin: 0 auto 16px;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    text-align: center;
    max-width: 800px;
    transition: opacity 0.5s ease-in-out;
}

.repertoire-page {
    position: relative;
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 10px 10px 140px;
    box-sizing: border-box;
}

.repertoire-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
}

.repertoire-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    min-width: 0;
}

.repertoire-back-container {
    flex: 0 0 auto;
}

.repertoire-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    box-shadow: 0 2px 6px rgb(0 13 16 / 20%);
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.repertoire-back:hover {
    background: #ffffff;
    transform: translateX(-2px);
}

.repertoire-back-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.repertoire-title-block {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.repertoire-site-logo {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.repertoire-site-logo-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.repertoire-default-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0c88b6;
}

.repertoire-eyebrow {
    margin: 0 0 2px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.repertoire-title-block h1 {
    margin: 0;
    font-size: 1.35rem;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.repertoire-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.repertoire-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 12px;
    background: #0e1c274d;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgb(0 13 16 / 35%);
    font-weight: 600;
}

.service-card {
    background-color: #0e1c274d;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgb(0 13 16 / 64%);
    padding: 14px 16px;
    box-sizing: border-box;
}

.service-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.18);
}

.service-title-wrap {
    min-width: 0;
    flex: 1 1 auto;
}

.service-card-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #0f172a;
    line-height: 1.3;
}

.service-etage {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0c88b6;
    white-space: nowrap;
}

.service-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

.service-contacts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.45);
    border-radius: 8px;
}

.contact-row-clickable {
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-row-clickable:hover,
.contact-row-clickable:focus-visible {
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
    outline: none;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.contact-name {
    font-size: 1rem;
    color: #111;
}

.contact-fonction {
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    font-style: italic;
}

.contact-phones {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
}

.contact-phone,
.contact-email {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    color: #0c88b6;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    word-break: break-word;
}

.phone-label {
    display: inline-block;
    min-width: 48px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.contact-phone:hover,
.contact-email:hover {
    text-decoration: underline;
}

.contact-actions {
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.contact-edit,
.contact-delete {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: transparent;
}

.contact-edit img,
.contact-delete img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* Modale détail contact */
body.repertoire-modal-open {
    overflow: hidden;
}

.repertoire-contact-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1500;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.repertoire-contact-modal.is-open {
    display: flex;
}

.repertoire-contact-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
}

.repertoire-contact-details {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background-color: #0e1c274d;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    text-align: center;
    color: #000;
    box-sizing: border-box;
}

.repertoire-contact-details .close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    border: none;
    background: transparent;
    font-size: 2.5em;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.repertoire-contact-details .detail-row {
    display: flex;
    align-items: center;
    margin: 15px 0;
    gap: 15px;
    text-align: left;
    color: #000;
}

.repertoire-contact-details .detail-row .icon-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: end;
    flex-shrink: 0;
}

.repertoire-contact-details .detail-info {
    flex-grow: 1;
    min-width: 0;
}

.repertoire-contact-details .detail-label {
    font-size: 0.9em;
    opacity: 0.8;
    display: block;
}

.repertoire-contact-details .detail-info p {
    margin: 0;
    font-size: 1.1em;
    font-weight: bold;
    word-break: break-word;
}

.repertoire-contact-details .detail-icon {
    width: 25px;
    height: 25px;
}

.repertoire-contact-details .action-buttons-container {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
}

.repertoire-contact-details .action-button-wrapper {
    width: 60px;
    height: 60px;
}

.repertoire-contact-details .action-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    border-radius: 20%;
    background-color: #f0f0f0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.repertoire-contact-details .action-icon {
    width: 30px;
    height: 35px;
}

#contact-detail-message {
    margin-top: 40px;
    margin-bottom: 10px;
}

#contact-detail-message:empty {
    margin: 0;
}

/* Modale confirmation suppression (comme suppression de site) */
#genericConfirmationModal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: center;
    animation: repertoireFadeIn 0.3s ease-out;
}

@keyframes repertoireFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#genericConfirmationModal .modal-content {
    background-color: #ffffff;
    margin: auto;
    padding: 25px 20px;
    border-radius: 12px;
    width: 85%;
    max-width: 450px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    text-align: center;
    position: relative;
    transform: scale(0.95);
    animation: repertoireZoomIn 0.3s ease-out forwards;
}

@keyframes repertoireZoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (min-width: 500px) {
    #genericConfirmationModal .modal-content {
        padding: 30px 40px;
    }

    #genericConfirmationModal .modal-btn-cancel,
    #genericConfirmationModal #confirmActionButton {
        width: auto;
        min-width: 150px;
        padding: 12px 25px;
    }

    #genericConfirmationModal .modal-actions {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }
}

#genericConfirmationModal #modalConfirmationMessage {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.5;
}

#genericConfirmationModal #modalConfirmationMessage strong {
    color: #dc3545;
    font-weight: 700;
}

#genericConfirmationModal #modalConfirmationMessage strong.contact-edit-name {
    color: #0c88b6;
}

#genericConfirmationModal #confirmActionButton.modal-btn-edit-confirm {
    background-color: #478ac9;
}

#genericConfirmationModal #confirmActionButton.modal-btn-edit-confirm:hover {
    background-color: #3a73a8;
}

#genericConfirmationModal .modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#genericConfirmationModal .modal-btn-cancel,
#genericConfirmationModal #confirmActionButton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#genericConfirmationModal .modal-btn-cancel:active,
#genericConfirmationModal #confirmActionButton:active {
    transform: translateY(1px);
}

#genericConfirmationModal .modal-btn-cancel {
    background-color: #6c757d;
    color: #fff;
    order: 1;
}

#genericConfirmationModal .modal-btn-cancel:hover {
    background-color: #5a6268;
}

#genericConfirmationModal #confirmActionButton {
    background-color: #dc3545;
    color: #fff;
    order: 2;
}

#genericConfirmationModal #confirmActionButton:hover {
    background-color: #c82333;
}

.add-button-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
}

.add-button {
    display: block;
    width: 60px;
    height: 60px;
    background-color: #478ac9;
    color: white;
    text-align: center;
    font-size: 4em;
    line-height: 60px;
    border-radius: 30%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.repertoire-form-title {
    margin: 40px 0 4px;
    color: #111;
}

.repertoire-form-site {
    margin: 0 0 20px;
    font-weight: 700;
    color: #0c88b6;
}

.repertoire-form-hint {
    margin: 0 0 12px;
    font-size: 0.85rem;
    color: #475569;
    font-style: italic;
    text-align: left;
}

@media screen and (min-width: 768px) {
    .repertoire-page {
        padding: 20px;
    }

    .repertoire-top {
        display: flex;
        justify-content: center;
        margin-bottom: 22px;
    }

    .repertoire-header {
        justify-content: center;
        width: 100%;
    }

    .repertoire-title-block {
        flex: 0 1 auto;
        justify-content: center;
    }

    .repertoire-back-container {
        position: absolute;
        top: 20px;
        left: -85px;
        z-index: 10;
    }

    .repertoire-back {
        width: 60px;
        height: 60px;
        border-radius: 30%;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    .repertoire-back-icon {
        width: 26px;
        height: 26px;
    }

    .repertoire-title-block h1 {
        font-size: 1.6rem;
    }

    .repertoire-site-logo {
        width: 80px;
        height: 80px;
    }

    .repertoire-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
        align-items: start;
    }

    .add-button-container {
        position: absolute;
        top: 20px;
        right: -85px;
        bottom: auto;
    }

    .service-card {
        min-height: 140px;
        min-width: 0;
    }
}
