/* ═══════════════════════════════════════════════════════════════
   Share System — Floating pill, inline prompts, share dropdowns
   ═══════════════════════════════════════════════════════════════ */

/* ── Floating Share Pill (left of accessibility launcher) ─── */
.fpa-share-pill {
    position: fixed;
    bottom: 30px;   /* same row as accessibility launcher */
    right: 90px;    /* launcher is 48px wide at right:30px → 30+48+12 gap */
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}
.fpa-share-pill.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fpa-share-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.35);
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
}
.fpa-share-pill-icon {
    width: 21px;
    height: 21px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fpa-share-pill-icon path {
    stroke: currentColor;
}

.fpa-share-pill-icon circle {
    fill: currentColor;
    stroke: none;
}
.fpa-share-pill-btn:hover {
    background: linear-gradient(135deg, #FF8A65 0%, #FF7043 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 138, 101, 0.4);
}
.fpa-share-pill-btn .fpa-share-pill-label { display: inline; }

@media (max-width: 640px) {
    /* Match accessibility launcher resize rules: 44x44 at right:20/bottom:20 */
    .fpa-share-pill { bottom: 20px; right: 74px; }
    .fpa-share-pill-btn { width: 44px; height: 44px; }
    .fpa-share-pill-icon { width: 20px; height: 20px; }
}

@media (max-width: 768px) {
    .fpa-header-mobile-menu-item .fpa-header-mobile-menu-action {
        -webkit-appearance: none;
        appearance: none;
        width: 100%;
        border: none;
        background: none;
        color: var(--primary-blue);
        text-decoration: none;
        display: flex;
        align-items: center;
        padding: 18px 20px;
        font-weight: 600;
        font-size: 1rem;
        border-left: 4px solid transparent;
        transition: background-color 0.3s ease, border-color 0.3s ease, padding-left 0.3s ease, color 0.3s ease;
        cursor: pointer;
        text-align: left;
        font-family: inherit;
        line-height: 1.2;
    }

    .fpa-header-mobile-menu-item .fpa-header-mobile-menu-action::before {
        content: '';
        width: 8px;
        height: 8px;
        background: linear-gradient(135deg, var(--accent-orange) 0%, #ff6f3d 100%);
        border-radius: 50%;
        margin-right: 12px;
        opacity: 0;
        transform: scale(0);
        transition: opacity 0.3s ease, transform 0.3s ease;
        flex-shrink: 0;
    }

    .fpa-header-mobile-menu-item .fpa-header-mobile-menu-action i {
        font-size: 0.95rem;
        color: var(--accent-orange);
        margin-right: 8px;
        flex-shrink: 0;
    }

    .fpa-header-mobile-menu-item .fpa-header-mobile-menu-action:hover,
    .fpa-header-mobile-menu-item .fpa-header-mobile-menu-action:focus-visible {
        background: linear-gradient(90deg, rgba(255, 138, 101, 0.08) 0%, transparent 100%);
        border-left-color: var(--accent-orange);
        padding-left: 25px;
        color: #2c5aa0;
        outline: none;
    }

    .fpa-header-mobile-menu-item .fpa-header-mobile-menu-action:hover::before,
    .fpa-header-mobile-menu-item .fpa-header-mobile-menu-action:focus-visible::before {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Share Dropdown (attached to pill & inline) ────────────── */
.fpa-share-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
    padding: 12px 8px;
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 999;
}
.fpa-share-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fpa-share-dropdown-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8899AA;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 12px 10px;
    margin: 0;
}

.fpa-share-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #2C3E50;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    font-family: inherit;
    text-align: left;
}
.fpa-share-dropdown-item:hover {
    background: #F0F4FF;
    color: #4A90E2;
}

.fpa-share-dropdown-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 0.85rem;
}
/* Platform colours */
.fpa-share-dropdown-icon--wa       { background: #25D366; }
.fpa-share-dropdown-icon--fb       { background: #1877F2; }
.fpa-share-dropdown-icon--tw       { background: #000; }
.fpa-share-dropdown-icon--nd       { background: #8ED500; color: #1a1a1a; }
.fpa-share-dropdown-icon--ig       { background: linear-gradient(135deg, #833AB4, #FD1D1D, #F77737); }
.fpa-share-dropdown-icon--th       { background: #000; }
.fpa-share-dropdown-icon--tt       { background: #000; }
.fpa-share-dropdown-icon--pi       { background: #E60023; }
.fpa-share-dropdown-icon--rd       { background: #FF4500; }
.fpa-share-dropdown-icon--em       { background: #4A90E2; }
.fpa-share-dropdown-icon--cp       { background: #6C757D; }
.fpa-share-dropdown-icon--ns       { background: linear-gradient(135deg, #4A90E2, #FF8A65); }

.fpa-share-dropdown-sep {
    height: 1px;
    background: #E9ECEF;
    margin: 6px 12px;
}

/* ── Toast notification (copy link) ────────────────────────── */
.fpa-share-toast {
    position: fixed;
    bottom: 150px;
    right: 30px;
    background: #1f2937;
    color: #f9fafb;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    max-width: min(420px, calc(100vw - 32px));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    z-index: 2147483000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.fpa-share-toast.show {
    opacity: 1;
    transform: translateY(0);
}
.fpa-share-toast[hidden] { display: none; }
.fpa-share-toast i { color: #81C784; }

/* Footer share prompt — REMOVED (kept pill + success-panel shares only) */

/* ── Footer Contact Social Icons (override legacy footer styles) ── */
.site-footer #footer-contact .social-links .social-link {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    color: #ffffff;
}

.site-footer #footer-contact .social-links .social-link:hover,
.site-footer #footer-contact .social-links .social-link:focus-visible {
    background: #ffffff;
    border-color: #ffffff;
    color: #ff8a65;
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.25);
    padding-left: 0;
}

.site-footer #footer-contact .social-links .social-link--email {
    background: rgba(74, 144, 226, 0.18);
    border-color: rgba(74, 144, 226, 0.7);
    color: #4a90e2;
}

.site-footer #footer-contact .social-links .social-link--email:hover,
.site-footer #footer-contact .social-links .social-link--email:focus-visible {
    background: #ffffff;
    border-color: #4a90e2;
    color: #4a90e2;
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.35);
}

/* ── Success panel share buttons (upgrade existing) ────────── */
.fpa-success-share { margin: 24px 0 20px; }
.fpa-success-share-label {
    font-size: 0.95rem;
    color: #5A6C7D;
    font-weight: 600;
    margin-bottom: 12px;
}
.fpa-success-share-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.fpa-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.fpa-share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
    color: #fff;
}
.fpa-share-fb { background: #1877F2; }
.fpa-share-x  { background: #000; }
.fpa-share-wa { background: #25D366; }
.fpa-share-nd { background: #8ED500; color: #1a1a1a; }
.fpa-share-em { background: #4A90E2; }
.fpa-share-cp { background: #6C757D; cursor: pointer; border: none; }

/* ── Admin: Share Analytics card ───────────────────────────── */
.fpa-share-analytics { margin-top: 20px; }
.fpa-share-analytics h2 { display: flex; align-items: center; gap: 8px; }
.fpa-share-analytics h2 .dashicons { color: #4A90E2; }
.fpa-share-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.fpa-share-stat-mini {
    background: #F8F9FA;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
.fpa-share-stat-mini .num {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #4A90E2;
    font-family: 'Poppins', sans-serif;
}
.fpa-share-stat-mini .lbl {
    display: block;
    font-size: 0.8rem;
    color: #5A6C7D;
    margin-top: 4px;
}

.fpa-share-platform-list { list-style: none; padding: 0; margin: 0; }
.fpa-share-platform-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #F0F0F0;
}
.fpa-share-platform-row:last-child { border-bottom: none; }
.fpa-share-platform-name {
    width: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2C3E50;
}
.fpa-share-platform-bar-wrap {
    flex: 1;
    height: 8px;
    background: #E9ECEF;
    border-radius: 4px;
    overflow: hidden;
}
.fpa-share-platform-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    transition: width 0.6s ease;
}
.fpa-share-platform-count {
    width: 50px;
    text-align: right;
    font-size: 0.85rem;
    font-weight: 600;
    color: #5A6C7D;
}

/* ── Referral insight table (admin) ────────────────────────── */
.fpa-referral-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.fpa-referral-table th {
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    color: #8899AA;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 6px;
    border-bottom: 2px solid #E9ECEF;
}
.fpa-referral-table td {
    padding: 8px 6px;
    font-size: 0.85rem;
    color: #2C3E50;
    border-bottom: 1px solid #F0F0F0;
}
.fpa-referral-table tr:last-child td { border-bottom: none; }
.fpa-referral-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.fpa-referral-badge--share { background: #E8F4FD; color: #4A90E2; }
.fpa-referral-badge--organic { background: #E8F5E9; color: #43A047; }
.fpa-referral-badge--social { background: #FFF3E0; color: #E65100; }
.fpa-referral-badge--search { background: #F3E5F5; color: #7B1FA2; }
.fpa-referral-badge--direct { background: #F5F5F5; color: #616161; }

@media print {
    .fpa-share-pill,
    .fpa-share-toast,
    .fpa-share-dropdown { display: none !important; }
}
