/* ===== Share Modal ===== */

/* Overlay */
.share-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.share-modal-overlay.share-modal--open {
    opacity: 1;
    pointer-events: auto;
}

/* Backdrop */
.share-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

/* Panel */
.share-modal-panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--bg-primary, #ffffff);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.18);
    transform: translateY(100%);
    transition: transform 0.25s ease;
    max-height: 85vh;
    overflow-y: auto;
}
.share-modal--open .share-modal-panel {
    transform: translateY(0);
}

/* Header */
.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 8px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.share-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
}
.share-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #6b7280);
    font-size: 1.125rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s ease;
}
.share-modal-close:hover {
    background: var(--bg-secondary, #f3f4f6);
}

/* Body / Grid */
.share-modal-body {
    padding: 16px 20px 24px;
}
.share-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px 8px;
}

/* Share Option */
.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 8px 4px;
    cursor: pointer;
    color: var(--text-primary, #111827);
    border-radius: 12px;
    transition: background 0.15s ease;
}
.share-option:hover {
    background: var(--bg-secondary, #f3f4f6);
}
.share-option:active {
    transform: scale(0.95);
}

/* Icon Circle */
.share-option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.25rem;
    color: #fff;
}
.share-option-label {
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-secondary, #6b7280);
    text-align: center;
}

/* Brand Colors */
.share-icon-facebook  { background: #1877f2; }
.share-icon-twitter   { background: #000000; }
.share-icon-linkedin  { background: #0a66c2; }
.share-icon-whatsapp  { background: #25d366; }
.share-icon-telegram  { background: #0088cc; }
.share-icon-reddit    { background: #ff4500; }
.share-icon-pinterest { background: #e60023; }
.share-icon-email     { background: #6b7280; }
.share-icon-sms       { background: #34c759; }
.share-icon-copy      { background: var(--primary-color, #3b82f6); }

/* Desktop: center the modal */
@media (min-width: 640px) {
    .share-modal-overlay {
        align-items: center;
    }
    .share-modal-panel {
        border-radius: 16px;
        transform: translateY(24px) scale(0.96);
    }
    .share-modal--open .share-modal-panel {
        transform: translateY(0) scale(1);
    }
}

/* Small phones: 4 columns */
@media (max-width: 359px) {
    .share-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Safe area for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .share-modal-panel {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
