/**
 * NASS Payment Gateway Frontend Styles
 */

/* Payment form container */
.nass-payment-form {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    position: relative;
    transition: all 0.3s ease;
}

.nass-payment-form:hover {
    border-color: #d1d1d1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Payment description section */
.nass-payment-description {
    margin-bottom: 5px;
    text-align: center;
}

.nass-accepted-cards {
    margin-bottom: 15px;
}

.card-icons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.payment-icon {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.payment-icon:hover {
    transform: scale(1.05);
}

.nass-security-note {
    color: #666;
    font-size: 14px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.nass-security-note .dashicons {
    color: #27ae60;
    font-size: 16px;
}

/* Payment notice */
.nass-payment-notice {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
}

.notice-content {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.notice-content .dashicons {
    color: #2196f3;
    margin-top: 2px;
    flex-shrink: 0;
}

.notice-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Payment details */
.nass-payment-details {
    margin: 20px 0;
}

.nass-payment-details h4,
.nass-payment-steps h4 {
    margin: 20px 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.payment-summary {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.summary-row .label {
    color: #666;
    font-weight: 500;
}

.summary-row .value {
    font-weight: 600;
    color: #333;
}

/* Test mode notice */
.nass-test-mode-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

.test-notice {
    text-align: center;
}

.test-notice .dashicons {
    color: #856404;
    margin-right: 5px;
}

.test-notice strong {
    color: #856404;
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.test-notice p {
    margin: 5px 0;
    font-size: 14px;
    color: #856404;
}

.test-notice details {
    margin-top: 10px;
    text-align: left;
}

.test-notice summary {
    cursor: pointer;
    font-weight: 600;
    color: #856404;
    padding: 5px;
    border-radius: 4px;
    background: rgba(255, 193, 7, 0.1);
}

.test-notice summary:hover {
    background: rgba(255, 193, 7, 0.2);
}

.test-cards {
    margin-top: 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ffc107;
}

.test-cards p {
    margin: 5px 0;
    padding: 3px 5px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.test-cards p:hover {
    background-color: #f0f0f0;
}

.test-cards p strong {
    color: #333;
    min-width: 80px;
    display: inline-block;
}

/* Payment steps */
.nass-payment-steps {
    margin: 20px 0;
}

.payment-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.payment-steps li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    font-size: 14px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e1e1e1;
    transition: all 0.2s ease;
}

.payment-steps li:hover {
    border-color: #3498db;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.1);
}

.step-number {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    margin-right: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.step-text {
    color: #333;
    line-height: 1.5;
    padding-top: 2px;
}

/* Loading overlay */
.nass-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 1000;
}

.loading-content {
    text-align: center;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.loading-content p {
    margin: 0;
    color: #333;
    font-weight: 500;
}

/* Processing state */
.nass-payment-form.processing {
    opacity: 0.7;
    pointer-events: none;
}

/* Error styling */
.nass-payment-form .woocommerce-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    white-space: pre-line;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success styling */
.nass-payment-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Payment method selection styling */
.payment_method_nass_gateway {
    border: 2px solid transparent;
    border-radius: 6px;
    padding: 10px;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.payment_method_nass_gateway:hover {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

.payment_method_nass_gateway.selected {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.payment_method_nass_gateway label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}

.payment_method_nass_gateway label img {
    margin-left: 10px;
    height: 40px;
    vertical-align: middle;
}

/* Copy success message */
.copied-msg {
    color: #27ae60;
    font-weight: bold;
    margin-left: 10px;
    font-size: 12px;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}

/* Field feedback */
.field-feedback {
    display: block;
    font-size: 12px;
    margin-top: 5px;
    padding: 2px 5px;
    border-radius: 3px;
}

.field-feedback.error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.field-feedback.success {
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

/* Responsive design */
@media (max-width: 768px) {
    .nass-payment-form {
        padding: 15px;
        margin: 10px 0;
    }
    
    .card-icons {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .summary-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .payment-steps li {
        align-items: flex-start;
        padding: 8px;
    }
    
    .step-number {
        margin-top: 2px;
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .step-text {
        font-size: 13px;
    }
    
    .nass-payment-details h4,
    .nass-payment-steps h4 {
        font-size: 14px;
    }
    
    .test-cards {
        font-size: 12px;
    }
    
    .notice-content {
        flex-direction: column;
        gap: 5px;
    }
    
    .notice-content .dashicons {
        align-self: flex-start;
    }
}

@media (max-width: 480px) {
    .nass-payment-form {
        padding: 12px;
        border-radius: 6px;
    }
    
    .payment-summary {
        padding: 12px;
    }
    
    .summary-row {
        font-size: 13px;
    }
    
    .spinner {
        width: 30px;
        height: 30px;
        border-width: 2px;
    }
    
    .loading-content p {
        font-size: 14px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .nass-payment-form {
        border-color: #000;
        background: #fff;
    }
    
    .step-number {
        background: #000;
        color: #fff;
    }
    
    .payment-icon {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .spinner {
        animation: none;
        border-top-color: transparent;
    }
}

/* Print styles */
@media print {
    .nass-payment-form {
        border: 1px solid #000;
        background: #fff;
        box-shadow: none;
    }
    
    .nass-loading-overlay,
    .spinner {
        display: none !important;
    }
    
    .test-notice {
        border: 2px solid #000;
    }
}