/**
 * Campaign Slider Widget - Styles
 * 
 * @since 3.0.0
 */

/* Container */
.givewp-campaign-slider-container {
    direction: rtl;
    text-align: right;
    padding: 20px 0;
    font-family: Arial, sans-serif;
}

.givewpSwiper {
    padding-bottom: 50px;
}

/* Campaign Card */
.givewp-campaign-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
    /* Removed transform to prevent layout shift */
}

.givewp-campaign-card:hover {
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    /* Removed transform that was causing slider to break */
}

.givewp-campaign-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 20px;
    margin-bottom: 15px;
    display: block;
    /* Prevent image from causing layout shifts */
    flex-shrink: 0;
}

.campaign-title {
    font-size: 20px;
    font-weight: 700;
    color: #6c2a5a;
    margin: 0 0 8px;
    text-align: right;
    transition: color 0.3s ease;
}

.campaign-title:hover {
    color: #8b3d75;
    text-decoration: underline;
}

/* Active amount button */
.amount-btn.active {
    background: #6c2a5a;
    border-color: #6c2a5a;
    color: #fff;
}

.campaign-description {
    color: #6b6b6b;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
    text-align: right;
}

/* Campaign Info Box */
.campaign-info-box {
    background: #f8f8f8;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: right;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}

.campaign-progress-bar {
    width: 100%;
    background: #eee;
    height: 6px;
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 6px;
    background: #6c2a5a;
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Donation Box */
.campaign-donation-box {
    margin-top: auto;
    padding-top: 10px;
}

.amount-options {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.amount-btn {
    flex: 1;
    padding: 8px;
    font-size: 14px;
    border: 2px solid #ccc;
    border-radius: 50px;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
}

.amount-btn:hover {
    border-color: #0d281b;
    color: #0d281b;
}

.donate-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: nowrap;
}

.amount-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 15px;
    border-radius: 50px;
    border: 2px solid #ccc;
    outline: none;
    text-align: center;
    min-width: 100px;
    height: 44px;
}

.amount-input:focus {
    border-color: #0d281b;
}

/* Donate Button */
.donate-now-btn {
    position: relative;
    overflow: hidden;
    padding: 0 20px;
    height: 44px;
    font-size: 15px;
    font-weight: 600;
    border: 2px solid #0d281b;
    border-radius: 50px;
    background: #fff;
    color: #0d281b;
    cursor: pointer;
    transition: color 0.4s ease;
    white-space: nowrap;
    min-width: 110px;
}

.donate-now-btn .btn-text {
    position: relative;
    z-index: 2;
}

.donate-now-btn .btn-fill {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 100%;
    background: #0d281b;
    transition: width 0.6s ease, left 0.6s ease;
    z-index: 1;
}

.donate-now-btn:hover .btn-fill {
    width: 100%;
    left: 0;
}

.donate-now-btn:hover {
    color: #fff;
}

/* Learn More Button */
.learn-more-btn {
    width: 100%;
    padding: 9px;
    font-size: 14px;
    border: 2px solid #8a8a8a;
    border-radius: 50px;
    background: #f9f9f9;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
}

.learn-more-btn:hover {
    background: #f0f0f0;
    border-color: #666;
}

/* Hidden placeholder button - takes up space but invisible */
.learn-more-hidden {
    visibility: hidden;
    pointer-events: none;
    cursor: default;
}

.learn-more-hidden:hover {
    background: #f9f9f9 !important;
    border-color: #8a8a8a !important;
}

/* Grid Mode */
.givewp-campaign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

/* Popup Modal */
.givewp-donation-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.popup-close {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: #333;
    z-index: 10;
    transition: all 0.3s;
}

.popup-close:hover {
    background: #f44336;
    color: #fff;
    border-color: #f44336;
    transform: rotate(90deg);
}

.popup-body {
    padding: 30px;
}

.popup-loading {
    text-align: center;
    padding: 60px 20px;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6c2a5a;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.popup-loading p {
    color: #666;
    font-size: 16px;
}

.popup-form-container {
    text-align: center;
    min-height: 400px;
}

/* Iframe styling for GiveWP forms */
.givewp-form-iframe {
    width: 100%;
    min-height: 550px;
    border: none;
    display: block;
    background: #fff;
    border-radius: 10px;
}

.popup-form-container iframe {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .popup-content {
        width: 95%;
        max-height: 95vh;
    }

    .popup-body {
        padding: 20px;
    }

    .givewp-campaign-card img {
        height: 180px;
    }
}