/* CineGrid reusable social share modal + trigger button */

.cg-share-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.5rem 0.95rem;
    background: #ff3c3c;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: 'Raleway', 'Lato', 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    min-height: 40px;
    box-shadow: none;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.cg-share-trigger i {
    font-size: 0.9rem;
}

.cg-share-trigger:hover,
.cg-share-trigger:focus-visible {
    background: #e03131;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 60, 60, 0.22);
}

.cg-share-trigger:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.cg-share-trigger:active {
    transform: translateY(0);
    box-shadow: none;
}

.cg-share-trigger--icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 50%;
    gap: 0;
    font-size: 0.85rem;
    line-height: 1;
    flex-shrink: 0;
}

.message-vendor-btn-wrap .cg-share-trigger--icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    font-size: 1rem;
}

.freelancer-actions-container .cg-share-trigger--icon {
    width: 45px;
    height: 45px;
    min-width: 45px;
    min-height: 45px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(255, 60, 60, 0.2);
}

.cg-share-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.cg-share-meta-row .product-badges {
    margin-bottom: 0;
    flex: 1 1 auto;
}

.portfolio-creator-card .cg-share-trigger {
    width: 100%;
    box-sizing: border-box;
    min-height: 0;
    height: auto;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: 6px;
    gap: 0.5rem;
}

.portfolio-creator-card .cg-share-trigger i {
    font-size: 1rem;
}

.cg-share-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.cg-share-modal.is-open {
    display: flex;
}

.cg-share-overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
}

.cg-share-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.cg-share-modal.is-open .cg-share-overlay {
    animation: cgShareFadeIn 0.16s ease;
}

.cg-share-modal.is-open .cg-share-dialog {
    animation: cgShareSlideIn 0.18s ease;
}

.cg-share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
}

.cg-share-title {
    margin: 0;
    font-family: 'Raleway', 'Lato', 'Segoe UI', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
}

.cg-share-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: -6px -6px -6px 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    flex-shrink: 0;
}

.cg-share-close:hover,
.cg-share-close:focus-visible {
    background: #f3f4f6;
    color: #111;
}

.cg-share-close:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.cg-share-rule {
    height: 1px;
    background: #e5e7eb;
    margin: 0;
}

.cg-share-body {
    padding: 16px 20px 8px;
}

.cg-share-description {
    margin: 0 0 18px;
    color: #6b7280;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.cg-share-networks {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cg-share-network {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #374151;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.cg-share-network:hover .cg-share-network-icon,
.cg-share-network:focus-visible .cg-share-network-icon {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}

.cg-share-network:focus-visible {
    outline: none;
}

.cg-share-network:focus-visible .cg-share-network-icon {
    outline: 2px solid #2563eb;
    outline-offset: 3px;
}

.cg-share-network-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.15rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cg-share-network-icon--facebook { background: #1877f2; }
.cg-share-network-icon--x { background: #111111; }
.cg-share-network-icon--whatsapp { background: #25d366; }
.cg-share-network-icon--viber { background: #7360f2; }
.cg-share-network-icon--reddit { background: #ff4500; }

.cg-share-network-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7280;
    line-height: 1.2;
}

.cg-share-copy-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.cg-share-url {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    color: #111;
    font-size: 0.875rem;
    font-family: inherit;
    user-select: text;
    -webkit-user-select: text;
}

.cg-share-url:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
    background: #fff;
}

.cg-share-copy {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 44px;
    min-width: 112px;
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.cg-share-copy:hover,
.cg-share-copy:focus-visible {
    background: #1d4ed8;
}

.cg-share-copy:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.cg-share-copy.is-copied {
    background: #15803d;
}

.cg-share-copy-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.cg-share-modal .visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.cg-share-status {
    min-height: 1.2em;
    margin: 8px 0 4px;
    font-size: 0.8rem;
    color: #6b7280;
}

.cg-share-footer {
    padding: 12px 20px 18px;
}

.cg-share-done {
    width: 100%;
    min-height: 44px;
    border: none;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
}

.cg-share-done:hover,
.cg-share-done:focus-visible {
    background: #030712;
}

.cg-share-done:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

@media (max-width: 576px) {
    .cg-share-modal {
        padding: 12px;
    }

    .cg-share-dialog {
        width: 100%;
        max-width: none;
        border-radius: 12px;
    }

    .cg-share-header,
    .cg-share-body,
    .cg-share-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .cg-share-network-icon {
        width: 44px;
        height: 44px;
        font-size: 1.05rem;
    }

    .cg-share-copy-row {
        flex-direction: column;
    }

    .cg-share-copy,
    .cg-share-url {
        width: 100%;
    }

    .cg-share-trigger {
        min-height: 44px;
    }

    .cg-share-trigger--icon {
        min-height: 36px;
    }

    .message-vendor-btn-wrap {
        flex-wrap: nowrap !important;
    }

    .message-vendor-btn-wrap .btn {
        width: auto !important;
        flex: 1 1 auto !important;
    }

    .message-vendor-btn-wrap .cg-share-trigger--icon {
        min-height: 42px;
    }

    .freelancer-actions-container .cg-share-trigger--icon {
        min-height: 45px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cg-share-modal.is-open .cg-share-overlay,
    .cg-share-modal.is-open .cg-share-dialog,
    .cg-share-trigger,
    .cg-share-network-icon {
        animation: none !important;
        transition: none !important;
    }

    .cg-share-trigger:hover,
    .cg-share-trigger:focus-visible,
    .cg-share-network:hover .cg-share-network-icon,
    .cg-share-network:focus-visible .cg-share-network-icon {
        transform: none;
    }
}

@keyframes cgShareFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cgShareSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

body.cg-share-modal-open {
    overflow: hidden;
}
