/* JAVI M-Pesa Frontend Styles */

/* Limit M-Pesa logo size */
.payment_method_javi_mpesa img,
.wc_payment_method img[src*="mpesa"] {
    max-height: 40px !important;
    width: auto !important;
    max-width: 120px !important;
}

.javi-mpesa-checkout-fields {
    padding: 10px 0;
}

.javi-mpesa-checkout-fields input[type="tel"] {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.javi-mpesa-installment-options {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.javi-mpesa-installment-options h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.javi-mpesa-installment-options label {
    display: flex;
    align-items: flex-start;
    padding: 10px 12px;
    margin: 5px 0;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.javi-mpesa-installment-options label:hover {
    border-color: #4CAF50;
    background: #f0fdf4;
}

/* Selected state */
.javi-mpesa-installment-options input[type="radio"]:checked + span,
.javi-mpesa-installment-options label.javi-plan-selected {
    font-weight: 600;
}

.javi-mpesa-installment-options label.javi-plan-selected {
    border-color: #4CAF50;
    background: #f0fdf4;
    box-shadow: 0 0 0 1px #4CAF50;
}

.javi-mpesa-installment-options input[type="radio"] {
    margin-right: 10px;
    margin-top: 3px;
    -webkit-appearance: radio !important;
    -moz-appearance: radio !important;
    appearance: radio !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    accent-color: #4CAF50;
    flex-shrink: 0;
}

/* Thank you page */
.javi-mpesa-thankyou {
    padding: 20px;
    margin: 20px 0;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.javi-mpesa-status {
    text-align: center;
    padding: 20px;
}

.javi-mpesa-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: javi-spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.javi-mpesa-status-text {
    color: #555;
    font-size: 14px;
}

.javi-mpesa-status.success .javi-mpesa-spinner {
    border-color: #4CAF50;
    animation: none;
}

.javi-mpesa-status.success .javi-mpesa-status-text {
    color: #4CAF50;
    font-weight: bold;
}

/* Installment schedule table */
.javi-mpesa-schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.javi-mpesa-schedule-table th,
.javi-mpesa-schedule-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
}

.javi-mpesa-schedule-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.javi-mpesa-schedule-table tr.status-paid {
    background: #f0fdf4;
}

.javi-mpesa-schedule-table tr.status-overdue {
    background: #fef2f2;
}

/* Status badges */
.javi-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-paid, .status-success, .status-completed { background: #d1fae5; color: #065f46; }
.status-overdue, .status-failed { background: #fecaca; color: #991b1b; }
.status-cancelled { background: #e5e7eb; color: #4b5563; }
.status-active { background: #dbeafe; color: #1e40af; }

/* Progress bar */
.javi-progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin: 5px 0;
}

.javi-progress-fill {
    height: 100%;
    background: #4CAF50;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.javi-progress-text {
    font-size: 13px;
    color: #555;
}

/* Payment plan cards on My Account */
.javi-payment-plan {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.javi-payment-plan h4 {
    margin: 0 0 10px;
}

/* Pay button */
.javi-pay-installment-btn {
    font-size: 12px !important;
    padding: 4px 12px !important;
}

/* Access restriction notice */
.javi-mpesa-access-notice {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.javi-mpesa-access-notice p {
    margin: 5px 0;
    color: #991b1b;
}

.javi-mpesa-access-notice .button {
    margin-top: 10px;
}

/* Modal */
.javi-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.javi-modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.javi-modal-content h4 {
    margin: 0 0 10px;
}

.javi-modal-content input[type="tel"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.javi-modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.javi-modal-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}
