.floating-menu {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    z-index: 1000;
    direction: rtl;
    opacity: 0;
    display: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: calc(100% - 40px); /* Prevent overflow */
}

.floating-menu.active {
    display: block;
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.floating-menu.closed {
    display: none;
    opacity: 0;
}

.floating-menu-buttons {
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.floating-menu-button {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.floating-menu-button:hover {
    transform: scale(1.1);
}

.floating-menu-button:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.floating-menu-button i,
.floating-menu-button svg {
    font-size: 16px;
    transition: color 0.3s ease;
}

.floating-menu-button a {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.floating-menu-button .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1001;
    max-width: calc(100vw - 80px); /* Prevent tooltip overflow */
}

.modal-backdrop {
    display: none;
    position: fixed;
    z-index: 99999998;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.share-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999999;
    direction: ltr;
    max-width: 90vw; /* Prevent popup overflow */
}

.modal-backdrop .closee {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s ease;
    z-index: 999999999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
}

.share-container {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 356px;
    transition: transform 0.3s ease;
}

.shareh {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 10px;
    justify-items: center;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 8px;
}

.shareh .social-share {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    width: 60px;
    height: 80px;
    font-size: 40px;
    text-align: center;
    margin: 5px;
    transition: all 0.2s ease-in-out;
    border-radius: 8px;
    opacity: 0.8;
}

.shareh .social-share:hover {
    opacity: 1;
    transform: scale(1.05);
}

.shareh .social-share .social-icon {
    margin-bottom: -10px;
}

.shareh .social-share i,
.shareh .social-share svg {
    transition: all 0.2s ease-in-out;
}

.shareh .social-share p {
    font-size: 12px;
    margin: 0;
    text-align: center;
}

/* Specific colors for social icons */
.social-share[href*="twitter.com"] i,
.social-share[href*="twitter.com"] svg {
    color: #1DA1F2;
}

.social-share[href*="facebook.com"] i,
.social-share[href*="facebook.com"] svg {
    color: #3B5998;
}

.social-share[href*="telegram.me"] i,
.social-share[href*="telegram.me"] svg {
    color: #0088cc;
}

.social-share[href*="linkedin.com"] i,
.social-share[href*="linkedin.com"] svg {
    color: #0077B5;
}

.social-share[href*="whatsapp"] i,
.social-share[href*="whatsapp"] svg {
    color: #25D366;
}

.item-cop {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.item-cop .texxt {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 14px;
    padding: 8px;
    text-align: center;
    transition: all 0.2s ease-in-out;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.item-cop .texxt i,
.item-cop .texxt svg {
    font-size: 14px;
}

.item-cop .texxt span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-cop .coop {
    height: 40px;
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: all 0.2s ease-in-out;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.item-cop .coop:hover {
    transform: scale(1.02);
}

.item-cop .coop.copied {
    background: #28a745;
}

.floating-toggle-button {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    z-index: 999;
    display: none;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
    align-items: center;
    gap: 8px;
    opacity: 0;
    padding: 8px 12px;
}
.floating-toggle-button.active {
    display: flex;
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.floating-toggle-button:hover {
    transform: translateY(-50%) scale(1.05);
}

.floating-toggle-button i,
.floating-toggle-button svg {
    font-size: 16px;
}

.floating-toggle-button span {
    font-size: 12px;
}

/* Vertical label orientation */
.floating-toggle-button.toggle-label-vertical {
    flex-direction: column;
    padding: 8px;
    gap: 26px;
    border-radius: 10px;
    height: 100px;
}

.floating-toggle-button.toggle-label-vertical span {
    font-size: 10px;
    transform: rotate(270deg);
    transform-origin: center;
    white-space: nowrap;
}

/* Mobile styles */
@media (max-width: 767px) {
    body {
        overflow-x: hidden; /* Prevent horizontal scroll */
    }

    .floating-menu {
        left: 8px;
        max-width: calc(100% - 16px); /* Ensure no overflow */
    }

    .floating-menu-buttons {
        padding: 6px;
        gap: 6px;
    }

    .floating-menu-button {
        width: 32px;
        height: 32px;
    }

    .floating-menu-button i,
    .floating-menu-button svg {
        font-size: 14px;
    }

    .floating-menu-button .tooltip {
        font-size: 10px;
        padding: 4px 8px;
        left: 40px;
        max-width: calc(100vw - 60px); /* Prevent tooltip overflow */
    }

    .share-container {
        max-width: 300px;
        padding: 15px;
    }

    .shareh {
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
        gap: 8px;
        padding: 8px;
    }

    .shareh .social-share {
        width: 50px;
        height: 65px;
        font-size: 32px;
        margin: 4px;
    }

    .shareh .social-share p {
        font-size: 10px;
    }

    .item-cop {
        margin-top: 15px;
        gap: 8px;
    }

    .item-cop .texxt {
        font-size: 12px;
        padding: 6px;
    }

    .item-cop .texxt i,
    .item-cop .texxt svg {
        font-size: 12px;
    }

    .item-cop .coop {
        height: 36px;
        font-size: 12px;
    }

    .item-cop .coop i,
    .item-cop .coop svg {
        font-size: 12px;
    }

    .modal-backdrop .closee {
        top: 15px;
        right: 15px;
        font-size: 32px;
        width: 32px;
        height: 32px;
        line-height: 32px;
    }

        .floating-toggle-button {
        left: 4px;
        padding: 6px;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        justify-content: center;
        gap: 6px;
    }

    .floating-toggle-button i,
    .floating-toggle-button svg {
        font-size: 20px;
    }

    .floating-toggle-button span {
        font-size: 13px;
        display: inline; 
    }

    .floating-toggle-button.toggle-label-vertical {
        padding: 6px;
        width: 32px;
        height: 120px;
        border-radius: 10px;
    }
}