/**
 * Email Validator CSS Styles
 * 邮件验证器样式文件
 */

/* 主容器样式 */
.email-validator-widget {
    max-width: 500px;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 输入区域 */
.email-validator-form {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: stretch;
}

.email-validator-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

.email-validator-input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.email-validator-input.format-error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.email-validator-input.format-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* 验证按钮 */
.email-validator-button {
    padding: 12px 24px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 80px;
}

.email-validator-button:hover:not(:disabled) {
    background: #005a87;
    transform: translateY(-1px);
}

.email-validator-button:active {
    transform: translateY(0);
}

.email-validator-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.email-validator-button.loading {
    position: relative;
    color: transparent;
}

.email-validator-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 加载状态 */
.email-validator-loading {
    display: none;
    text-align: center;
    padding: 15px;
    color: #666;
    font-size: 14px;
}

.email-validator-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

/* 结果显示 */
.email-validator-result {
    display: none;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

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

.email-validator-result.valid {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.email-validator-result.invalid {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.result-message {
    font-weight: 500;
    margin-bottom: 8px;
}

.result-details {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.detail-item {
    margin-bottom: 5px;
}

.detail-label {
    font-weight: 500;
}

.detail-value {
    font-family: monospace;
    background: rgba(0,0,0,0.05);
    padding: 2px 6px;
    border-radius: 3px;
}

/* 图标样式 */
.email-validator-result.valid .result-message::before {
    content: '✓ ';
    color: #28a745;
    font-weight: bold;
}

.email-validator-result.invalid .result-message::before {
    content: '✗ ';
    color: #dc3545;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .email-validator-widget {
        margin: 10px 0;
        padding: 15px;
    }
    
    .email-validator-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .email-validator-input,
    .email-validator-button {
        width: 100%;
        box-sizing: border-box;
    }
}

/* 管理页面样式 */
.email-validator-admin {
    max-width: 1200px;
}

.email-validator-tabs {
    border-bottom: 1px solid #ccd0d4;
    margin-bottom: 20px;
}

.email-validator-tabs .nav-tab {
    position: relative;
    display: inline-block;
    padding: 8px 12px;
    margin: 0;
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    color: #555;
    cursor: pointer;
}

.email-validator-tabs .nav-tab:hover {
    color: #464646;
}

.email-validator-tabs .nav-tab.nav-tab-active {
    background: #fff;
    border-color: #ccd0d4;
    border-bottom: 1px solid #fff;
    color: #000;
    margin-bottom: -1px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 批量验证样式 */
.batch-validation-area {
    margin: 20px 0;
}

.batch-emails {
    width: 100%;
    min-height: 150px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
    resize: vertical;
}

.batch-results {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.batch-result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.batch-result-item:last-child {
    border-bottom: none;
}

.batch-result-item.valid {
    background: #f8fff8;
}

.batch-result-item.invalid {
    background: #fff8f8;
}

.batch-email {
    font-family: monospace;
    flex: 1;
}

.batch-status {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.batch-status.valid {
    background: #d4edda;
    color: #155724;
}

.batch-status.invalid {
    background: #f8d7da;
    color: #721c24;
}

/* 统计样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #007cba;
    display: block;
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* 设置表单样式 */
.settings-form {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
    vertical-align: top;
}

.form-table td {
    padding: 15px 10px;
}

.form-table input[type="text"],
.form-table textarea {
    width: 100%;
    max-width: 400px;
}

.form-table textarea {
    height: 100px;
    resize: vertical;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 文件上传样式 */
.upload-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.upload-section h4 {
    margin-top: 0;
    color: #333;
}

#batch-upload-form {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 15px 0;
}

#email-file {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 进度条样式 */
#upload-progress {
    margin: 20px 0;
}

.progress-text {
    margin-bottom: 10px;
    font-weight: bold;
    color: #333;
}

.progress-bar-container {
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    height: 20px;
    border: 1px solid #ddd;
}

.progress-bar {
    background: linear-gradient(90deg, #007cba, #005a87);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* 上传结果样式 */
#upload-results {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.upload-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    text-align: center;
    border-left: 4px solid #007cba;
}

.stat-item.valid {
    border-left-color: #28a745;
    background: #f8fff8;
}

.stat-item.invalid {
    border-left-color: #dc3545;
    background: #fff8f8;
}

.download-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-decoration: none;
}

.download-btn.valid {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.download-btn.valid:hover {
    background: #218838;
    color: white;
}

.download-btn.invalid {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.download-btn.invalid:hover {
    background: #5a6268;
    color: white;
}

.download-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* 手动输入区域样式 */
.manual-input-section {
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.manual-input-section h4 {
    margin-top: 0;
    color: #333;
}

/* 验证结果表格样式 */
.wp-list-table {
    margin-top: 20px;
    border-collapse: collapse;
    width: 100%;
}

.wp-list-table th,
.wp-list-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.wp-list-table th {
    background-color: #f1f1f1;
    font-weight: bold;
    color: #333;
}

.wp-list-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.wp-list-table tr:hover {
    background-color: #f5f5f5;
}

/* 状态标签样式 */
.status-valid,
.status-invalid {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

/* 验证结果区域 */
.batch-results {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.batch-results h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

/* 批量验证统计信息 */
.batch-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.batch-stats .stat-item {
    text-align: center;
    padding: 15px 10px;
    background: #fff;
    border-radius: 6px;
    border-left: 4px solid #007cba;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.batch-stats .stat-item.valid {
    border-left-color: #28a745;
}

.batch-stats .stat-item.invalid {
    border-left-color: #dc3545;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 结果消息样式 */
.result-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #batch-upload-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .upload-stats {
        grid-template-columns: 1fr;
    }
    
    .download-section {
        flex-direction: column;
    }
    
    .download-btn {
        justify-content: center;
    }
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .email-validator-widget {
        background: #2c3338;
        border-color: #3c434a;
        color: #f0f0f1;
    }
    
    .email-validator-input {
        background: #2c3338;
        border-color: #3c434a;
        color: #f0f0f1;
    }
    
    .email-validator-input:focus {
        border-color: #00a0d2;
    }
    
    .detail-value {
        background: rgba(255,255,255,0.1);
    }
    
    .upload-section,
    .manual-input-section {
        background: #2c3338;
        border-color: #3c434a;
        color: #f0f0f1;
    }
    
    #upload-results {
        background: #2c3338;
        border-color: #3c434a;
        color: #f0f0f1;
    }
    
    .stat-item {
         background: #3c434a;
         color: #f0f0f1;
     }
     
     .batch-results {
         background: #2c3338;
         border-color: #3c434a;
         color: #f0f0f1;
     }
     
     .batch-stats {
         background: #3c434a;
         border-color: #4f5962;
     }
     
     .batch-stats .stat-item {
         background: #2c3338;
         color: #f0f0f1;
     }
     
     .wp-list-table {
         background: #2c3338;
         color: #f0f0f1;
     }
     
     .wp-list-table th {
         background-color: #3c434a;
         color: #f0f0f1;
         border-bottom-color: #4f5962;
     }
     
     .wp-list-table td {
         border-bottom-color: #4f5962;
     }
     
     .wp-list-table tr:nth-child(even) {
         background-color: #3c434a;
     }
     
     .wp-list-table tr:hover {
         background-color: #4f5962;
     }
     
     .result-message {
         color: #c9c9ca;
     }
 }