/* BD Payment Gateway - Frontend Styles */

#bd-payment-gateway-form {
    max-width: 500px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
}

/* Payment Steps */
.bd-payment-step {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.bd-payment-step h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* Progress Indicator */
.bd-progress-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.bd-progress-step {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e1e5e9;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.bd-progress-step.active {
    background: #007cba;
    color: white;
    transform: scale(1.1);
}

.bd-progress-step.completed {
    background: #28a745;
    color: white;
}

.bd-progress-line {
    width: 40px;
    height: 2px;
    background: #e1e5e9;
    transition: background 0.3s ease;
}

.bd-progress-line.completed {
    background: #28a745;
}

/* Payment Methods Grid */
.bd-payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.bd-payment-method {
    position: relative;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    min-height: 80px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    background: #ffffff;
    display: block;
}

.bd-payment-method:hover {
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.1);
    transform: translateY(-2px);
}

.bd-payment-method:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 124, 186, 0.2);
}

.bd-payment-method.selected {
    border-color: #007cba;
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.bd-payment-method input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
    top: 0;
    left: 0;
}

.bd-payment-method label {
    display: block;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    margin: 0;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    width: 100%;
}

.bd-method-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    height: 100%;
    justify-content: center;
}

.bd-method-logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.bd-payment-method:hover .bd-method-logo img {
    transform: scale(1.1);
}

.bd-method-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-transform: capitalize;
    transition: color 0.3s ease;
}

.bd-payment-method.selected .bd-method-name {
    color: white;
}

/* Back Button */
.bd-back-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s ease;
    touch-action: manipulation;
}

.bd-back-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.bd-back-btn:active {
    transform: translateY(0);
}

/* Button Container */
.bd-button-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Payment Instructions */
#bd-payment-instructions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.bd-instruction-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.bd-instruction-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.bd-instruction-logo img {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

.bd-instruction-title {
    flex: 1;
    min-width: 0;
}

.bd-instruction-title h5 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #333;
}

.bd-instruction-title p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.bd-payment-details {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.bd-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
    gap: 10px;
}

.bd-detail-row:last-child {
    border-bottom: none;
}

.bd-detail-label {
    font-weight: 500;
    color: #333;
    flex-shrink: 0;
}

.bd-detail-value {
    font-weight: 600;
    color: #007cba;
    font-family: monospace;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bd-copy-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
    touch-action: manipulation;
    white-space: nowrap;
}

.bd-copy-btn:hover {
    background: #005a87;
}

.bd-copy-btn:active {
    transform: scale(0.95);
}

.bd-instruction-steps {
    margin-top: 20px;
}

.bd-instruction-steps h6 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

.bd-instruction-steps ol {
    margin: 0;
    padding-left: 20px;
}

.bd-instruction-steps li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #555;
}

/* Form Groups */
.bd-form-group {
    margin-bottom: 20px;
}

.bd-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.bd-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}

.bd-form-group input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.bd-form-group input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.bd-form-group input.success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

.bd-form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

/* Buttons */
.bd-next-btn,
.bd-verify-btn {
    padding: 14px 24px;
    background: linear-gradient(135deg, #007cba, #005a87);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    min-width: 120px;
}

.bd-next-btn:hover,
.bd-verify-btn:hover {
    background: linear-gradient(135deg, #005a87, #004066);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.bd-next-btn:active,
.bd-verify-btn:active {
    transform: translateY(0);
}

.bd-next-btn:disabled,
.bd-verify-btn:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.bd-next-btn.loading,
.bd-verify-btn.loading {
    color: transparent;
    pointer-events: none;
}

.bd-next-btn.loading::after,
.bd-verify-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

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

/* Verification Status */
.bd-verification-status {
    margin: 20px 0;
    padding: 15px;
    border-radius: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bd-verification-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bd-verification-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.bd-verification-status.loading {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.bd-verification-status.success::before {
    content: "✓";
    font-weight: bold;
    font-size: 18px;
}

.bd-verification-status.error::before {
    content: "✗";
    font-weight: bold;
    font-size: 18px;
}

.bd-verification-status.loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid #856404;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #bd-payment-gateway-form {
        margin: 10px 0;
        max-width: 100%;
    }
    
    .bd-payment-step {
        padding: 20px 15px;
        margin-bottom: 15px;
    }
    
    .bd-payment-step h4 {
        font-size: 16px;
    }
    
    .bd-payment-methods {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .bd-payment-method {
        min-height: 70px;
    }
    
    .bd-payment-method label {
        padding: 15px 10px;
    }
    
    .bd-method-logo img {
        width: 35px;
        height: 35px;
    }
    
    .bd-method-name {
        font-size: 13px;
    }
    
    .bd-instruction-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .bd-instruction-logo {
        width: 45px;
        height: 45px;
    }
    
    .bd-instruction-logo img {
        width: 30px;
        height: 30px;
    }
    
    .bd-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .bd-detail-value {
        font-size: 14px;
        width: 100%;
    }
    
    .bd-form-group input {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .bd-next-btn,
    .bd-verify-btn {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
    }
    
    .bd-back-btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .bd-button-container {
        flex-direction: column;
        width: 100%;
    }
    
    .bd-progress-indicator {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .bd-progress-step {
        width: 25px;
        height: 25px;
        font-size: 10px;
    }
    
    .bd-progress-line {
        width: 30px;
    }
}

@media (max-width: 480px) {
    .bd-payment-step {
        padding: 15px 10px;
    }
    
    .bd-payment-details,
    #bd-payment-instructions {
        padding: 15px;
    }
    
    .bd-instruction-steps ol {
        padding-left: 15px;
    }
    
    .bd-copy-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* Animation Effects */
.bd-payment-step {
    animation: slideIn 0.3s ease-out;
}

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

.bd-payment-method {
    animation: fadeInUp 0.3s ease-out;
}

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

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

.bd-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e1e5e9;
    border-radius: 50%;
    border-top-color: #007cba;
    animation: spin 1s ease-in-out infinite;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bd-payment-method {
        border-width: 3px;
    }
    
    .bd-payment-method input[type="radio"]:checked + label {
        background: #000;
        color: #fff;
    }
    
    .bd-next-btn,
    .bd-verify-btn {
        background: #000;
        border: 2px solid #fff;
    }
}

/* Focus visible for better keyboard navigation */
.bd-payment-method input[type="radio"]:focus-visible + label {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

.bd-next-btn:focus-visible,
.bd-verify-btn:focus-visible,
.bd-back-btn:focus-visible {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    #bd-payment-gateway-form {
        max-width: 100%;
        margin: 0;
    }
    
    .bd-payment-step {
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .bd-next-btn,
    .bd-verify-btn,
    .bd-back-btn {
        display: none;
    }
}

