/* Flow2 shared share modal.
 *
 * Used by /m/{id} viewer, /user/myflows, /user/profile/{id}, and any future
 * surface that needs a "share this flow" affordance. Owned by share-modal.js
 * (see include/js/share-modal.js) — do not inline-render the markup elsewhere.
 *
 * Design tokens: matches CLAUDE.md "Design system enforcement" — colors,
 * spacing, radii pulled from design-system.md.
 */

.share-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.share-modal-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

.share-modal {
    background: #1a1a1a;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

.share-modal-backdrop.visible .share-modal {
    transform: scale(1);
    opacity: 1;
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.share-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #f0f0f0;
}

.share-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    padding: 0;
    line-height: 1;
}

.share-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.share-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.share-option-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.share-option:hover .share-option-icon { transform: scale(1.05); }
.share-option:active .share-option-icon { transform: scale(0.95); }

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

.share-option-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

.share-option-x .share-option-icon {
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.share-option-facebook .share-option-icon { background: #1877f2; }
.share-option-linkedin .share-option-icon { background: #0a66c2; }

.share-qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 0 0 20px;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.share-qr-image {
    display: block;
    width: 200px;
    height: 200px;
    /* Rendered PNG ships its own rounded white frame with transparent
       corners — no background or border-radius here, the dark modal bg
       shows through naturally. */
}

.share-qr-link {
    color: #426ab8;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.share-qr-link:hover {
    background: rgba(66, 106, 184, 0.12);
    text-decoration: none;
}

.share-url-row {
    display: flex;
    gap: 8px;
}

.share-url-input {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 12px;
    color: #f0f0f0;
    font-size: 13px;
    font-family: inherit;
}

.share-url-input:focus {
    outline: none;
    border-color: #426ab8;
    box-shadow: 0 0 0 3px rgba(66, 106, 184, 0.1);
}

.share-copy-btn {
    background: #426ab8;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.share-copy-btn:hover { background: #355492; }
.share-copy-btn.copied { background: #10b981; }
