/* ========================================
   POPUP PARTAGE
======================================== */

.share-popup-overlay {
    position: fixed;
    inset: 0;

    z-index: 10500;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.55);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;
}

.share-popup-overlay.visible {
    opacity: 1;
    visibility: visible;
}


.share-popup {
    position: relative;

    width: min(460px, 100%);
    max-height: 90vh;
    max-height: min(90dvh, 760px);
    overflow-y: auto;
    overscroll-behavior: contain;

    padding: 28px;

    border: 1px solid var(--border);
    border-radius: 17px;

    background: var(--surface);

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.45);

    transform: translateY(12px) scale(0.97);

    transition: transform 0.25s ease;
}

.share-popup-overlay.visible .share-popup {
    transform: translateY(0) scale(1);
}


/* FERMER */

.share-popup-close {
    position: absolute;

    top: 13px;
    right: 13px;

    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 8px;

    background: transparent;
    color: var(--text-secondary);

    cursor: pointer;

    transition: 0.2s ease;
}

.share-popup-close:hover {
    background: var(--surface-light);
    color: var(--text);
}


/* ICÔNE */

.share-popup-icon {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-bottom: 15px;

    border-radius: 12px;

    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);

    font-size: 17px;
}


/* TEXTE */

.share-popup-label {
    display: block;

    margin-bottom: 6px;

    color: var(--primary);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 1px;
}

.share-popup h2 {
    margin: 0 0 9px;

    color: var(--text);

    font-size: 20px;
    line-height: 1.3;
}

.share-popup p {
    margin: 0 0 21px;

    color: var(--text-secondary);

    font-size: 13px;
    line-height: 1.5;
}


/* BOUTONS */

.share-buttons {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 9px;
}

.share-button {
    min-height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 9px 12px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: var(--surface-light);
    color: var(--text);

    font-size: 12px;
    font-weight: 600;

    text-decoration: none;

    cursor: pointer;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease;
}

.share-button:hover {
    transform: translateY(-1px);
    background: var(--surface);
}

.share-button.discord:hover {
    border-color: #5865f2;
    color: #7289da;
}

.share-button.whatsapp:hover {
    border-color: #25d366;
    color: #25d366;
}

.share-button.x:hover {
    border-color: var(--text-secondary);
}

.share-button.copy:hover {
    border-color: var(--primary);
    color: var(--primary);
}


/* MOBILE */

@media (max-width: 500px) {

    .share-popup {
        padding: 23px 18px;
        border-radius: 14px;
    }

    .share-buttons {
        grid-template-columns: 1fr;
    }

}

.share-popup-close,
.share-button {
    min-height: 44px;
}

.share-popup-close:focus-visible,
.share-button:focus-visible {
    outline: 3px solid rgba(129, 140, 248, 0.8);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .share-popup,
    .share-popup-overlay,
    .share-button,
    .share-popup-close {
        transition: none;
    }
}
