/**
 * Alipay Payment Styles
 * Modern, responsive design for payment flows
 */

/* Payment Modal Styles */
.payment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.payment-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.payment-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.payment-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.payment-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.payment-modal-body {
    padding: 2rem;
    text-align: center;
}

/* QR Code Styles */
.qr-code-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid #f3f4f6;
}

.qr-code-image {
    width: 200px;
    height: 200px;
    display: block;
    border-radius: 8px;
}

.qr-code-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alipay-logo {
    color: #1677ff;
    font-size: 1.5rem;
}

/* Payment Info Styles */
.payment-info {
    margin-bottom: 1.5rem;
}

.payment-amount-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.payment-amount {
    color: #1677ff;
    font-size: 1.5rem;
    font-weight: 700;
}

.order-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.order-number {
    font-family: 'Courier New', monospace;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.payment-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #ef4444;
    font-weight: 600;
    font-size: 1rem;
}

.payment-timer i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Payment Instructions */
.payment-instructions {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.instruction-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    text-align: left;
}

.instruction-step:last-child {
    margin-bottom: 0;
}

.step-number {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* Payment Modal Footer */
.payment-modal-footer {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.payment-modal-footer .btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Payment Button Styles */
.alipay-payment-btn {
    background: linear-gradient(135deg, #1677ff 0%, #40a9ff 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 160px;
}

.alipay-payment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(22, 119, 255, 0.4);
}

.alipay-payment-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.alipay-payment-btn:before {
    content: '';
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEyIDJDNi40ODYgMiAyIDYuNDg2IDIgMTJTNi40ODYgMjIgMTIgMjJTMjIgMTcuNTE0IDIyIDEyUzE3LjUxNCAyIDEyIDJaIiBmaWxsPSIjMTY3N2ZmIi8+CjxwYXRoIGQ9Ik0xNS4xNiAxNS4xNkwxMiAxMkg4Ljg0TDE1LjE2IDE1LjE2WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+');
    background-size: 20px;
    background-repeat: no-repeat;
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
}

/* Payment Method Selection */
.payment-method-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.payment-method-selector:hover {
    border-color: #1677ff;
    background: #f0f8ff;
}

.payment-method-selector.selected {
    border-color: #1677ff;
    background: #f0f8ff;
}

.payment-method-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.payment-method-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1677ff;
    color: white;
    border-radius: 6px;
    font-size: 1.2rem;
}

.payment-method-details h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.payment-method-details p {
    margin: 0.25rem 0 0 0;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.toast {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #6b7280;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: toastSlideIn 0.3s ease-out;
    max-width: 400px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-success {
    border-left-color: #22c55e;
}

.toast-error {
    border-left-color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.toast-content i {
    font-size: 1.25rem;
}

.toast-success .toast-content i {
    color: #22c55e;
}

.toast-error .toast-content i {
    color: #ef4444;
}

.toast-warning .toast-content i {
    color: #f59e0b;
}

.toast-info .toast-content i {
    color: #3b82f6;
}

.toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s;
}

.toast-close:hover {
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .payment-modal-content {
        margin: 1rem;
        max-width: none;
        width: calc(100% - 2rem);
    }

    .payment-modal-body {
        padding: 1.5rem;
    }

    .qr-code-image {
        width: 180px;
        height: 180px;
    }

    .payment-modal-footer {
        flex-direction: column;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    .toast {
        max-width: none;
    }

    .instruction-step {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .payment-modal-content {
        background: #1f2937;
        color: white;
    }

    .payment-modal-header {
        border-bottom-color: #374151;
    }

    .payment-modal-footer {
        background: #111827;
        border-top-color: #374151;
    }

    .payment-instructions {
        background: #374151;
    }

    .order-number {
        background: #374151;
        color: #d1d5db;
    }

    .qr-code-container {
        background: white;
    }

    .toast {
        background: #1f2937;
        color: white;
    }

    .btn-secondary {
        background: #374151;
        color: #d1d5db;
    }

    .btn-secondary:hover {
        background: #4b5563;
    }
}

/* Loading states */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Enhanced hover effects */
.alipay-payment-btn,
.payment-method-selector,
.btn {
    position: relative;
    overflow: hidden;
}

.alipay-payment-btn:before,
.btn-primary:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.alipay-payment-btn:hover:before,
.btn-primary:hover:before {
    left: 100%;
}