/**
 * Mathrubhumi-Inspired Post Share Feature Styles
 * Disciples News Portal
 */

/* ==========================================================================
   1. Homepage Post Card Share Button Trigger
   ========================================================================== */
.post-card-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 20px;
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    text-decoration: none;
}

.post-card-share-btn svg.share-icon {
    width: 12px;
    height: 12px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.post-card-share-btn:hover {
    background: rgba(225, 29, 72, 0.08);
    border-color: rgba(225, 29, 72, 0.2);
    color: #e11d48;
    transform: translateY(-1px);
}

.post-card-share-btn:hover svg.share-icon {
    transform: scale(1.15);
}

.post-card-share-btn:active {
    transform: translateY(0);
}

/* Card Footer Flex Container Helper */
.card-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

/* Featured / Dark Section Share Button Variation */
.share-btn-light {
    color: rgba(255, 255, 255, 0.8) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

.share-btn-light:hover {
    color: #ffffff !important;
    background: #e11d48 !important;
    border-color: #e11d48 !important;
}

/* ==========================================================================
   2. Share Modal & Backdrop Overlay (Mathrubhumi Style)
   ========================================================================== */
body.dn-share-locked {
    overflow: hidden !important;
    touch-action: none;
}

.dn-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.dn-share-modal.dn-share-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.dn-share-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.28s ease;
}

.dn-share-dialog {
    position: relative;
    width: 100%;
    max-width: 800px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    z-index: 2;
    transform: scale(0.92) translateY(12px);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.dn-share-modal.dn-share-active .dn-share-dialog {
    transform: scale(1) translateY(0);
}

/* Close Button */
.dn-share-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.dn-share-close-btn:hover {
    background: #fee2e2;
    color: #e11d48;
    transform: rotate(90deg);
}

/* ==========================================================================
   3. Two-Pane Split Layout (Desktop)
   ========================================================================== */
.dn-share-layout {
    display: flex;
    width: 100%;
    min-height: 420px;
}

/* Left Pane: Article Preview */
.dn-share-preview-pane {
    width: 42%;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-right: 1px solid #e2e8f0;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.dn-share-brand-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.dn-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #e11d48;
    color: #ffffff;
    font-weight: 800;
    font-size: 11px;
    border-radius: 7px;
    letter-spacing: -0.5px;
}

.dn-brand-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
}

.dn-share-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    margin-bottom: 14px;
}

.dn-share-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.dn-share-cat-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.dn-share-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    color: #0f172a;
    margin: 0 0 auto 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dn-share-preview-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.dn-share-live-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: #e11d48;
    background: #fee2e2;
    padding: 2px 7px;
    border-radius: 12px;
}

/* Right Pane: Actions & Social Channels */
.dn-share-actions-pane {
    width: 58%;
    padding: 28px 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
}

.dn-share-header {
    margin-bottom: 20px;
}

.dn-share-heading {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.dn-share-sub {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0;
}

/* ==========================================================================
   4. Social Channels Row (Mathrubhumi Circular Buttons)
   ========================================================================== */
.dn-share-channels {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 22px;
}

.dn-channel-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #475569;
    transition: transform 0.2s ease;
}

.dn-channel-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.dn-channel-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #475569;
    text-align: center;
    transition: color 0.2s ease;
}

.dn-channel-btn:hover {
    transform: translateY(-3px);
    text-decoration: none;
}

.dn-channel-btn:hover .dn-channel-icon {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    transform: scale(1.06);
}

/* Channel Brand Specific Colors */
.dn-channel-wa .dn-channel-icon   { background: #25D366; }
.dn-channel-fb .dn-channel-icon   { background: #1877F2; }
.dn-channel-x .dn-channel-icon    { background: #0f1419; }
.dn-channel-tg .dn-channel-icon   { background: #0088cc; }
.dn-channel-li .dn-channel-icon   { background: #0a66c2; }
.dn-channel-mail .dn-channel-icon { background: #64748b; }

.dn-channel-wa:hover .dn-channel-label   { color: #25D366; }
.dn-channel-fb:hover .dn-channel-label   { color: #1877F2; }
.dn-channel-x:hover .dn-channel-label    { color: #0f1419; }
.dn-channel-tg:hover .dn-channel-label   { color: #0088cc; }
.dn-channel-li:hover .dn-channel-label   { color: #0a66c2; }
.dn-channel-mail:hover .dn-channel-label { color: #64748b; }

/* ==========================================================================
   5. Utility Actions (Copy Link, QR Code, Native Share)
   ========================================================================== */
.dn-share-utils {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.dn-util-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dn-util-action-btn:hover {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dn-util-action-btn.active {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #e11d48;
}

/* QR Drawer */
.dn-share-qr-drawer {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
    animation: dnFadeIn 0.25s ease-out;
}

.dn-qr-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.dn-qr-canvas-wrap {
    background: #ffffff;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dn-qr-canvas-wrap canvas,
.dn-qr-canvas-wrap img {
    width: 110px;
    height: 110px;
    display: block;
}

.dn-qr-desc h6 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

/* Direct URL Copy Bar */
.dn-share-url-box {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px 6px;
    transition: border-color 0.2s ease;
}

.dn-share-url-box:focus-within {
    border-color: #e11d48;
    background: #ffffff;
}

.dn-share-url-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: #475569;
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dn-share-url-input.dn-copy-highlight {
    color: #059669;
    font-weight: 600;
}

.dn-share-quick-copy {
    border: none;
    background: #e11d48;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.dn-share-quick-copy:hover {
    background: #be123c;
}

/* ==========================================================================
   6. Toast Floating Alert
   ========================================================================== */
.dn-share-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: #0f172a;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.dn-share-toast i {
    color: #10b981;
}

/* Animations */
@keyframes dnFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   7. Responsive Mobile Adaptations (< 768px)
   ========================================================================== */
@media (max-width: 767.98px) {
    .dn-share-layout {
        flex-direction: column;
    }

    .dn-share-preview-pane {
        width: 100%;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .dn-share-preview-pane .dn-share-img-wrap {
        display: none; /* Hide large image on small mobile to maximize share actions visibility */
    }

    .dn-share-title {
        font-size: 0.92rem;
        -webkit-line-clamp: 2;
    }

    .dn-share-actions-pane {
        width: 100%;
        padding: 18px 16px 20px 16px;
    }

    .dn-share-heading {
        font-size: 1.15rem;
    }

    .dn-share-channels {
        gap: 8px;
    }

    .dn-channel-icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .dn-qr-wrapper {
        flex-direction: column;
        text-align: center;
    }
}
