/**
 * share.css -- MyBest24 Share Feature Styles
 * Load after account.css in index.html
 */

/* ── SHARE ICON — bottom-right of .box-icon-display ─────────────────────── */

.share-icon-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #333;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, opacity 0.15s;
    z-index: 10;
}

.share-icon-btn:hover {
    border-color: var(--accent-color);
    opacity: 0.75;
}

.share-icon-img {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
    filter: var(--icon-accent-filter);
    display: block;
}

/* ── DESKTOP SHARE POPOVER ───────────────────────────────────────────────── */
/*
 * Static HTML lives in index.html #share-popover.
 * JS positions it and toggles the .hidden class.
 * Style mirrors the Twitter/X dark mode sheet:
 * dark bg, full-width rows, pixel icons, bold labels.
 */

.share-popover {
    position: fixed;
    z-index: 2000;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    width: 260px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    animation: sharePopoverIn 0.15s ease;
}

.share-popover.hidden {
    display: none;
}

@keyframes sharePopoverIn {
    from { opacity: 0; transform: translateY(6px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

/* Preview header */
.share-popover-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.share-popover-icon-wrap {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-popover-icon-img {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    filter: var(--icon-accent-filter);
}

.share-popover-preview-text {
    flex: 1;
    min-width: 0;
}

.share-popover-invite-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.share-popover-time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.share-popover-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0;
}

/* Option rows — Twitter/X style: full-width, icon + bold label */
.share-popover-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    padding: 14px 16px;
    transition: background 0.1s;
    text-align: left;
}

.share-popover-option:last-child {
    border-bottom: none;
}

.share-popover-option:hover {
    background: rgba(255, 255, 255, 0.06);
}

.share-popover-option:active {
    background: rgba(255, 255, 255, 0.1);
}

.share-popover-opt-icon {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
    filter: var(--icon-accent-filter);
    flex-shrink: 0;
    display: block;
}

.share-popover-opt-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    font-family: inherit;
    letter-spacing: 0.01em;
}

/* Copy link success state */
.share-popover-option.copied .share-popover-opt-label {
    color: var(--accent-color, #46a5ce);
}

.share-popover-option.copied .share-popover-opt-icon {
    filter: none;
    opacity: 0.7;
}

/* ── INVITE PREVIEW MODAL ────────────────────────────────────────────────── */

#share-invite-modal {
    position: fixed;
    inset: 0;
    z-index: 1800;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: shareModalBgIn 0.2s ease;
}

#share-invite-modal.modal-hidden { display: none; }

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

.share-invite-card {
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 30px 24px 24px;
    width: min(320px, 90vw);
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8);
    animation: shareCardIn 0.2s ease;
}

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

.share-invite-icon-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-invite-icon-wrap img {
    width: 56px;
    height: 56px;
    image-rendering: pixelated;
}

.share-invite-headline {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 5px;
}

.share-invite-time {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 14px;
}

.share-invite-notes {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 14px;
    text-align: left;
    line-height: 1.4;
}

.share-invite-login-nudge {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
    line-height: 1.4;
}

.share-invite-sent-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
}

.share-invite-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.share-invite-btn-primary {
    flex: 1;
    padding: 11px 14px;
    border-radius: 9px;
    border: none;
    cursor: pointer;
    font-size: 0.86rem;
    font-family: inherit;
    font-weight: 700;
    background: var(--accent-color, #46a5ce);
    color: #fff;
    transition: opacity 0.15s;
}

.share-invite-btn-primary:hover  { opacity: 0.85; }
.share-invite-btn-primary:active { opacity: 0.7; }

.share-invite-btn-secondary {
    padding: 11px 14px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-size: 0.86rem;
    font-family: inherit;
    font-weight: 700;
    background: none;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.15s, border-color 0.15s;
}

.share-invite-btn-secondary:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* ── ACCEPTED TOAST ──────────────────────────────────────────────────────── */

.share-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(70px);
    z-index: 3000;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 40px;
    padding: 10px 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
    white-space: nowrap;
    transition: transform 0.3s cubic-bezier(.34, 1.56, .64, 1), opacity 0.3s;
    opacity: 0;
    pointer-events: none;
}

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

/* ── SENT INVITE PULSE DOT ───────────────────────────────────────────────── */

.share-sent-pulse {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-color, #46a5ce);
    animation: sentPulse 1.4s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes sentPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.35; transform: scale(0.65); }
}
/* ── BOX MODAL HEADER — share button replaces close button, top-right ────── */

/* Override absolute positioning from icon-display context */
.box-modal-share-btn {
    position: static;
}

/* ── INVITE VIEW LINK ────────────────────────────────────────────────────── */

.share-invite-view-link {
    display: block;
    width: fit-content;
    margin: 0 auto 12px;
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-color);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s;
}

.share-invite-view-link:hover {
    opacity: 0.75;
}

/* ── Invite preview — event row (icon + slices side by side) ── */
.share-invite-preview-event {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    margin-bottom: 4px;
}

/* When slices are present, shrink the icon wrap */
.share-invite-icon-wrap-slim {
    flex-shrink: 0;
}
.share-invite-icon-wrap-slim img {
    width: 56px;
    height: 56px;
}

/* Slice list in invite preview */
.share-invite-slices {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    text-align: left;
    max-height: 160px;
    overflow: hidden;
}

.share-invite-slice-item {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    padding: 3px 8px;
    border-left: 2px solid var(--accent-color);
    line-height: 1.3;
}