/* ═══════════════════════════════════════════════════
   SOCIAL ROW — Floating social engagement component
   Karma Sparks + Share button. Both social signals
   feeding TapasAI.

   Separate from Sparkbar (study tools).
   ═══════════════════════════════════════════════════ */

/* ── Base row ── */

.social-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--color-border, #e0dbd3);
    border-radius: 24px;
    box-shadow: 0 2px 12px rgba(44, 42, 38, 0.08);
    transition: all 0.3s ease;
    width: fit-content;
}

/* ── Static (in-page) variant ── */

.social-row--static {
    /* Default — sits in the entry footer or below text content */
}

/* ── Floating variant ── */

.social-row--floating {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    box-shadow:
        0 4px 20px rgba(44, 42, 38, 0.12),
        0 1px 4px rgba(44, 42, 38, 0.08);
    animation: socialRowFloatIn 0.3s ease;
}

@keyframes socialRowFloatIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ── Karma Sparks slot ── */

.social-row-karma {
    display: flex;
    align-items: center;
}

/* ── Divider between Karma Sparks and Share ── */

.social-row-divider {
    width: 1px;
    height: 20px;
    background: var(--color-border, #e0dbd3);
    flex-shrink: 0;
}

/* ── Share button ── */

.social-row-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: #2a9d8f;
    font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.social-row-share-btn:hover {
    background: rgba(42, 157, 143, 0.08);
}

.social-row-share-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.social-row-share-label {
    /* Allow label to collapse on very narrow screens */
}


/* ═══════════════════════════════════════════════════
   SHARE PANEL — Teal metallic sheen header
   Matches SparkUI button treatment (Option A).
   ═══════════════════════════════════════════════════ */

.social-row-panel {
    width: 260px;
    background: var(--color-white, #ffffff);
    border: 1px solid var(--color-border, #e0dbd3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(44, 42, 38, 0.1);
    font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
}

/* Header — teal metallic gradient with inset highlight */

.social-row-panel-header {
    background: linear-gradient(160deg,
        rgba(230, 250, 248, 0.95) 0%,
        rgba(42, 157, 143, 0.85) 20%,
        rgba(35, 125, 115, 0.95) 50%,
        rgba(42, 157, 143, 0.8) 80%,
        rgba(230, 250, 248, 0.9) 100%
    );
    color: white;
    padding: 10px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.social-row-panel-header svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Actions container */

.social-row-panel-actions {
    padding: 6px;
}

/* Individual action rows */

.social-row-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.85rem;
    color: var(--color-text, #2c2a26);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
}

.social-row-action:hover {
    background: var(--color-bg, #faf8f5);
}

/* Action icon badges */

.social-row-action-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.social-row-action-icon svg {
    width: 16px;
    height: 16px;
}

/* Per-platform icon backgrounds */

.social-row-action-icon.icon-copy {
    background: rgba(42, 157, 143, 0.1);
    color: #2a9d8f;
}

.social-row-action-icon.icon-image {
    background: rgba(184, 134, 11, 0.1);
    color: #b8860b;
}

.social-row-action-icon.icon-threads {
    background: rgba(0, 0, 0, 0.06);
    color: #000;
}

.social-row-action-icon.icon-facebook {
    background: rgba(24, 119, 242, 0.1);
    color: #1877F2;
}

.social-row-action-icon.icon-more {
    background: rgba(107, 101, 96, 0.08);
    color: var(--color-text-muted, #6b6560);
}

/* Action text */

.social-row-action-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.social-row-action-label {
    font-weight: 500;
    line-height: 1.2;
}

.social-row-action-sublabel {
    font-size: 0.72rem;
    color: var(--color-text-light, #958e85);
    line-height: 1.2;
}


/* ═══════════════════════════════════════════════════
   TEXT PAGE VARIANT
   Share-only row, centered below content,
   no Karma Sparks, no floating.
   ═══════════════════════════════════════════════════ */

.social-row--text-page {
    margin: 1.5rem auto 0;
    justify-content: center;
}


/* ═══════════════════════════════════════════════════
   TIER GATING — Signup prompt in share position
   ═══════════════════════════════════════════════════ */

.social-row-signup {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    color: var(--color-text-muted, #6b6560);
    font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    font-size: 0.78rem;
    line-height: 1;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-row-signup:hover {
    color: #2a9d8f;
    background: rgba(42, 157, 143, 0.06);
}

.social-row-signup svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .social-row {
        padding: 6px 12px;
        gap: 10px;
    }

    .social-row-share-btn {
        font-size: 0.78rem;
        padding: 4px 8px;
    }

    .social-row-share-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Panel: full width on mobile */
    .social-row-panel {
        width: calc(100vw - 24px);
        max-width: 300px;
    }

    /* Floating row: tighter bottom margin on small screens */
    .social-row--floating {
        bottom: 16px;
    }
}

/* Very narrow screens: hide share label, show icon only */
@media (max-width: 340px) {
    .social-row-share-label {
        display: none;
    }
}

/* Ensure floating row clears the safe area on notched devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .social-row--floating {
        bottom: calc(16px + env(safe-area-inset-bottom));
    }
}


/* ═══════════════════════════════════════════════════
   INTERACTION STATES
   ═══════════════════════════════════════════════════ */

/* Prevent text selection on interactive elements */
.social-row-share-btn,
.social-row-action {
    user-select: none;
    -webkit-user-select: none;
}

/* Focus visible for keyboard navigation */
.social-row-share-btn:focus-visible,
.social-row-action:focus-visible {
    outline: 2px solid #2a9d8f;
    outline-offset: 2px;
}

/* Active press state */
.social-row-share-btn:active {
    transform: scale(0.96);
}

.social-row-action:active {
    background: rgba(42, 157, 143, 0.1);
}
