/**
 * Hubtel Payment Modals CSS
 * Styles for OTP verification, USSD payment, and status modals
 */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    margin-bottom: 16px;
    color: var(--text-color);
    line-height: 1.6;
}

/* OTP Input Styles */
.otp-input-group {
    margin: 20px 0;
    text-align: center;
}

.otp-input {
    width: 200px;
    height: 50px;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text-color);
    letter-spacing: 0.5em;
    transition: border-color 0.3s ease;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.otp-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px 0;
    padding: 12px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 8px;
    color: var(--primary-color);
    font-weight: 500;
}

/* USSD Code Display */
.ussd-code-display {
    text-align: center;
    margin: 20px 0;
}

.ussd-code-display h4 {
    margin-bottom: 16px;
    color: var(--text-color);
    font-weight: 600;
}

.ussd-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: var(--code-bg, #f8f9fa);
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    margin: 16px 0;
}

.ussd-code span {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.copy-btn:hover {
    background: var(--primary-dark);
}

/* USSD Instructions */
.ussd-instructions {
    margin: 20px 0;
}

.ussd-instructions h5 {
    margin-bottom: 12px;
    color: var(--text-color);
    font-weight: 600;
}

.ussd-instructions ol {
    padding-left: 20px;
    color: var(--text-muted);
}

.ussd-instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Payment Status */
.payment-status {
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.payment-status.pending {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #856404;
}

.payment-status.processing {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid #007bff;
    color: #004085;
}

.payment-status.completed {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid #28a745;
    color: #155724;
}

.payment-status.failed {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid #dc3545;
    color: #721c24;
}

.payment-status.cancelled {
    background: rgba(108, 117, 125, 0.1);
    border: 1px solid #6c757d;
    color: #495057;
}

/* Payment Info */
.payment-info {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.payment-info p {
    margin-bottom: 8px;
}

.payment-info strong {
    color: var(--primary-color);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color, #6c757d);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-dark, #5a6268);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body {
        padding: 16px;
    }
    
    .ussd-code {
        flex-direction: column;
        gap: 8px;
    }
    
    .ussd-code span {
        font-size: 1.2rem;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Dark Mode Support */
[data-theme="dark"] {
    --code-bg: #2d3748;
}

[data-theme="dark"] .modal {
    background-color: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .ussd-code {
    background: var(--code-bg);
    border-color: var(--primary-color);
}

/* Animation for success state */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.modal-header.success {
    animation: successPulse 0.6s ease-in-out;
}

/* Loading spinner in payment status */
.payment-status .fa-spinner {
    animation: spin 1s linear infinite;
}

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