/**
 * 批量翻译站点选择弹窗样式
 */

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

/* 弹窗容器 */
.wpmmcc-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
}

/* 遮罩层 */
.wpmmcc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
}

/* 弹窗内容 */
.wpmmcc-modal-content {
    position: relative;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 520px;
    margin: 50px auto;
    z-index: 100001;
}

/* 弹窗头部 */
.wpmmcc-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wpmmcc-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.wpmmcc-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 20px;
    color: #646970;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.wpmmcc-modal-close:hover {
    background: #f0f0f1;
    color: #2c3338;
}

/* 弹窗主体 */
.wpmmcc-modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.wpmmcc-modal-description {
    margin: 0 0 20px 0;
    color: #646970;
    line-height: 1.6;
}

.wpmmcc-source-site-info {
    background: #f0f6fc;
    border-left: 4px solid #2271b1;
    padding: 12px 16px;
    margin: 0 0 12px 0;
    border-radius: 0 4px 4px 0;
}

.wpmmcc-source-site-info p {
    margin: 0;
    color: #1d2327;
    font-size: 14px;
}

.wpmmcc-source-site-info strong {
    font-weight: 600;
}

.wpmmcc-modal-info {
    background: #f9f9f9;
    border-left: 4px solid #8c8f94;
    padding: 12px 16px;
    margin: 0 0 20px 0;
    border-radius: 0 4px 4px 0;
}

.wpmmcc-modal-info p {
    margin: 0;
    color: #1d2327;
    font-size: 14px;
}

.wpmmcc-modal-info strong {
    font-weight: 600;
}

/* 站点选择器 - 仅限弹窗内 */
.wpmmcc-modal .wpmmcc-site-selector {
    margin: 20px 0;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

.wpmmcc-modal .wpmmcc-site-selector-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.wpmmcc-modal .wpmmcc-site-selector-label {
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
    margin: 0;
    flex-shrink: 0;
}

.wpmmcc-modal .wpmmcc-site-selector-actions {
    display: flex;
    gap: 8px;
}

.wpmmcc-modal .wpmmcc-site-selector-actions button {
    font-size: 12px;
    padding: 2px 8px;
    height: auto;
    line-height: 1.5;
}

.wpmmcc-modal .wpmmcc-site-checkboxes {
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 12px;
    background: #f9f9f9;
    max-height: 240px;
    overflow-y: auto;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

.wpmmcc-modal .wpmmcc-site-checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin: 0;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
    gap: 8px;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

.wpmmcc-modal .wpmmcc-site-checkbox-item:hover {
    background-color: #f0f0f1;
}

.wpmmcc-modal .wpmmcc-site-checkbox {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.wpmmcc-modal .wpmmcc-site-checkbox-label {
    font-size: 14px;
    color: #1d2327;
    line-height: 1.5;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

/* Draft mode checkbox */
.wpmmcc-modal .wpmmcc-site-draft-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    font-size: 12px;
    color: #646970;
    padding-left: 8px;
    border-left: 1px solid #dcdcde;
}

.wpmmcc-modal .wpmmcc-site-draft-wrapper input[type="checkbox"] {
    margin: 0;
    width: 14px;
    height: 14px;
}

.wpmmcc-modal .wpmmcc-site-draft-wrapper label {
    cursor: pointer;
    white-space: nowrap;
}

.wpmmcc-modal .wpmmcc-no-sites {
    text-align: center;
    color: #646970;
    padding: 20px;
    margin: 0;
    font-size: 14px;
}

/* 进度条 */
.wpmmcc-modal-progress {
    margin: 20px 0;
}

.wpmmcc-progress-bar {
    width: 100%;
    height: 24px;
    background: #f0f0f1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.wpmmcc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1 0%, #135e96 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.wpmmcc-progress-text {
    margin: 12px 0 0 0;
    text-align: center;
    color: #646970;
    font-size: 14px;
}

/* 结果显示 */
.wpmmcc-modal-result {
    margin: 20px 0;
    padding: 16px;
    border-radius: 4px;
}

.wpmmcc-result-success {
    background: #d7f0db;
    border-left: 4px solid #00a32a;
    color: #1e4620;
}

.wpmmcc-result-error {
    background: #f8d7da;
    border-left: 4px solid #d63638;
    color: #58181c;
}

.wpmmcc-modal-result p {
    margin: 0;
    line-height: 1.6;
}

/* 弹窗底部 */
.wpmmcc-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #dcdcde;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.wpmmcc-modal-footer button {
    min-width: 100px;
}

.wpmmcc-modal-footer button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 响应式调整 */
@media screen and (max-width: 782px) {
    .wpmmcc-modal-content {
        max-width: 90%;
        margin: 20px auto;
    }

    .wpmmcc-modal-header {
        padding: 16px 20px;
    }

    .wpmmcc-modal-body {
        padding: 20px;
        max-height: 70vh;
    }

    .wpmmcc-modal-footer {
        padding: 12px 20px;
        flex-direction: column-reverse;
        gap: 12px;
    }

    .wpmmcc-modal-footer button {
        width: 100%;
    }
}

/* 加载动画 */
@keyframes wpmmcc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wpmmcc-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: wpmmcc-spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
