/* Enhanced 3D Secure WordPress Plugin - 现代化样式 */

/* CSS变量定义 - 统一设计系统 */
:root {
    --enhanced-3ds-primary: #ffffff;
    --enhanced-3ds-primary-dark: #ffffff;
    /* --enhanced-3ds-secondary: #667eea; */ /* 未使用的变量 */
    --enhanced-3ds-gradient: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
    --enhanced-3ds-white: #ffffff;
    --enhanced-3ds-gray-50: #f8f9fa;
    --enhanced-3ds-gray-100: #e1e8ed;
    --enhanced-3ds-gray-200: #e5e7eb;
    --enhanced-3ds-gray-600: #718096;
    --enhanced-3ds-gray-800: #2c3e50;
    --enhanced-3ds-border-radius: 12px;
    --enhanced-3ds-border-radius-lg: 16px;
    --enhanced-3ds-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --enhanced-3ds-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.15);
    --enhanced-3ds-transition: all 0.3s ease;
}

/* 支付表单容器 */
.enhanced-3ds-wp-form {
    background: var(--enhanced-3ds-white);
    border: 2px solid var(--enhanced-3ds-gray-100);
    border-radius: var(--enhanced-3ds-border-radius);
    padding: 24px;
    margin: 16px 0;
    box-shadow: var(--enhanced-3ds-shadow);
    transition: var(--enhanced-3ds-transition);
}

.enhanced-3ds-wp-form:hover {
    border-color: var(--enhanced-3ds-primary);
    transform: translateY(-2px);
}

.enhanced-3ds-wp-card-container {
    position: relative;
    min-height: 300px;
    border-radius: var(--enhanced-3ds-border-radius);
    overflow: hidden;
}



/* 统一的模态框样式 - 简化设计 */
.enhanced-3ds-wp-modal,
.enhanced-3ds-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 999999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    animation: modalFadeIn 0.3s ease-out;
}

/* 模态框显示状态 */
.enhanced-3ds-wp-modal.show,
.enhanced-3ds-modal.show {
    display: flex;
}

/* 防止页面滚动 */
body.enhanced-3ds-modal-open {
    overflow: hidden;
}

/* 模态框覆盖层 */
.enhanced-3ds-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

/* 模态框内容容器 */
.enhanced-3ds-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
}

/* 模态框主体 */
.enhanced-3ds-modal-body {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 统一的模态框内容样式 */
.enhanced-3ds-wp-modal-content {
    background: var(--enhanced-3ds-white);
    border-radius: var(--enhanced-3ds-border-radius);
    padding: 24px;
    max-width: 95%;
    max-height: 95%;
    position: relative;
    box-shadow: var(--enhanced-3ds-shadow);
    animation: modalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--enhanced-3ds-gray-100);
}

@keyframes modalSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-10px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 等待模态框特定样式 */
.enhanced-3ds-wp-modal-content {
    text-align: center;
    min-width: 320px;
}

.enhanced-3ds-wp-modal-content p {
    margin: 16px 0;
    font-size: 16px;
    color: #374151;
    font-weight: 500;
}

/* 现代化加载动画 */
.enhanced-3ds-wp-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid var(--enhanced-3ds-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

/* 现代化多环加载器 */
.enhanced-3ds-modern-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
}

.spinner-ring {
    position: absolute;
    border: 3px solid transparent;
    border-top: 3px solid rgba(255,255,255,0.8);
    border-radius: 50%;
    animation: modernSpin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
    width: 80px;
    height: 80px;
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    width: 60px;
    height: 60px;
    top: 10px;
    left: 10px;
    animation-delay: -0.5s;
    border-top-color: rgba(255,255,255,0.6);
}

.spinner-ring:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 20px;
    left: 20px;
    animation-delay: -1s;
    border-top-color: rgba(255,255,255,0.4);
}

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

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

/* 现代化加载文本 */
.loading-text {
    text-align: center;
    margin-bottom: 30px;
    z-index: 1;
}

.loading-text h4 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.loading-text p {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* 现代化进度条 */
.loading-progress {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
    z-index: 1;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.8), rgba(255,255,255,1));
    border-radius: 2px;
    animation: progressFlow 2s ease-in-out infinite;
}

@keyframes progressFlow {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* 未使用的超时指示器样式 - 已注释 */
/*
.enhanced-3ds-wp-timeout-indicator {
    margin-top: 20px;
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    color: #92400e;
    font-size: 14px;
    font-weight: 500;
}

#enhanced-3ds-wp-countdown {
    font-weight: 700;
    color: #d97706;
}
*/

/* 未使用的3D验证模态框样式 - 已注释 */
/*
.enhanced-3ds-wp-verification {
    align-items: flex-start;
    padding-top: 5vh;
}

.enhanced-3ds-wp-verification-content {
    width: 90%;
    max-width: 420px;
    height: auto;
    min-height: 600px;
    max-height: 85vh;
    padding: 0 !important;
    overflow: hidden;
    margin: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: none !important;
    border-radius: var(--enhanced-3ds-border-radius-lg);
    background: transparent !important;
    border: none !important;
    animation: slideUp 0.5s ease-out;
}

.enhanced-3ds-unified .enhanced-3ds-wp-verification-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}
*/

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

/* 统一iframe样式 */
.enhanced-3ds-iframe-container {
    width: 100%;
    height: 500px;
    min-height: 400px;
    border-radius: var(--enhanced-3ds-border-radius);
    overflow: hidden;
    background: var(--enhanced-3ds-white);
    border: 1px solid var(--enhanced-3ds-gray-100);
}

.enhanced-3ds-iframe-container iframe,
#enhanced-3ds-wp-card-iframe,
.enhanced-3ds-wp-verification-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--enhanced-3ds-border-radius);
    background: var(--enhanced-3ds-white);
    display: block;
}

.enhanced-3ds-iframe-container iframe:focus,
#enhanced-3ds-wp-card-iframe:focus,
.enhanced-3ds-wp-verification-iframe:focus {
    outline: none;
}

/* 现代化模态框头部样式 - 与Shop-Server统一 */
.enhanced-3ds-wp-modal-header {
    background: #ffffff !important;
    color: #333333 !important;
    padding: 32px 24px !important;
    border-radius: var(--enhanced-3ds-border-radius-lg) var(--enhanced-3ds-border-radius-lg) 0 0 !important;
    position: relative !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.enhanced-3ds-wp-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="40" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="80" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.enhanced-3ds-wp-modal-header h3 {
    margin: 0 !important;
    font-size: 24px !important;
    font-weight: 600 !important;
    color: #333333 !important;
    text-shadow: none !important;
    position: relative;
    z-index: 1;
}

/* 未使用的关闭按钮样式 - 已注释 */
/*
.enhanced-3ds-wp-close {
    display: none !important;
}
*/

/* Error and success messages */
.woocommerce-error,
.woocommerce-message {
    border-radius: 6px;
    margin-bottom: 20px;
    animation: messageSlideIn 0.3s ease-out;
}

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

/* Processing state */
.woocommerce-checkout.processing {
    opacity: 0.6;
    pointer-events: none;
}

.woocommerce-checkout.processing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1000;
}

/* 处理指示器样式 - 与Shop-Server统一 */
.enhanced-3ds-wp-processing-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--enhanced-3ds-white);
    border: 2px solid var(--enhanced-3ds-primary);
    border-radius: var(--enhanced-3ds-border-radius);
    padding: 32px 24px;
    box-shadow: var(--enhanced-3ds-shadow-lg);
    z-index: 999999;
    text-align: center;
    min-width: 320px;
    animation: slideUp 0.3s ease-out;
}

.enhanced-3ds-wp-processing-content {
    margin-bottom: 16px;
}

.enhanced-3ds-wp-processing-title {
    margin: 0;
    color: var(--enhanced-3ds-primary);
    font-size: 20px;
    font-weight: 600;
    margin-top: 16px;
}

.enhanced-3ds-wp-processing-text {
    margin: 0;
    color: var(--enhanced-3ds-gray-600);
    font-size: 14px;
    line-height: 1.5;
}

/* Payment method selection */
.payment_method_enhanced_3ds_wp_gateway {
    border: 2px solid transparent;
    border-radius: 8px;
    transition: border-color 0.2s ease;
}

.payment_method_enhanced_3ds_wp_gateway.selected {
    border-color: var(--enhanced-3ds-white);
    background: #f0f9ff;
}

/* Responsive design - 优化移动端居中 */
@media (max-width: 768px) {
    .enhanced-3ds-wp-modal {
        padding: 15px;
    }

    .enhanced-3ds-wp-modal-content {
        margin: 0;
        padding: 20px;
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .enhanced-3ds-iframe-container {
        height: 400px;
        min-height: 350px;
    }

    /* 未使用的验证内容样式 - 已注释 */
    /*
    .enhanced-3ds-wp-verification-content {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 500px;
        max-height: 80vh;
        margin: 0;
        border-radius: 12px;
    }

    .enhanced-3ds-wp-verification-iframe {
        height: 500px;
        min-height: 400px;
        border-radius: 12px;
    }
    */
    
    .enhanced-3ds-wp-form {
        padding: 16px;
        margin: 12px 0;
    }
    
    .enhanced-3ds-wp-spinner {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .enhanced-3ds-wp-modal {
        padding: 10px;
    }

    .enhanced-3ds-wp-modal-content {
        margin: 0;
        padding: 16px;
        min-width: auto;
        max-width: 100%;
        max-height: 98vh;
        border-radius: 8px;
    }

    .enhanced-3ds-iframe-container {
        height: 350px;
        min-height: 300px;
    }

    .enhanced-3ds-wp-modal-content p {
        font-size: 14px;
    }

    /* 未使用的移动端样式 - 已注释 */
    /*
    .enhanced-3ds-wp-timeout-indicator {
        padding: 8px 10px;
        font-size: 12px;
    }

    .enhanced-3ds-wp-verification-content {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 450px;
        max-height: 85vh;
        margin: 0;
        border-radius: 8px;
    }

    .enhanced-3ds-wp-verification-iframe {
        height: 450px;
        min-height: 350px;
        border-radius: 8px;
    }
    */
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .enhanced-3ds-wp-form {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .enhanced-3ds-wp-modal-content {
        background: #1f2937;
        color: #f9fafb;
    }

    .enhanced-3ds-iframe-container {
        background: #1f2937;
        border-color: #374151;
    }

    .enhanced-3ds-iframe-container iframe,
    #enhanced-3ds-wp-card-iframe,
    .enhanced-3ds-wp-verification-iframe {
        background: #ffffff;
    }
    
    .enhanced-3ds-wp-modal-content p {
        color: #d1d5db;
    }
    
    /* 未使用的暗色模式样式 - 已注释 */
    /*
    .enhanced-3ds-wp-spinner {
        border-color: #ffffff;
        border-top-color: #ffffff;
    }

    .enhanced-3ds-wp-timeout-indicator {
        background: #451a03;
        border-color: #92400e;
        color: #fbbf24;
    }

    .enhanced-3ds-wp-close {
        background: #374151;
        color: #d1d5db;
    }

    .enhanced-3ds-wp-close:hover {
        background: #4b5563;
        color: #f9fafb;
    }
    */
}

/* Accessibility improvements */
.enhanced-3ds-wp-modal:focus-within {
    outline: none;
}

/* 未使用的关闭按钮焦点样式 - 已注释 */
/*
.enhanced-3ds-wp-close:focus {
    outline: 2px solid var(--enhanced-3ds-white);
    outline-offset: 2px;
}
*/

/* High contrast mode */
@media (prefers-contrast: high) {
    .enhanced-3ds-wp-form {
        border-width: 2px;
        border-color: #000000;
    }
    
    .enhanced-3ds-wp-modal {
        background: transparent;
    }
    
    /* 未使用的高对比度spinner样式 - 已注释 */
    /*
    .enhanced-3ds-wp-spinner {
        border-width: 3px;
    }
    */
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    /* 未使用的减少动画样式 - 已注释 */
    /*
    .enhanced-3ds-wp-spinner {
        animation: none;
    }

    .enhanced-3ds-wp-close {
        transition: none;
    }
    */

    .enhanced-3ds-wp-modal-content,
    .woocommerce-error,
    .woocommerce-message {
        animation: none;
    }
    
    #enhanced-3ds-wp-card-iframe {
        transition: none;
    }
}

/* Print styles */
@media print {
    .enhanced-3ds-wp-modal {
        display: none !important;
    }
    
    .enhanced-3ds-wp-form {
        border: 1px solid #000000;
        background: white;
    }
}
