/* ═══════════════════════════════════════
   ENDLESS — RICH SOCIAL SHARE SYSTEM
   Facebook Instant Article / Open Graph Style
   ═══════════════════════════════════════ */

.share-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.share-overlay.open {
    display: flex;
    opacity: 1;
}

.share-container {
    background: var(--surface, #ffffff);
    border-radius: 24px;
    max-width: 520px;
    width: 100%;
    max-height: 92vh;
    overflow: hidden;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.1);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.share-overlay.open .share-container {
    transform: translateY(0) scale(1);
}

/* ── Share Header ── */
.share-header {
    background: linear-gradient(135deg, var(--primary, #e11d48) 0%, #991b1b 100%);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.share-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    animation: dotMove 20s linear infinite;
}

@keyframes dotMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

.share-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.share-brand-icon {
    width: 42px;
    height: 42px;
    background: #fff;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-family: Georgia, serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--primary, #e11d48);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.share-brand-text {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.02em;
}

.share-brand-text span {
    color: rgba(255,255,255,0.85);
}

.share-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all 0.2s;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.share-close:hover {
    background: rgba(255,255,255,0.35);
    transform: rotate(90deg) scale(1.1);
}

/* ── Share Preview Section ── */
.share-preview-section {
    padding: 1.25rem;
    background: linear-gradient(180deg, var(--bg, #f8f9fb) 0%, var(--surface, #ffffff) 100%);
}

.share-preview-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.share-preview-label::before {
    content: '👁';
    font-size: 1rem;
}

/* ═══════════════════════════════════════
   RICH SHARE CARD (Facebook/Instant Article Style)
   ═══════════════════════════════════════ */

.rich-share-card {
    background: var(--surface, #ffffff);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border: 1px solid var(--border, #e5e7eb);
    animation: richCardIn 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes richCardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Image Section ── */
.rich-card-image-wrap {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.rich-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.rich-share-card:hover .rich-card-image {
    transform: scale(1.05);
}

.rich-card-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        transparent 50%, 
        rgba(0,0,0,0.4) 80%, 
        rgba(0,0,0,0.7) 100%
    );
    pointer-events: none;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1rem;
}

/* ── Badge (Trending/Breaking) ── */
.rich-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 15px rgba(238, 90, 90, 0.4);
    animation: badgePulse 2s ease infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 4px 15px rgba(238, 90, 90, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(238, 90, 90, 0.6); }
}

.rich-badge-icon {
    font-size: 0.9rem;
}

/* ── Card Body ── */
.rich-card-body {
    padding: 1.5rem;
}

/* ── Source Info (Like Facebook Page Name) ── */
.rich-card-source {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.rich-source-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary, #e11d48), #991b1b);
    border-radius: 8px;
    display: grid;
    place-items: center;
    box-shadow: 0 3px 10px rgba(225, 29, 72, 0.3);
}

.rich-logo-text {
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 900;
    color: #fff;
}

.rich-source-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.rich-source-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text, #0f0f1a);
    letter-spacing: 0.02em;
}

.rich-source-verified {
    font-size: 0.7rem;
    color: var(--primary, #e11d48);
    font-weight: 600;
}

/* ── Title ── */
.rich-card-title {
    font-family: var(--font-heading, Georgia, serif);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text, #0f0f1a);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Excerpt ── */
.rich-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-muted, #6b7280);
    line-height: 1.7;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Meta Info (Date, Category, Views) ── */
.rich-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
}

.rich-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-subtle, #9ca3af);
    font-weight: 500;
}

.rich-meta-item svg {
    width: 14px;
    height: 14px;
    color: var(--primary, #e11d48);
}

.rich-category-dot {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--primary, #e11d48), #f97316);
    border-radius: 50%;
    display: inline-block;
}

/* ── Link ── */
.rich-card-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-subtle, #9ca3af);
    word-break: break-all;
    padding: 0.75rem;
    background: var(--bg, #f8f9fb);
    border-radius: 10px;
    border: 1px dashed var(--border, #e5e7eb);
}

.rich-card-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--primary, #e11d48);
}

/* ── Share Buttons ── */
.share-actions {
    padding: 1.25rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    background: var(--surface, #ffffff);
}

.share-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    border-radius: 18px;
    border: none;
    background: var(--bg, #f8f9fb);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.share-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.share-btn:hover::before {
    transform: translateX(100%);
}

.share-btn:hover {
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

.share-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.share-btn-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    transition: transform 0.3s;
    position: relative;
}

.share-btn-icon svg {
    width: 24px;
    height: 24px;
}

.share-btn:hover .share-btn-icon {
    transform: scale(1.15) rotate(-5deg);
}

.share-btn-facebook .share-btn-icon { 
    background: linear-gradient(135deg, #1877f2, #166fe5); 
    color: #fff;
    box-shadow: 0 4px 15px rgba(24, 119, 242, 0.3);
}
.share-btn-x .share-btn-icon { 
    background: linear-gradient(135deg, #000000, #1a1a1a); 
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.share-btn-whatsapp .share-btn-icon { 
    background: linear-gradient(135deg, #25d366, #128c7e); 
    color: #fff;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}
.share-btn-copy .share-btn-icon { 
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb); 
    color: var(--text, #0f0f1a); 
    border: 2px solid var(--border, #e5e7eb);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

[data-theme="dark"] .share-btn-copy .share-btn-icon {
    background: linear-gradient(135deg, #2a2a4a, #1a1a2e);
    color: #fff;
    border-color: #3a3a5a;
}

.share-btn-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Share Footer ── */
.share-footer {
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, var(--surface, #ffffff) 0%, var(--bg, #f8f9fb) 100%);
    border-top: 1px solid var(--border, #e5e7eb);
    text-align: center;
}

.share-footer p {
    font-size: 0.75rem;
    color: var(--text-subtle, #9ca3af);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}

.share-footer .logo-mini {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary, #e11d48), #991b1b);
    border-radius: 4px;
    display: inline-grid;
    place-items: center;
    font-family: Georgia, serif;
    font-size: 0.7rem;
    font-weight: 900;
    color: #fff;
}

/* ── Toast Notification ── */
.share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #111827, #1f2937);
    color: #fff;
    padding: 1rem 1.75rem;
    border-radius: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 100000;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.1);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
}

.share-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.share-toast-icon {
    font-size: 1.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.share-toast-svg svg {
    width: 22px;
    height: 22px;
}

/* ── Article Share Button (Inline) ── */
.article-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary, #e11d48), var(--primary-hover, #be123c));
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.3);
    font-family: inherit;
}

.article-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(225, 29, 72, 0.4);
}

.article-share-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.article-share-btn .share-btn-text {
    white-space: nowrap;
}

/* ── Mobile Optimizations ── */
@media (max-width: 480px) {
    .share-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .share-container {
        border-radius: 24px 24px 0 0;
        max-height: 90vh;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        transform: translateY(100%);
    }

    .share-overlay.open .share-container {
        transform: translateY(0);
    }

    .share-header {
        padding: 1.25rem;
        border-radius: 24px 24px 0 0;
    }

    .share-preview-section {
        padding: 1rem;
    }

    .rich-card-image-wrap {
        height: 200px;
    }

    .rich-card-body {
        padding: 1.25rem;
    }

    .rich-card-title {
        font-size: 1.1rem;
    }

    .rich-card-meta {
        gap: 0.5rem;
    }

    .share-actions {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        padding: 1rem;
    }

    .share-btn {
        padding: 0.75rem 0.25rem;
    }

    .share-btn-icon {
        width: 48px;
        height: 48px;
    }

    .share-btn-icon svg {
        width: 22px;
        height: 22px;
    }

    .share-btn-label {
        font-size: 0.65rem;
    }
}

/* ── Pulse animation for copy success ── */
@keyframes copyPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.share-btn-copy.copied .share-btn-icon {
    animation: copyPulse 0.4s ease;
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border-color: #10b981 !important;
    color: #fff !important;
}

.share-btn-copy.copied .share-btn-icon svg {
    stroke: #fff;
}

/* ── Hover glow effects ── */
.share-btn-facebook:hover .share-btn-icon {
    box-shadow: 0 8px 25px rgba(24, 119, 242, 0.4);
}
.share-btn-x:hover .share-btn-icon {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}
.share-btn-whatsapp:hover .share-btn-icon {
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}
.share-btn-copy:hover .share-btn-icon {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}