/* =============================================================================
   SAOIF Skill Share Button Stylesheet
   share.css
   Copyright (C) 2020 MINEVERSAL
   ============================================================================= */

/* ── Container ─────────────────────────────────────────────────────────────── */
#share-switcher {
    position: fixed;
    bottom: 24px;
    left: 20px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 9999;
}

/* ── Share button list ──────────────────────────────────────────────────────── */
.share-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    /* no overflow:hidden — let the scale/translate do the hiding */
}

/* Each share button — closed state (hidden by default) */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
    border: 2px solid transparent;
    text-decoration: none !important;
    overflow: visible;
    cursor: pointer;
    position: relative;

    /* closed state */
    opacity: 0;
    transform: translateY(12px) scale(0.65);
    pointer-events: none;

    /* base transition (used for closing) */
    transition: opacity      0.20s ease,
                transform    0.20s ease,
                border-color 0.15s ease,
                box-shadow   0.15s ease;
}

/* ── Stagger on CLOSE — top buttons disappear first ────────────────────────── */
#share-switcher:not(.open) .share-options .share-btn:nth-child(1) { transition-delay: 0.00s; }
#share-switcher:not(.open) .share-options .share-btn:nth-child(2) { transition-delay: 0.04s; }
#share-switcher:not(.open) .share-options .share-btn:nth-child(3) { transition-delay: 0.08s; }
#share-switcher:not(.open) .share-options .share-btn:nth-child(4) { transition-delay: 0.12s; }
#share-switcher:not(.open) .share-options .share-btn:nth-child(5) { transition-delay: 0.16s; }
#share-switcher:not(.open) .share-options .share-btn:nth-child(6) { transition-delay: 0.20s; }

/* ── Stagger on OPEN — bottom buttons appear first (cascade upward) ─────────── */
#share-switcher.open .share-options .share-btn:nth-child(6) { transition-delay: 0.04s; }
#share-switcher.open .share-options .share-btn:nth-child(5) { transition-delay: 0.10s; }
#share-switcher.open .share-options .share-btn:nth-child(4) { transition-delay: 0.16s; }
#share-switcher.open .share-options .share-btn:nth-child(3) { transition-delay: 0.22s; }
#share-switcher.open .share-options .share-btn:nth-child(2) { transition-delay: 0.28s; }
#share-switcher.open .share-options .share-btn:nth-child(1) { transition-delay: 0.34s; }

/* Open state */
#share-switcher.open .share-btn {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Hover */
.share-btn:hover {
    transform: translateY(0) scale(1.13) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.30);
}

/* Icon SVG inside each share button */
.share-btn svg {
    width: 24px;
    height: 24px;
    display: block;
    flex-shrink: 0;
}

/* Per-platform brand colors on hover */
.share-btn[data-platform="facebook"]:hover { border-color: #1877f2; box-shadow: 0 4px 16px rgba(24,  119, 242, 0.35); }
.share-btn[data-platform="x"]:hover        { border-color: #000000; box-shadow: 0 4px 16px rgba(0,    0,   0,   0.25); }
.share-btn[data-platform="discord"]:hover  { border-color: #5865f2; box-shadow: 0 4px 16px rgba(88,  101, 242, 0.35); }
.share-btn[data-platform="whatsapp"]:hover { border-color: #25d366; box-shadow: 0 4px 16px rgba(37,  211, 102, 0.35); }
.share-btn[data-platform="line"]:hover     { border-color: #06c755; box-shadow: 0 4px 16px rgba(6,   199,  85, 0.35); }
.share-btn[data-platform="instagram"]:hover{ border-color: #e1306c; box-shadow: 0 4px 16px rgba(225,  48, 108, 0.35); }

/* ── Platform tooltip label ─────────────────────────────────────────────────── */
.share-btn::after {
    content: attr(title);
    position: absolute;
    left: 54px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 11px;
    font-family: system-ui, sans-serif;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.share-btn:hover::after {
    opacity: 1;
}

/* ── Toggle button ──────────────────────────────────────────────────────────── */
.share-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #1a73e8;
    border: none;
    cursor: pointer;
    box-shadow: 0 3px 16px rgba(26, 115, 232, 0.50);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.22s ease,
                transform  0.18s ease,
                box-shadow 0.22s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.share-toggle:hover {
    background: #1558b0;
    transform: scale(1.08);
    box-shadow: 0 5px 20px rgba(26, 115, 232, 0.60);
}

.share-toggle:active {
    transform: scale(0.93);
}

/* Opened state — turn red to signal "close" */
#share-switcher.open .share-toggle {
    background: #e53935;
    box-shadow: 0 3px 16px rgba(229, 57, 53, 0.50);
}

#share-switcher.open .share-toggle:hover {
    background: #b71c1c;
    box-shadow: 0 5px 20px rgba(229, 57, 53, 0.60);
}

/* ── Icons inside the toggle ────────────────────────────────────────────────── */
.share-toggle .icon-share,
.share-toggle .icon-close {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity   0.20s ease,
                transform 0.20s ease;
    pointer-events: none;
}

/* Default: share icon visible */
.share-toggle .icon-share {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #fff;
}

/* Default: X hidden */
.share-toggle .icon-close {
    opacity: 0;
    transform: rotate(-70deg) scale(0.55);
    color: #fff;
    font-size: 26px;
    font-weight: 200;
    line-height: 1;
    font-family: system-ui, sans-serif;
}

/* Open: swap icons */
#share-switcher.open .share-toggle .icon-share {
    opacity: 0;
    transform: rotate(70deg) scale(0.55);
}

#share-switcher.open .share-toggle .icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ── Toast notification ─────────────────────────────────────────────────────── */
#share-toast {
    position: fixed;
    bottom: 90px;
    left: 20px;
    background: rgba(0, 0, 0, 0.80);
    color: #fff;
    font-size: 13px;
    font-family: system-ui, sans-serif;
    padding: 8px 14px;
    border-radius: 8px;
    z-index: 10000;
    pointer-events: none;
    white-space: nowrap;

    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#share-toast.visible {
    opacity: 1;
    transform: translateY(0);
}