/* =========================================================
   AILEARNIST — BACK-TO-TOP (scroll ring) + FLOATING SHARE
   Markup: includes/share-markup.php · Logic: assets/share/share.js
   Tokens come from /assets/css/base.css (no local :root here, so
   nothing overrides the sitewide theme).
   ========================================================= */

/* Floating Share Button Styles */
#floating-share-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

/* Back to Top Button */
#back-to-top-btn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 50px;
    height: 50px;
    padding: 0;
    border: none;
    border-radius: 50%;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--card-bg);
    box-shadow: 0 5px 15px var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.85);
    transition: opacity 0.3s ease,
                transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                visibility 0.3s ease,
                box-shadow 0.25s ease,
                background 0.3s ease;
}

#back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#back-to-top-btn:hover {
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 8px 22px var(--shadow-lg);
}

#back-to-top-btn:active {
    transform: translateY(0) scale(0.92);
}

#back-to-top-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

#back-to-top-btn .btt-progress {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
}

#back-to-top-btn .btt-progress-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 3;
}

#back-to-top-btn .btt-progress-bar {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 131.9;
    stroke-dashoffset: 131.9;
    transition: stroke-dashoffset 0.1s linear;
}

#back-to-top-btn i {
    position: relative;
    z-index: 1;
    font-size: 16px;
    color: var(--primary);
}

@media (prefers-reduced-motion: reduce) {
    #back-to-top-btn {
        transition: opacity 0.2s ease, visibility 0.2s ease;
        transform: none !important;
    }
    #back-to-top-btn:hover,
    #back-to-top-btn:active {
        transform: none !important;
    }
}

#share-toggle-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sk-cyan), var(--sk-violet));
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
#share-toggle-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

#share-options {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

#floating-share-container.active #share-options {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

/* Platform Colors */
.whatsapp { background: #25D366; }
.linkedin { background: #0A66C2; }
.copy { background: linear-gradient(135deg, var(--sk-cyan), var(--sk-violet)); }
.telegram { background: #0088cc; }
.facebook { background: #006AFF; }
.instagram { background: #E1306C; }
.reddit { background: #FF4500; }
.x { background: #000000; }
.share-btn.x { color: white !important; }

/* Mobile optimization */
@media (max-width: 600px) {
    #floating-share-container {
        bottom: 15px;
        right: 15px;
    }

    #back-to-top-btn {
        bottom: 85px;
        right: 15px;
    }
}

@media (max-width: 380px) {
    #back-to-top-btn {
        width: 44px;
        height: 44px;
        bottom: 79px;
        right: 12px;
    }

    #back-to-top-btn i {
        font-size: 14px;
    }
}
