/* =====================================================
   Social Share Float — tk-ss-*
   Position: fixed right-center (vertically centered)
   ===================================================== */

.tk-ss-float {
    --tk-ss-size: 36px;
    --tk-ss-gap: 8px;
    --tk-ss-side: 16px;
    --tk-ss-z: 998;
    --tk-ss-radius-filled: 50%;
    --tk-ss-radius-soft: 50%;
    --tk-ss-radius-outline: 50%;
    --tk-ss-radius-ghost: 50%;

    position: fixed;
    right: var(--tk-ss-side);
    top: 50%;
    transform: translateY(-50%);
    z-index: var(--tk-ss-z);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--tk-ss-gap);
    pointer-events: none; /* container is transparent to clicks */
}

/* ---- Individual button ---- */
.tk-ss-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--tk-ss-size);
    height: var(--tk-ss-size);
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: visible;
    border: none;
    background: none;
    padding: 0;
    outline: none;
}

.tk-ss-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.tk-ss-btn svg {
    width: 55%;
    height: 55%;
    display: block;
    flex-shrink: 0;
}

/* ---- Tooltip ---- */
.tk-ss-btn::before {
    content: attr(data-label);
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 1;
}

.tk-ss-btn:hover::before,
.tk-ss-btn:focus-visible::before {
    opacity: 1;
}

/* ---- Hover effect ---- */
.tk-ss-btn:hover,
.tk-ss-btn:focus-visible {
    transform: scale(1.12) translateX(-2px);
    z-index: 2;
}

/* ========== STYLES ========== */

/* -- Filled (solid bg, white icon) -- */
.tk-ss--filled .tk-ss-btn {
    background-color: var(--tk-ss-brand);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.tk-ss--filled .tk-ss-btn:hover,
.tk-ss--filled .tk-ss-btn:focus-visible {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    filter: brightness(1.08);
}

/* -- Outline (transparent bg, colored border+icon) -- */
.tk-ss--outline .tk-ss-btn {
    background-color: #fff;
    border: 2px solid var(--tk-ss-brand);
    color: var(--tk-ss-brand);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.tk-ss--outline .tk-ss-btn:hover,
.tk-ss--outline .tk-ss-btn:focus-visible {
    background-color: var(--tk-ss-brand);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* -- Soft (tinted bg, colored icon) -- */
.tk-ss--soft .tk-ss-btn {
    background-color: color-mix(in srgb, var(--tk-ss-brand) 12%, transparent);
    color: var(--tk-ss-brand);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.tk-ss--soft .tk-ss-btn:hover,
.tk-ss--soft .tk-ss-btn:focus-visible {
    background-color: color-mix(in srgb, var(--tk-ss-brand) 20%, transparent);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
}

/* Fallback for browsers without color-mix (Safari < 16.4) */
@supports not (background-color: color-mix(in srgb, red 10%, white)) {
    .tk-ss--soft .tk-ss-btn {
        background-color: rgba(100, 100, 100, 0.12);
    }

    .tk-ss--soft .tk-ss-btn:hover,
    .tk-ss--soft .tk-ss-btn:focus-visible {
        background-color: rgba(100, 100, 100, 0.22);
    }
}

/* -- Ghost (no bg, only icon) -- */
.tk-ss--ghost .tk-ss-btn {
    background-color: transparent;
    color: var(--tk-ss-brand);
}

.tk-ss--ghost .tk-ss-btn:hover,
.tk-ss--ghost .tk-ss-btn:focus-visible {
    background-color: rgba(0, 0, 0, 0.07);
}

/* ========== Single-color mode (overrides --tk-ss-brand per button) ========== */
.tk-ss--single-color .tk-ss-btn {
    --tk-ss-brand: var(--tk-ss-custom-color);
}

/* ========== Copy-link feedback ========== */
.tk-ss-btn--copied::before {
    content: 'Copied!' !important;
    opacity: 1 !important;
}

/* ========== Responsive hide classes ========== */
@media (min-width: 1025px) {
    .tk-ss--hide-desktop {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .tk-ss--hide-tablet {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .tk-ss--hide-mobile {
        display: none !important;
    }
}

/* On mobile, shift slightly inside viewport */
@media (max-width: 767px) {
    .tk-ss-float {
        right: max(var(--tk-ss-side), 8px);
    }
}

/* ========== Admin Preview Stage ========== */
.tk-ss-preview-stage {
    position: relative;
    min-height: 200px;
    background: linear-gradient(180deg, #f8f9fb 0%, #eef1f5 100%);
    border: 1px dashed #ced4da;
    border-radius: 8px;
    overflow: hidden;
}

.tk-ss-float--preview {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 12px !important;
    pointer-events: none;
}

.tk-ss-float--preview .tk-ss-btn:hover {
    transform: none;
}

.tk-ss-float--preview .tk-ss-btn::before {
    display: none;
}
