/* MailNest 前端样式 */

/* 弹窗样式 */
.wc-subscribe-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-subscribe-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.wc-subscribe-popup-content {
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: wc-subscribe-popup-slide-in 0.3s ease-out;
}

@keyframes wc-subscribe-popup-slide-in {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0) scale(1);
    }
}

.wc-subscribe-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.wc-subscribe-popup-close:hover {
    color: #333;
}

.wc-subscribe-popup-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.wc-subscribe-popup-description {
    margin: 0 0 20px 0;
    color: #666;
    text-align: center;
    line-height: 1.5;
}

/* 表单样式 */
.wc-subscribe-form-container {
    max-width: 400px;
    margin: 0 auto;
}

.wc-subscribe-form-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.wc-subscribe-form-description {
    margin: 0 0 20px 0;
    color: #666;
    text-align: center;
    line-height: 1.5;
}

/* 文本主题样式 */
.wc-subscribe-text-dark .wc-subscribe-form-title {
    color: #f0f0f0 !important;
}

.wc-subscribe-text-dark .wc-subscribe-form-description {
    color: #b0b0b0 !important;
}

.wc-subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wc-subscribe-form-group {
    display: flex;
    flex-direction: column;
}

.wc-subscribe-form-email {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.wc-subscribe-form-email:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.wc-subscribe-form-submit {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;

}

.wc-subscribe-form-submit:hover {
    background: #005a87;
}

.wc-subscribe-form-submit:active {
    transform: translateY(1px);
}

.wc-subscribe-form-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 消息样式 */
.wc-subscribe-form-message {
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
}

.wc-subscribe-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wc-subscribe-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Toast 容器样式 - 确保在弹窗之上 */
.wc-subscribe-toast-container {
    z-index: 9999999 !important;
}

/* 确认页面样式 */
.wc-subscribe-confirmation {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border: 1px solid #c3e6cb;
    text-align: center;
}

.wc-subscribe-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .wc-subscribe-popup-content {
        width: calc(100% - 40px);
    }
    
    .wc-subscribe-popup-title {
        font-size: 20px;
    }
    
    .wc-subscribe-form-email,
    .wc-subscribe-form-submit {
        font-size: 14px;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .wc-subscribe-popup-content {
        width: calc(100% - 20px);
    }
    
    .wc-subscribe-popup-title {
        font-size: 18px;
    }
}

/* 加载动画 */
.wc-subscribe-form-submit.loading {
    position: relative;
    color: transparent;
}

.wc-subscribe-form-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: wc-subscribe-spin 1s linear infinite;
}

@keyframes wc-subscribe-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== 联系表单样式 ========== */

.mailnest-form-container {
    max-width: 100%;
}

/* Bootstrap 5 样式已足够，这里只添加少量补充 */

.mailnest-form .form-field-item {
    margin-bottom: 1rem;
}

.mailnest-form .invalid-feedback {
    display: none;
}

.mailnest-form.was-validated .form-control:invalid,
.mailnest-form.was-validated .form-select:invalid {
    border-color: #dc3545;
}

.mailnest-form.was-validated .form-control:invalid ~ .invalid-feedback,
.mailnest-form.was-validated .form-select:invalid ~ .invalid-feedback {
    display: block;
}

.mailnest-form.was-validated .form-control:valid,
.mailnest-form.was-validated .form-select:valid {
    border-color: #198754;
}

.mailnest-form .form-check-input:invalid ~ .invalid-feedback {
    display: block;
}

.mailnest-form .form-check-input:invalid {
    border-color: #dc3545;
}

.mailnest-form .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}