/**
 * NestPay 3D Secure Gateway CSS
 * Styles for payment forms, result pages, and admin interface
 * 
 * @package NestPay_3D_Secure_Gateway
 * @author Faruk Shaban
 * @version 1.0.0
 * @license GPL v2 or later
 */

/* NestPay 3D Secure Gateway Styles */

.nestpay-form-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.nestpay-form-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.nestpay-input,
.nestpay-select {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #ffffff;
}

.nestpay-input:focus,
.nestpay-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.nestpay-input::placeholder {
    color: #999;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.nestpay-submit-btn {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nestpay-submit-btn:hover {
    background: linear-gradient(135deg, #005a87 0%, #004466 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.nestpay-submit-btn:active {
    transform: translateY(0);
}

.nestpay-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Result pages */
.nestpay-result-success,
.nestpay-result-fail {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.nestpay-result-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 1px solid #c3e6cb;
    color: #155724;
}

.nestpay-result-fail {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.nestpay-result-success h2,
.nestpay-result-fail h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
}

.nestpay-result-success p,
.nestpay-result-fail p {
    margin: 0 0 20px 0;
    font-size: 16px;
    line-height: 1.5;
}

.nestpay-details,
.nestpay-error-details {
    margin-top: 25px;
    text-align: left;
}

.nestpay-details h3,
.nestpay-error-details h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid currentColor;
    padding-bottom: 8px;
}

.nestpay-details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.nestpay-details-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nestpay-details-table td:first-child {
    font-weight: 600;
    width: 40%;
}

.nestpay-error-message {
    background: rgba(255, 255, 255, 0.5);
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid currentColor;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

/* Error states */
.nestpay-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
    text-align: center;
}

.nestpay-input.error,
.nestpay-select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

/* Loading state */
.nestpay-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.nestpay-loading.show {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .nestpay-form-container {
        margin: 10px;
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .nestpay-result-success,
    .nestpay-result-fail {
        margin: 20px 10px;
        padding: 20px;
    }
    
    .nestpay-details-table td {
        display: block;
        width: 100%;
        padding: 8px 0;
        border-bottom: none;
    }
    
    .nestpay-details-table td:first-child {
        font-weight: 600;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .nestpay-form-container {
        padding: 10px;
    }
    
    .nestpay-input,
    .nestpay-select {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .nestpay-submit-btn {
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* Accessibility improvements */
.nestpay-input:focus-visible,
.nestpay-select:focus-visible,
.nestpay-submit-btn:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nestpay-form-container {
        border: 2px solid #000;
    }
    
    .nestpay-input,
    .nestpay-select {
        border: 2px solid #000;
    }
    
    .nestpay-submit-btn {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .nestpay-input,
    .nestpay-select,
    .nestpay-submit-btn {
        transition: none;
    }
    
    .nestpay-submit-btn:hover {
        transform: none;
    }
    
    .spinner {
        animation: none;
    }
} 