/* Main Container Styles */
.mpesa-waiting-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: 'Segoe UI', Roboto, -apple-system, sans-serif;
}

.mpesa-waiting-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 2rem;
}

/* Header Styles */
.mpesa-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.mpesa-logo {
    height: 50px;
    margin-bottom: 1rem;
}

.mpesa-header h2 {
    color: #253858;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* Error Notice Styles */
.mpesa-error-notice {
    background: #FFEBEE;
    border-left: 4px solid #F44336;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
}

.error-icon {
    background: #F44336;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
}

.error-message {
    color: #D32F2F;
    font-weight: 500;
}

/* Payment Flow Styles */
.mpesa-payment-flow {
    margin-bottom: 2rem;
}

.payment-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.phone-icon {
    margin-right: 1.5rem;
}

.phone-icon img {
    height: 60px;
}

.payment-loader {
    flex-grow: 1;
}

.loader-bar {
    height: 4px;
    background: #E0E0E0;
    border-radius: 2px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    position: relative;
}

.loader-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: #00C853;
    animation: loadingBar 2s infinite ease-in-out;
}

.loader-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.loader-dots .dot {
    width: 8px;
    height: 8px;
    background: #BDBDBD;
    border-radius: 50%;
    animation: pulseDot 1.5s infinite ease-in-out;
}

.loader-dots .dot:nth-child(1) { animation-delay: 0.1s; }
.loader-dots .dot:nth-child(2) { animation-delay: 0.3s; }
.loader-dots .dot:nth-child(3) { animation-delay: 0.5s; }
.loader-dots .dot:nth-child(4) { animation-delay: 0.7s; }
.loader-dots .dot:nth-child(5) { animation-delay: 0.9s; }

.payment-instructions {
    text-align: center;
}

.instruction-main {
    color: #263238;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.instruction-detail {
    color: #546E7A;
    font-size: 0.95rem;
    margin: 0;
}

/* Order Card Styles */
.mpesa-order-card {
    background: #F5F7FA;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.order-summary-title {
    color: #263238;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
}

.order-details {
    display: grid;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
}

.detail-label {
    color: #546E7A;
    font-weight: 500;
}

.detail-value {
    color: #263238;
    font-weight: 600;
}

/* Status Card Styles */
.mpesa-status-card {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #E0E0E0;
}

.status-message {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.status-loader {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.status-loader .active-dot {
    width: 10px;
    height: 10px;
    background: #1976D2;
    border-radius: 50%;
    animation: bounceDot 1.5s infinite ease-in-out;
}

.status-loader .active-dot:nth-child(1) { animation-delay: 0.1s; }
.status-loader .active-dot:nth-child(2) { animation-delay: 0.3s; }
.status-loader .active-dot:nth-child(3) { animation-delay: 0.5s; }

.status-text {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 0;
    font-size: 0.95rem;
    text-align: center;
}

.status-text.loading {
    color: #1976D2;
    background: #E3F2FD;
}

.status-text.success {
    color: #2E7D32;
    background: #E8F5E9;
}

.status-text.error {
    color: #C62828;
    background: #FFEBEE;
}

.status-text.info {
    color: #F57C00;
    background: #FFF3E0;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.mpesa-button {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.mpesa-button .button-icon {
    margin-right: 0.5rem;
    font-size: 1.1em;
}

.mpesa-button.primary {
    background: #00C853;
    color: white;
}

.mpesa-button.primary:hover {
    background: #00B04A;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 200, 83, 0.2);
}

.mpesa-button.secondary {
    background: #1976D2;
    color: white;
}

.mpesa-button.secondary:hover {
    background: #1565C0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(25, 118, 210, 0.2);
}

.cancel-link {
    color: #F44336;
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1rem;
    display: inline-block;
    transition: all 0.2s;
}

.cancel-link:hover {
    color: #D32F2F;
    text-decoration: underline;
}

/* Retry Form Styles */
.retry-form {
    background: #F5F7FA;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.retry-form h4 {
    color: #263238;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    color: #546E7A;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    font-size: 1rem;
}

/* Animations */
@keyframes loadingBar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes pulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.5; }
}

@keyframes bounceDot {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Responsive Styles */
@media (max-width: 480px) {
    .mpesa-waiting-card {
        padding: 1.5rem;
    }
    
    .payment-animation {
        flex-direction: column;
        text-align: center;
    }
    
    .phone-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .mpesa-button, .cancel-link {
        width: 100%;
        justify-content: center;
    }
}