/* Floating Action Button for Social Share */
.fab-social-share {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.fab-main {
    background: linear-gradient(135deg, #40B977, #2D8B57);
    color: #fff;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
}

.fab-main:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    padding: 15px;
    display: none;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.fab-social-share.active .fab-menu {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.fab-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.fab-item:hover {
    background-color: #f5f5f5;
    color: #40B977;
}

.fab-item i {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.fab-item span {
    font-size: 14px;
}

/* Icon transitions */
.fab-main i {
    position: absolute;
    transition: all 0.3s ease;
}

.fab-main i.bi-chat-fill {
    opacity: 1;
    transform: rotate(0deg);
}

.fab-main i.bi-x {
    opacity: 0;
    transform: rotate(90deg);
}

.fab-social-share.active .fab-main i.bi-chat-fill {
    opacity: 0;
    transform: rotate(-90deg);
}

.fab-social-share.active .fab-main i.bi-x {
    opacity: 1;
    transform: rotate(0deg);
}

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

.fab-close {
    position: absolute;
    top: -5px; /* Adjust position relative to the menu */
    right: -5px;
    background-color: #e8e8e8;
    color: #555;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.fab-close:hover {
    background-color: #ddd;
    color: #333;
}

/* Adjustments for scroll-top proximity */
/* If #scroll-top has specific positioning, adjust .fab-social-share 'bottom' accordingly */
/* Example: If #scroll-top is bottom: 20px, height: 50px, then .fab-social-share bottom might be 20 + 50 + 10 (gap) = 80px */

/* Optional: Hide FAB on smaller screens if needed */
/* @media (max-width: 767px) {
    .fab-social-share {
        display: none;
    }
} */

.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#fab-share-toggle {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.75rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#fab-share-toggle:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

#fab-share-toggle.active {
    transform: rotate(45deg);
}

#fab-share-menu {
    position: absolute;
    bottom: 4.5rem;
    right: 0;
    background-color: white;
    border-radius: 0.5rem;
    padding: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

#fab-share-menu.active {
    display: flex;
    animation: slideIn 0.3s ease;
}

#fab-share-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

#fab-share-menu a:hover {
    background-color: #f8f9fa;
}

#fab-share-menu i {
    margin-right: 0.75rem;
    font-size: 1.25rem;
}

#fab-share-menu span {
    font-size: 0.9rem;
} 