/* Grille principale */
.pgp-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 30px 0;
    padding: 0 10px;
}

/* Responsive tablette */
@media screen and (max-width: 992px) {
    .pgp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive mobile */
@media screen and (max-width: 600px) {
    .pgp-grid {
        grid-template-columns: 1fr;
    }
}

/* Chaque article */
.pgp-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.pgp-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Image */
.pgp-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f5f7fa;
}

.pgp-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Titre */
.pgp-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 16px;
    color: #1a202c;
    text-align: center;
}

.pgp-title a {
    text-decoration: none !important;
    color: #1a202c;
    transition: color 0.3s;
}

.pgp-title a:hover {
    color: #2b6cb0;
}

/* Extrait */
.pgp-excerpt {
    margin: 0 16px 16px;
    font-size: 0.95rem;
    color: #4a5568;
}

/* Section de tags utilisateur */
.pgp-tags {
    margin: 0 16px 16px;
    padding: 10px;
    background-color: #f7fafc;
    border-radius: 6px;
    border: 1px dashed #cbd5e0;
    font-size: 0.95rem;
}

.pgp-tags label {
    display: block;
    margin-bottom: 6px;
    cursor: pointer;
    color: #2d3748;
}

.pgp-tag-checkbox {
    margin-right: 8px;
}

/* Statut des tags */
.pgp-tags em {
    font-style: normal;
    font-size: 0.85rem;
}

.pgp-tags em[style*="orange"] {
    color: #dd6b20;
    font-weight: 500;
}

.pgp-tags em[style*="green"] {
    color: #38a169;
    font-weight: 500;
}

/* Section admin : tags proposés */
.pgp-admin-tags {
    margin: 0 16px 12px;
    padding: 12px;
    background: #fefcbf;
    border-left: 4px solid #ecc94b;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* ✅ Conteneur scrollable */
.pgp-admin-tags-scroll {
    max-height: 260px; /* hauteur max avant scroll */
    overflow-y: auto;
    margin-top: 8px;
    padding-right: 8px;
}

/* Titre section */
.pgp-admin-tags-title {
    font-weight: bold;
    color: #744210;
    font-size: 1rem;
    margin-bottom: 8px;
}

/* Ligne d’un tag */
.pgp-tag-line {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    padding: 10px;
    background: #fffef0;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Infos tag + utilisateur */
.pgp-tag-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.pgp-tag-name {
    font-weight: 600;
    color: #2d3748;
}

.pgp-user-name {
    color: #4a5568;
}

/* Boutons d’action */
.pgp-tag-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

/* Style de base commun à tous les boutons */
.pgp-tag-actions button {
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    transition: background 0.2s ease, transform 0.1s ease;
}

/* Animation de clic */
.pgp-tag-actions button:active {
    transform: scale(0.96);
}

/* ✅ Bouton Valider (vert) */
.pgp-admin-validate {
    background-color: #48bb78; /* vert moyen */
}
.pgp-admin-validate:hover {
    background-color: #38a169; /* vert foncé au survol */
}

/* ❌ Bouton Refuser (rouge) */
.pgp-admin-refuse {
    background-color: #f56565; /* rouge moyen */
}
.pgp-admin-refuse:hover {
    background-color: #e53e3e; /* rouge foncé au survol */
}

/* 📄 Bouton Voir contrat (bleu) */
.pgp-view-signature {
    background-color: #4299e1; /* bleu moyen */
}
.pgp-view-signature:hover {
    background-color: #3182ce; /* bleu foncé au survol */
}

/* Scrollbar esthétique */
.pgp-admin-tags-scroll::-webkit-scrollbar {
    width: 8px;
}
.pgp-admin-tags-scroll::-webkit-scrollbar-track {
    background: #fff8dc;
    border-radius: 6px;
}
.pgp-admin-tags-scroll::-webkit-scrollbar-thumb {
    background: #ecc94b;
    border-radius: 6px;
}
.pgp-admin-tags-scroll {
    scrollbar-width: thin;
    scrollbar-color: #ecc94b #fff8dc;
}


/* Section admin : tags validés */
.pgp-admin-tags-validated {
    margin: 0 16px 16px;
    padding: 12px;
    background: #e6fffa;
    border-left: 4px solid #38b2ac;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Boutons admin */
.pgp-admin-validate {
    padding: 6px 12px;
    background-color: #3182ce;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pgp-admin-validate:hover {
    background-color: #2b6cb0;
    transform: translateY(-1px);
}

.pgp-admin-validate:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.pgp-view-signature {
    padding: 6px 12px;
    background-color: #38a169;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pgp-view-signature:hover {
    background-color: #2f855a;
    transform: translateY(-1px);
}

.pgp-view-signature::before {
    content: "📄";
    margin-right: 4px;
}

/* Statut de l'action utilisateur */
.pgp-tag-status {
    margin: 0 16px 16px;
    font-size: 0.9rem;
    color: #718096;
    font-style: italic;
}

/* Pagination */
.pgp-pagination {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    padding-bottom: 30px;
}

.pgp-pagination button {
    padding: 10px 22px;
    font-size: 16px;
    background-color: #2b6cb0;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pgp-pagination button:hover:not(:disabled) {
    background-color: #2c5282;
}

.pgp-pagination button:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
}

/* SIGNATURE CONTRAT */
/* --- Overlay --- */
.pgp-modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* --- Contenu --- */
.pgp-modal-content {
    background: #fff;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px 24px 32px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    animation: popupZoom 0.3s ease-out;
    text-align: left;
    scrollbar-width: thin;
}

/* Scrollbar personnalisée (Chrome/Edge) */
.pgp-modal-content::-webkit-scrollbar {
    width: 8px;
}
.pgp-modal-content::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 4px;
}

/* --- Titre --- */
.pgp-modal-content h2 {
    margin-top: 0;
    font-size: 22px;
    color: #1a1a1a;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* --- Texte --- */
.pgp-modal-text {
    margin: 15px 0;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

/* --- Liste utilisateur --- */
.pgp-modal-text ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}
.pgp-modal-text li {
    margin-bottom: 5px;
}

/* --- Signature --- */
#pgp-signature {
    cursor: crosshair;
    border-radius: 4px;
    border: 1px solid #ccc;
    margin-top: 10px;
}

/* --- Boutons --- */
.pgp-modal-buttons {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.pgp-modal-buttons button,
#pgp-clear-signature {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.pgp-modal-buttons button:hover,
#pgp-clear-signature:hover {
    background-color: #004999;
    transform: translateY(-2px);
}

/* --- Bouton fermer --- */
#pgp-close-preview {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
}
#pgp-close-preview:hover {
    color: #000;
}

/* --- Image signature --- */
#pgp-preview-signature {
    max-width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 10px;
}

/* --- Responsive --- */
@media (max-height: 500px) {
    .pgp-modal-content {
        max-height: 80vh;
    }
}

/* --- Anim Zoom --- */
@keyframes popupZoom {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
