/*
GeoRankle Share 7.0

Share button styling and user-feedback states.

Used by:
- share.js
- .share-button
- .is-copied
- .is-sharing
- .is-error
*/

/* =========================================================
   Share button
   ========================================================= */

.share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    min-width: 0;
    min-height: 52px;

    margin: 24px 0 0;
    padding: 12px 26px;

    border: 1px solid #f5c400;
    border-radius: 16px;

    appearance: none;
    -webkit-appearance: none;

    background:
        linear-gradient(
            180deg,
            #ffe866 0%,
            #ffd400 58%,
            #ffc400 100%
        );

    color: #211c00;

    font: inherit;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;

    cursor: pointer;

    box-shadow:
        0 12px 25px rgba(255, 208, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);

    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        filter 0.18s ease,
        background-color 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        opacity 0.18s ease;
}

.share-button::before {
    content: "↗";

    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    font-size: 19px;
    font-weight: 900;
    line-height: 1;
}

.share-button:hover {
    transform: translateY(-2px);

    filter: brightness(1.02);

    box-shadow:
        0 16px 32px rgba(255, 208, 0, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.share-button:active {
    transform:
        translateY(0)
        scale(0.98);
}

.share-button:focus {
    outline: none;
}

.share-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.4);
    outline-offset: 4px;
}

/* =========================================================
   Disabled and busy states
   ========================================================= */

.share-button:disabled,
.share-button[aria-disabled="true"] {
    cursor: not-allowed;

    filter: saturate(0.55);
    opacity: 0.58;

    transform: none;

    box-shadow:
        0 5px 12px rgba(15, 23, 42, 0.08);
}

.share-button.is-sharing,
.share-button.is-busy {
    cursor: wait;

    filter: saturate(0.7);
    opacity: 0.76;

    transform: none;
}

.share-button.is-sharing::before,
.share-button.is-busy::before {
    content: "";

    width: 17px;
    height: 17px;

    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;

    animation:
        geoRankleShareSpinner
        0.75s
        linear
        infinite;
}

/* =========================================================
   Successful copy
   ========================================================= */

.share-button.is-copied,
.share-button.is-success {
    border-color: #16a34a;

    background:
        linear-gradient(
            180deg,
            #dcfce7,
            #bbf7d0
        );

    color: #166534;

    box-shadow:
        0 10px 22px rgba(34, 197, 94, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.share-button.is-copied::before,
.share-button.is-success::before {
    content: "✓";
}

/* =========================================================
   Error state
   ========================================================= */

.share-button.is-error {
    border-color: #dc2626;

    background:
        linear-gradient(
            180deg,
            #fee2e2,
            #fecaca
        );

    color: #991b1b;

    box-shadow:
        0 10px 22px rgba(239, 68, 68, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.share-button.is-error::before {
    content: "!";
}

/* =========================================================
   Compact variant
   ========================================================= */

.share-button.share-button-compact {
    min-height: 44px;
    margin-top: 16px;
    padding: 9px 18px;

    border-radius: 14px;

    font-size: 15px;
}

/* =========================================================
   Full-width variant
   ========================================================= */

.share-button.share-button-full {
    width: 100%;
}

/* =========================================================
   Spinner animation
   ========================================================= */

@keyframes geoRankleShareSpinner {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 600px) {
    .share-button {
        width: 100%;
        min-height: 50px;

        margin-top: 18px;
        padding: 11px 18px;

        font-size: 16px;
    }
}

/* =========================================================
   High contrast
   ========================================================= */

@media (prefers-contrast: more) {
    .share-button {
        border-width: 2px;
    }

    .share-button:focus-visible {
        outline-width: 4px;
    }
}

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .share-button {
        transition: none;
    }

    .share-button:hover,
    .share-button:active {
        transform: none;
    }

    .share-button.is-sharing::before,
    .share-button.is-busy::before {
        animation: none;
    }
}