:root {
    --largeur-icones: 50px;
    --petite-marge: 8px;
    --couleur-fond-mail: bisque;
    --couleur-fond-mail-fonce: rgb(170, 146, 117);
}

body {
    background-color: #374151;
}


/* ===== popup ===== */

.popup-div {
    display: none;
    position: absolute;
    top: 100px;
    left: 100px;
    width: 350px;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    font-family: "Segoe UI", sans-serif;
    animation: popupFade 0.25s ease;
    z-index: 1000;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: move;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#closeBtn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg);
}

.popup-content {
    padding: 20px;
    color: #374151;
    font-size: 14px;
    line-height: 1.6;
    background: #fafafa;
}

@keyframes popupFade {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
}

.resize-handle::after {
    content: "";
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 10px;
    height: 10px;
    border-right: 2px solid #999;
    border-bottom: 2px solid #999;
}

.attachments-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
}

.attachment-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: 120px;
}

.attachment-preview-img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.attachment-preview-pdf {
    width: 120px;
    height: 90px;
}

.attachment-embed-wrapper {
    width: 120px;
    height: 90px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
}

.attachment-embed-wrapper:hover,
.attachment-preview-img:hover {
    opacity: 0.8;
}

.attachment-icon {
    font-size: 2.5em;
    text-align: center;
}

.attachment-label {
    font-size: 0.75em;
    color: #555;
    text-align: center;
    width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.popup-body-html {
    width: 100%;
    word-break: break-word;
}

.popup-body-html img {
    max-width: 100%;
    height: auto;
}

.popup-content {
    overflow-y: auto;
    overflow-x: hidden;
    height: calc(100% - 40px);
    box-sizing: border-box;
    padding: 10px;
    word-break: break-word;
}

.popup-body-html {
    width: 100%;
    word-break: break-word;
}

.popup-body-html img {
    max-width: 100%;
    height: auto;
}

.test {
    white-space: pre-wrap;
    word-break: break-word;
}

.popup-content {
    display: flex;          
    justify-content: center; 
    align-items: center;   
    flex-direction: column;
    padding: 20px;         
    gap: 10px;              
    overflow-y: auto;
    overflow-x: hidden;
    height: calc(100% - 40px); 
    box-sizing: border-box;
}

.popup-content select {
    min-width: 150px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
    cursor: pointer;
    background-color: #fff;
}

/* ===== fin popup ===== */

/* ===== debut div  ===== */

#div-menu div {
    padding-left: 25px;
}

#div-dossiers button {
    padding-right: 10px;
}

#div-dossiers {
    display: flex;
    flex-direction: column;
    row-gap: 5px;
}

.div-align-page-mail {
    display: grid;
    grid-template-columns: minmax(0, 200px) 3fr;
    width: 100%;
}

.div-mail {
    border-radius: 10px;
    background-color: var(--couleur-fond-mail);
    margin: var(--petite-marge);
    padding: var(--petite-marge);
    display: grid;
    gap: 10px;
    grid-template-columns: var(--largeur-icones) 1fr 1fr calc(var(--largeur-icones) + 10px) calc(var(--largeur-icones) + 10px);
    align-items: center;
    overflow: visible;
    transition: transform 0.2s ease, background-color 0.2s ease;
    width: calc(100% - 16px);
    box-sizing: border-box;
}

.div-mail:hover {
    background-color: var(--couleur-fond-mail-fonce);
    cursor: pointer;
}

.colonne-mails {
    width: 100%;
    min-width: 0;
}

.div-liste-mails {
    width: 100%;
}


/* =====  img  ===== */

.icone-rectangle {
    width: var(--largeur-icones);
    aspect-ratio: 2 / 1;
}

.icone, .icone-survole {
    width: var(--largeur-icones);
    aspect-ratio: 1 / 1;
    transition: transform 0.2s ease;
}

.icone-survole:hover {
    transform: scale(1.2);
}


#btn-mail {
    display: block;
    margin: 0 auto;
}