#popup-button {
    padding: 12px 24px;
    font-size: 16px;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
}

#popup-button:hover {
    background-color: #0056b3;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    scrollbar-width: none;
    z-index: 9999;
}

.popup-box {
    background: white;
    border-radius: 10px;
    padding: 15px 2px;
    max-width: 90%;
    width: 450px;
    height: 60vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(57, 146, 255, 0.073);
    border: 1px solid rgba(31, 126, 227, 0.249);
    animation: fadeIn 0.3s ease forwards;
    overflow-y: auto;
    overscroll-behavior: contain; /* bloque le scroll propagation */
    scrollbar-width: none;
    position: relative;
}

.popup-header {
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
    padding: 5px 30px;
    margin-top: -10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
}

.popup-title {
    font-size: 20px;
    font-weight: bold;
    color: #073a93;
    text-shadow: 0 2px 4px rgba(123, 176, 255, 0.473);
    margin: 0;
}

.popup-close {
    font-size: 24px;
    background: none;
    border: none;
    color: #f82424;
    padding: 3px 10px;
    margin-right: -20px;
    margin-left: 10px;
    cursor: pointer;
    background: radial-gradient(rgba(255, 129, 129, 0.066), rgba(218, 42, 42, 0.046));
    border: 1px solid rgb(248, 30, 30);
    border-radius: 999px;
    transition: color 0.3s ease;
    text-shadow: 0 1px 2px rgba(108, 29, 29, 0.473);
    transition: .2s;
}

.popup-close:hover {
    color: #7b0303;
    transform: scale(1.2) rotate(180deg);
}

.popup-content {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 24px 30px;
}

.popup-description {
    font-size: 15px;
    color: #555;
    line-height: 1.5;
    overflow-y: auto;
    scrollbar-width: none;
}
/* Rich text formatting for popup description */
.popup-description h1,
.popup-description h2,
.popup-description h3 { color: #333; margin: 0 0 10px; }
.popup-description p { margin: 0 0 10px; line-height: 1.6; }
.popup-description ul, .popup-description ol { margin: 0 0 10px 20px; }
.popup-description li { margin-bottom: 6px; }
.popup-description a { color: #007bff; text-decoration: underline; }
.popup-description strong, .popup-description b { font-weight: 700; }
.popup-description em, .popup-description i { font-style: italic; }

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 500px) {
    .popup-box {
        width: 90%;
        padding: 20px;
        padding-top: 5px;
    }

    .popup-title {
        font-size: 20px;
    }

    .popup-description {
        font-size: 14px;
    }

    .popup-close {
        font-size: 24px;
        background: none;
        border: none;
        color: #f82424;
        padding: 3px 10px;
        margin-right: -30px;
        cursor: pointer;
        background: radial-gradient(rgba(255, 129, 129, 0.066), rgba(218, 42, 42, 0.046));
        border: 1px solid rgb(248, 30, 30);
        border-radius: 999px;
        transition: color 0.3s ease;
        text-shadow: 0 1px 2px rgba(108, 29, 29, 0.473);
        transition: .2s;
    }
}