.share-icon-container {
    display: inline-block;
    cursor: pointer;
}

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.icon:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.svg-icon {
    width: 18px;
    height: 18px;
}

.share-modal {
    position: fixed;
    inset: 0px;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease; /* Added visibility to transition */
    display: flex;
    justify-content: center;
    align-items: flex-end;
}


.share-modal.active {
    opacity: 1;
    visibility: visible;
}

.share-modal-content {
    background-color: var(--Mainbg);
    width: 100%;
    border-radius: 16px 16px 0px 0px;
    box-shadow: rgba(0, 0, 0, 0.15) 0px -2px 12px;
    transform: translateY(100%);
    transition: transform 0.35s ease, opacity 0.3s ease; /* Added opacity */
    border: var(--border);
}

.share-modal.active .share-modal-content {
    transform: translateY(0px);
}
@media (max-width: 768px) { /* anything smaller than desktop */
  .share-modal-content {
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
}

@media (min-width: 768px) {
    .share-modal {
        align-items: center;
        
    }

    .share-modal-content {
        border-radius: 12px;
        width: 90%;
        max-width: 400px;
        transform: scale(0.8);
    }

    .share-modal.active .share-modal-content {
        transform: scale(1);
    }
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.share-modal-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.share-modal-close {
    background: var(--search-header-x);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color);
    padding: 0px;
    transition: 0.2s;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-modal-close:hover {
    color: rgba(255, 255, 255, 0.555);
    background-color: rgba(99, 99, 99, 0.479);
}

.share-modal-divider {
    height: 1px;
    background-color: var(--labletag);
    margin: 0px 0px;
}

.share-platforms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 12px;
    padding: 20px;
    justify-items: center;
}

.share-platform {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    padding: 8px;
    border-radius: 12px;
    transition: background 0.2s;
}

.platform-icon {
    width: 36px;
    height: 36px;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    object-fit: contain;
    transition: background-color 0.2s, transform 0.2s;
}

.share-platform:hover .platform-icon {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.share-platform:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.share-platform span {
    font-size: 0.85rem;
    margin-top: 4px;
    font-weight: 500;
    color: rgb(51, 51, 51);
}

.share-link-container {
    display: flex;
    align-items: center;
    padding: 16px 20px;
}

.share-link {
    flex: 1 1 0%;
    display: flex;
    align-items: center;
    background-color: var(--evenchildtable);
    border-radius: 8px;
    padding: 8px 12px;
    overflow: hidden;
}

.share-link svg {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0;
}

#currentPageUrl {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
}

.copy-link-btn {
    margin-left: 10px;
    background-color: var(--search-header-x);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--color);
    font-family: inherit;
    transition: background-color 0.2s;
}

.copy-link-btn:hover {
    background-color: rgba(224, 224, 224, 0.247);
}

.copy-link-btn svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
}

.share-platform i {
    font-size: 27px;
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--postmetaicons);
    border-radius: 50%;
    padding: 6px;
    transition: background 0.2s;
}

