/**
 * M-Pesa Gateway Styles
 * Custom styling for M-Pesa checkout and payment flow
 */

/* M-Pesa Payment Information Section */
.pmpro_mpesa_instructions {
    background: #f8f9fa;
    border: 1px solid #e3f2fd;
    border-radius: 5px;
    padding: 20px;
    margin-top: 10px;
}

.pmpro_mpesa_instructions h4 {
    color: #00a651;
    margin-bottom: 15px;
    font-size: 16px;
}

.pmpro_mpesa_instructions ol {
    margin: 0;
    padding-left: 20px;
}

.pmpro_mpesa_instructions li {
    margin-bottom: 8px;
    color: #555;
}

/* Phone Number Field */
.pmpro_checkout-field-bphone input {
    font-size: 16px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.pmpro_checkout-field-bphone input:focus {
    border-color: #00a651;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 166, 81, 0.3);
}

.pmpro_checkout-field-bphone input.pmpro_error {
    border-color: #d32f2f;
}

.pmpro_phone_error {
    color: #d32f2f;
    font-size: 12px;
    margin-top: 5px;
}

/* M-Pesa Logo */
.pmpro_checkout-h2-rightcol img {
    max-height: 30px;
    width: auto;
}

/* Payment Pending Page Styles */
.mpesa_pending_header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mpesa_pending_header img {
    height: 60px;
    margin-bottom: 15px;
}

.mpesa_pending_header h2 {
    color: #333;
    margin: 0;
    font-size: 24px;
}

/* Order Details */
.order_details {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 30px;
}

.order_details h3 {
    color: #00a651;
    margin-bottom: 15px;
    border-bottom: 2px solid #00a651;
    padding-bottom: 5px;
}

.order_details p {
    margin-bottom: 10px;
    font-size: 14px;
}

/* Instruction Steps */
.payment_instructions {
    margin: 30px 0;
}

.payment_instructions h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.instruction_steps {
    margin: 20px 0;
}

.step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #00a651;
    transition: transform 0.2s ease;
}

.step:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.step_number {
    background: linear-gradient(45deg, #00a651, #4caf50);
    color: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 20px;
    flex-shrink: 0;
    font-size: 16px;
}

.step_content h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
}

.step_content p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

/* Payment Status */
.payment_status {
    text-align: center;
    margin: 30px 0;
    padding: 25px;
    background: #e3f2fd;
    border-radius: 8px;
    border: 1px solid #bbdefb;
}

.status_checking {
    color: #1976d2;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #e3f2fd;
    border-top: 3px solid #00a651;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.status_success {
    color: #00a651;
    font-weight: bold;
    font-size: 18px;
    background: #e8f5e8;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #00a651;
}

.status_error {
    color: #d32f2f;
    font-weight: bold;
    font-size: 16px;
    background: #ffebee;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #d32f2f;
}

.status_timeout {
    color: #ff9800;
    font-weight: bold;
    font-size: 16px;
    background: #fff3e0;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #ff9800;
}

/* Payment Actions */
.payment_actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.payment_actions .pmpro_btn {
    margin: 0 10px;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.payment_actions .pmpro_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.pmpro_btn-cancel {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.pmpro_btn-cancel:hover {
    background-color: #eeeeee;
    color: #333;
}

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

    .pmpro_payment_information_fields_leftcol,
    .pmpro_payment_information_fields_rightcol {
        width: 100%;
        float: none;
    }

    .pmpro_mpesa_instructions {
        margin-top: 20px;
    }

    .step {
        flex-direction: column;
        text-align: center;
    }

    .step_number {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .payment_actions .pmpro_btn {
        display: block;
        margin: 10px 0;
        width: 100%;
        max-width: 300px;
    }
}

/* M-Pesa Brand Colors */
.mpesa-green {
    color: #00a651;
}

.mpesa-bg-green {
    background-color: #00a651;
}

.mpesa-border-green {
    border-color: #00a651;
}

/* Loading Animation for Better UX */
.mpesa-loading {
    position: relative;
    overflow: hidden;
}

.mpesa-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 166, 81, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Error and Success Messages */
.pmpro_message.pmpro_error {
    background-color: #ffebee;
    border-left-color: #d32f2f;
    color: #d32f2f;
}

.pmpro_message.pmpro_success {
    background-color: #e8f5e8;
    border-left-color: #00a651;
    color: #00a651;
}