/* ── OneClickShare floating bar ──────────────────────────────────────────────
   Sits on the right edge, draggable vertically, collapses to a single button.
   All selectors scoped to #ocs-bar to avoid conflicts with any theme.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── Wrapper ── */
#ocs-bar {
    position: fixed;
    right: 0;
    top: 200px;           /* overridden by JS from saved position */
    z-index: 999990;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

#ocs-bar.ocs-hide-mobile {
    display: flex;         /* still in DOM, JS hides via media query */
}

/* ── Drag grip ── */
.ocs-drag-grip {
    width: 28px;
    height: 20px;
    background: #1a1d28;
    border: 1px solid rgba(255,255,255,0.1);
    border-right: none;
    border-radius: 6px 0 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: ns-resize;
    color: rgba(255,255,255,0.3);
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 3px;
    align-self: flex-end;
}
.ocs-drag-grip:hover {
    background: #252836;
    color: rgba(255,255,255,0.7);
}

/* ── Toggle button (always visible) ── */
.ocs-toggle-btn {
    position: relative;
    width: 44px;
    height: 44px;
    background: #0f1117;
    border: 1px solid rgba(255,255,255,0.1);
    border-right: none;
    border-radius: 10px 0 0 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: background 0.15s, border-color 0.15s, width 0.2s;
    box-shadow: -4px 2px 16px rgba(0,0,0,0.35);
    padding: 0;
    outline: none;
    flex-shrink: 0;
}
.ocs-toggle-btn:hover {
    background: #1c1f2e;
    border-color: rgba(255,255,255,0.18);
}
.ocs-toggle-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.ocs-icon-close { display: none; }

#ocs-bar.ocs-open .ocs-icon-share { display: none; }
#ocs-bar.ocs-open .ocs-icon-close { display: block; }

/* Shared count badge */
.ocs-share-count {
    position: absolute;
    top: -5px;
    right: -1px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: #00e5a0;
    color: #07080c;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    font-family: -apple-system, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    animation: ocs-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Platform list ── */
.ocs-platforms {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    gap: 4px;
    width: max-content;
    position: fixed;
    z-index: 999991;
    max-height: 0;
    max-width: 0;
    overflow: hidden;
    transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.22s ease;
    opacity: 0;
    pointer-events: none;
    padding: 4px;
    box-sizing: content-box;
}

#ocs-bar.ocs-open .ocs-platforms {
    max-height: 80vh;
    max-width: 90vw;
    opacity: 1;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto;
}

/* Direction modifiers — JS sets these based on toggle button position */
.ocs-platforms.ocs-dir-rtl { direction: rtl; justify-content: end; }
.ocs-platforms.ocs-dir-ltr { direction: ltr; justify-content: start; }

/* Scrollbar for long lists */
.ocs-platforms::-webkit-scrollbar { width: 3px; }
.ocs-platforms::-webkit-scrollbar-track { background: transparent; }
.ocs-platforms::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Individual platform button ── */
.ocs-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    background: #0f1117;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s, transform 0.12s;
    box-shadow: 0 1px 12px rgba(0,0,0,0.28);
    padding: 0;
    outline: none;
    flex-shrink: 0;
    text-decoration: none;
    color: #fff;
    animation: ocs-slide-in 0.22s ease both;
    direction: ltr; /* counter the rtl set on .ocs-platforms */
}

/* Staggered slide-in animation */
.ocs-btn:nth-child(1)  { animation-delay: 0.02s; }
.ocs-btn:nth-child(2)  { animation-delay: 0.04s; }
.ocs-btn:nth-child(3)  { animation-delay: 0.06s; }
.ocs-btn:nth-child(4)  { animation-delay: 0.08s; }
.ocs-btn:nth-child(5)  { animation-delay: 0.10s; }
.ocs-btn:nth-child(6)  { animation-delay: 0.12s; }
.ocs-btn:nth-child(7)  { animation-delay: 0.14s; }
.ocs-btn:nth-child(8)  { animation-delay: 0.16s; }
.ocs-btn:nth-child(9)  { animation-delay: 0.18s; }
.ocs-btn:nth-child(10) { animation-delay: 0.20s; }
.ocs-btn:nth-child(n+11) { animation-delay: 0.22s; }

@keyframes ocs-slide-in {
    from { transform: translateY(10px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.ocs-btn:hover {
    background: #1c1f2e;
    border-color: rgba(255,255,255,0.15);
    transform: translateY(-2px);
    z-index: 1;
}

/* Colour accent on hover using CSS var set by JS */
.ocs-btn:hover {
    border-color: var(--ocs-color, rgba(255,255,255,0.15));
    box-shadow: 0 2px 16px rgba(0,0,0,0.4), 0 0 8px var(--ocs-glow, transparent);
}

/* ── TICKED state ── */
.ocs-btn.ocs-ticked {
    background: #061f14;
    border-color: rgba(0,229,160,0.3);
    border-top-color: #00e5a0;
    position: relative;
}

.ocs-btn.ocs-ticked::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -1px;
    width: 14px;
    height: 14px;
    background: #00e5a0;
    color: #07080c;
    border-radius: 50%;
    font-size: 8px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: -apple-system, sans-serif;
    animation: ocs-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ocs-btn.ocs-ticked .ocs-btn-icon {
    opacity: 0.55;
}

.ocs-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    background: #fff;
    color: var(--ocs-color, #333);
}
.ocs-btn-icon svg {
    display: block;
}

/* Untick on long-press — show small indicator on hover */
.ocs-btn.ocs-ticked:hover::before {
    content: '×';
    position: absolute;
    inset: 0;
    background: rgba(255,69,90,0.15);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #ff4d6d;
    font-weight: 700;
    z-index: 2;
}

/* ── Tooltip ── */
.ocs-tooltip {
    position: fixed;
    right: 52px;
    background: #1a1d28;
    color: #dde1f0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 999991;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.ocs-tooltip::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right: none;
    border-left-color: #1a1d28;
}
.ocs-tooltip.ocs-tip-visible { opacity: 1; }

/* ── "Done" flash on toggle ── */
.ocs-toggle-btn.ocs-done-flash {
    background: #061f14;
    border-color: rgba(0,229,160,0.4);
}

/* ── Animations ── */
@keyframes ocs-pop {
    from { transform: scale(0) rotate(-15deg); opacity: 0; }
    to   { transform: scale(1) rotate(0);      opacity: 1; }
}

/* ── Mobile hide ── */
@media (max-width: 767px) {
    #ocs-bar.ocs-hide-mobile {
        display: none !important;
    }
}

/* ── Dragging state ── */
#ocs-bar.ocs-dragging {
    opacity: 0.85;
    transition: none;
}
#ocs-bar.ocs-dragging * {
    pointer-events: none;
}
