/**
 * Quick Donation Form - Styles
 * 
 * Floating button and popup styles
 * RTL support for Arabic
 * 
 * @since 1.0.0
 */

/* === Container === */
.givewp-quick-donate-container {
    position: fixed;
    z-index: 999999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Positions */
.givewp-quick-donate-container.position-bottom-left {
    bottom: 30px;
    left: 30px;
}

.givewp-quick-donate-container.position-bottom-right {
    bottom: 30px;
    right: 30px;
}

.givewp-quick-donate-container.position-top-left {
    top: 100px;
    left: 30px;
}

.givewp-quick-donate-container.position-top-right {
    top: 100px;
    right: 30px;
}

/* === Floating Button === */
.givewp-quick-donate-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    border: none;
    border-radius: 50px;
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    animation: pulse-glow 2s infinite;
}

.givewp-quick-donate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.4);
}

.givewp-quick-donate-btn .btn-icon {
    font-size: 1.3em;
}

.givewp-quick-donate-btn .btn-text {
    white-space: nowrap;
}

/* Pulse animation */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 5px 25px rgba(40, 167, 69, 0.6), 0 0 30px rgba(40, 167, 69, 0.4);
    }

    100% {
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    }
}

/* === Popup Overlay === */
.givewp-quick-donate-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* === Popup Container === */
.givewp-quick-donate-popup {
    background: #fff !important;
    border-radius: 20px !important;
    max-width: 500px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 200px !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    animation: popup-slide-in 0.3s ease !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

@keyframes popup-slide-in {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Close Button */
.givewp-quick-donate-popup .popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: #f1f3f5;
    border-radius: 50%;
    font-size: 1.5em;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.givewp-quick-donate-popup .popup-close:hover {
    background: #e9ecef;
    color: #333;
    transform: rotate(90deg);
}

/* Popup Content */
.givewp-quick-donate-popup .popup-content {
    padding: 30px;
}

/* === Loading Spinner === */
.loading-spinner {
    text-align: center;
    padding: 50px 20px;
}

.loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top-color: #28a745;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    color: #6c757d;
    margin: 0;
}

/* === Error Message === */
.error-message {
    text-align: center;
    padding: 30px;
    color: #dc3545;
    background: #fff5f5;
    border-radius: 10px;
    border: 1px solid #f5c6cb;
}

/* === Body Class (No Scroll) === */
body.quick-donate-popup-open {
    overflow: hidden;
}

/* === Responsive === */
@media (max-width: 768px) {

    .givewp-quick-donate-container.position-bottom-left,
    .givewp-quick-donate-container.position-bottom-right {
        bottom: 20px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .givewp-quick-donate-btn {
        padding: 12px 20px;
        font-size: 0.95em;
    }

    .givewp-quick-donate-popup {
        border-radius: 15px;
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    .givewp-quick-donate-popup .popup-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .givewp-quick-donate-btn .btn-text {
        display: none;
    }

    .givewp-quick-donate-btn {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }

    .givewp-quick-donate-btn .btn-icon {
        font-size: 1.5em;
    }
}

/* === RTL Support === */
[dir="rtl"] .givewp-quick-donate-container.position-bottom-left {
    left: auto;
    right: 30px;
}

[dir="rtl"] .givewp-quick-donate-container.position-bottom-right {
    right: auto;
    left: 30px;
}

[dir="rtl"] .givewp-quick-donate-popup .popup-close {
    right: auto;
    left: 15px;
}

/* Arabic default RTL */
html[lang="ar"] .givewp-quick-donate-container,
html[lang="ar-SA"] .givewp-quick-donate-container {
    direction: rtl;
}