/* ============================================================
   FLOATING SOCIAL WIDGET  —  Premium, fixed right-side panel
   ============================================================ */

/* ── Wrapper: always fixed center-right (desktop only) ──────── */
.fsw-wrapper {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: row;
    align-items: center;
}

/* ── Tab: always visible, sits to the left of the panel ───── */
.fsw-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 28px;
    padding: 14px 0;
    background: linear-gradient(180deg, #00d4ff 0%, #00ff88 100%);
    border: none;
    border-radius: 10px 0 0 10px;
    cursor: pointer;
    box-shadow: -3px 0 12px rgba(0, 212, 255, 0.4);
    transition: width 0.2s ease, background 0.3s ease;
    flex-shrink: 0;
    position: relative;
}

.fsw-tab:hover {
    width: 34px;
    background: linear-gradient(180deg, #00bfe8 0%, #00df76 100%);
}

.fsw-tab-chevron {
    color: #0d1117;
    transition: transform 0.4s ease;
    flex-shrink: 0;
}

/* "Follow Me" text rotated vertically on the tab */
.fsw-tab-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #0d1117;
    text-transform: uppercase;
    white-space: nowrap;
    user-select: none;
}

/* ── Panel: the sliding icon tray ──────────────────────────── */
.fsw-panel {
    background: rgba(10, 14, 20, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-right: none;
    border-radius: 14px 0 0 14px;
    padding: 1rem 0.7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 212, 255, 0.05) inset;

    /* Collapsed by default – slide off to the right */
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.35s ease,
        padding 0.4s ease;
    padding-left: 0;
    padding-right: 0;
}

/* Expanded state */
.fsw-panel.fsw-open {
    max-width: 64px;
    opacity: 1;
    padding: 1rem 0.7rem;
}

/* ── "Follow Me" heading inside panel ───────────────────────── */
.fsw-heading {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #00d4ff;
    margin-bottom: 12px;
    white-space: nowrap;
    opacity: 0.8;
}

/* ── Icons container ─────────────────────────────────────────── */
.fsw-icons {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

/* ── Individual icon link ────────────────────────────────────── */
.fsw-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.fsw-icon:hover {
    background: rgba(0, 212, 255, 0.18);
    border-color: #00d4ff;
    color: #00d4ff;
    transform: translateX(-3px) scale(1.08);
    box-shadow: 0 4px 14px rgba(0, 212, 255, 0.25);
}

/* Chevron flips when panel is open */
.fsw-wrapper.fsw-expanded .fsw-tab-chevron {
    transform: rotate(180deg);
}

/* ── Hide desktop widget on mobile ──────────────────────────── */
@media (max-width: 768px) {
    .fsw-wrapper {
        display: none !important;
    }

    /*
     * Push the entire page content up by the height of the collapsed
     * Follow Me bar (36px) so nothing gets hidden behind it.
     * This is the standard approach used by Twitter, Instagram, etc.
     */
    body {
        padding-bottom: 36px !important;
    }
}

/* ============================================================
   MOBILE BOTTOM SOCIAL BAR  —  ≤ 768px
   Fixed slim bar at the bottom, always visible, thumb-friendly
   ============================================================ */

.fsw-mobile-bar {
    display: none;
    /* hidden on desktop */
}

@media (max-width: 768px) {
    .fsw-mobile-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 99999;
        background: rgba(10, 14, 20, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid rgba(0, 212, 255, 0.2);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
        padding: 0;
        flex-direction: column;
        /* Start collapsed — only show 'Follow Me' strip */
        max-height: 36px;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Expanded state from JS toggle */
    .fsw-mobile-bar.fsw-mb-open {
        max-height: 160px;
    }

    /* ── Toggle strip: "Follow Me" tap target ──────────────── */
    .fsw-mb-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        height: 36px;
        min-height: 36px;
        flex-shrink: 0;
        background: linear-gradient(90deg, rgba(0, 212, 255, 0.15) 0%, rgba(0, 255, 136, 0.10) 100%);
        border: none;
        border-bottom: 1px solid rgba(0, 212, 255, 0.15);
        cursor: pointer;
        width: 100%;
        color: #00d4ff;
        font-size: 0.65rem;
        font-weight: 800;
        letter-spacing: 0.15em;
        text-transform: uppercase;
        transition: background 0.3s ease;
    }

    .fsw-mb-toggle:active {
        background: rgba(0, 212, 255, 0.2);
    }

    .fsw-mb-toggle-chevron {
        transition: transform 0.4s ease;
        flex-shrink: 0;
        color: #00d4ff;
    }

    .fsw-mobile-bar.fsw-mb-open .fsw-mb-toggle-chevron {
        transform: rotate(180deg);
    }

    /* ── Icons row inside mobile bar ───────────────────────── */
    .fsw-mb-icons {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        padding: 10px 16px 12px;
        /* safe area for phones with home indicator */
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .fsw-mb-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 10px;
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        transition: all 0.2s ease;
        flex-shrink: 0;
    }

    .fsw-mb-icon:active {
        background: rgba(0, 212, 255, 0.2);
        border-color: #00d4ff;
        color: #00d4ff;
        transform: scale(0.93);
    }
}

/* ============================================================
   BACK TO TOP — override to always sit above floating widget
   ============================================================ */

/*
 * The floating panels use z-index: 99999.
 * Raise Back to Top one step higher so it's never buried.
 */
.back-to-top {
    z-index: 100001 !important;
}

/*
 * On mobile the Follow Me bar is 36px tall at bottom: 0.
 * Shift Back to Top up by exactly that height so it clears the bar.
 *   Original bottom: 20px  →  new bottom: 20px + 36px = 56px
 */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 56px !important;
        /* 20px original gap + 36px Follow Me bar */
    }
}

/*
 * At ≤480px the original offset was 15px.
 *   New bottom: 15px + 36px = 51px
 */
@media (max-width: 480px) {
    .back-to-top {
        bottom: 51px !important;
        /* 15px original gap + 36px Follow Me bar */
        right: 12px !important;
    }
}