/* ============================================
   Campaign Share Button Styles
   Reusable share button component
   ============================================ */

/* Campaign Share Button Overlay on Image */
.cm-details__poster,
.cause__slider-single .thumb {
    position: relative;
    margin-bottom: 40px !important; /* Space for floating button */
}

/* Reset margin for homepage campaigns */
.cause__slider-single .thumb {
    margin-bottom: 0 !important;
}

/* Smaller share button for homepage campaign cards */
.cause__slider-single .campaign-share-btn {
    width: 45px;
    height: 45px;
    bottom: 10px;
    left: 10px;
    border: 2px solid #fff;
}

.cause__slider-single .campaign-share-btn i {
    font-size: 16px;
}

.cause__slider-single .campaign-share-btn:hover {
    transform: scale(1.08) translateY(-2px);
}

.campaign-share-btn {
    position: absolute;
    bottom: -22px; /* Floating outside the image */
    left: 20px;
    background: linear-gradient(135deg, #00796b, #004d40);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
    animation: sharePulse 2.5s ease-in-out infinite;
}

.campaign-share-btn:hover {
    background: linear-gradient(135deg, #004d40, #00796b);
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 121, 107, 0.4);
    animation: none; /* Stop pulse on hover */
}

.campaign-share-btn i {
    font-size: 20px;
    color: #fff;
    transition: all 0.3s ease;
}

.campaign-share-btn:hover i {
    transform: rotate(360deg);
    color: #fff;
}

/* RTL Support for share button */
[dir="rtl"] .campaign-share-btn {
    left: auto;
    right: 20px;
}

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

.share-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.share-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-modal-content {
    background-color: #fff;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.share-modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.share-modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.share-modal-close:hover {
    color: #00796b;
}

.share-modal-body {
    padding: 30px;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    border-radius: 12px;
    background: #f8f9fa;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-weight: 600;
}

.share-option:hover {
    background: #00796b;
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 121, 107, 0.3);
}

.share-option i {
    font-size: 28px;
    margin-bottom: 10px;
}

.share-option span {
    font-size: 13px;
}

/* Individual platform colors on hover */
.share-option[data-platform="facebook"]:hover {
    background: #1877f2;
}

.share-option[data-platform="twitter"]:hover {
    background: #1da1f2;
}

.share-option[data-platform="whatsapp"]:hover {
    background: #25d366;
}

.share-option[data-platform="email"]:hover {
    background: #ea4335;
}

.share-option[data-platform="copy"]:hover {
    background: #00796b;
}

/* ============================================
   Animations
   ============================================ */

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

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

@keyframes sharePulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 4px 15px rgba(0, 121, 107, 0.5), 0 0 0 8px rgba(0, 121, 107, 0.15);
    }
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 768px) {
    .campaign-share-btn {
        width: 50px;
        height: 50px;
        bottom: -18px;
        left: 15px;
        border: 3px solid #fff;
    }

    .campaign-share-btn i {
        font-size: 18px;
    }

    /* Smaller on homepage campaigns for mobile */
    .cause__slider-single .campaign-share-btn {
        width: 40px;
        height: 40px;
        bottom: 8px;
        left: 8px;
        border: 2px solid #fff;
    }

    .cause__slider-single .campaign-share-btn i {
        font-size: 14px;
    }

    [dir="rtl"] .campaign-share-btn {
        left: auto;
        right: 15px;
    }

    [dir="rtl"] .cause__slider-single .campaign-share-btn {
        left: auto;
        right: 8px;
    }

    .share-modal-content {
        width: 95%;
    }

    .share-modal-header {
        padding: 20px;
    }

    .share-modal-header h3 {
        font-size: 18px;
    }

    .share-modal-body {
        padding: 20px;
    }

    .share-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .share-option {
        padding: 15px 10px;
    }

    .share-option i {
        font-size: 24px;
    }
}
