/* 模态框样式文件 - 所有模态框和弹窗样式 */

/* 模态框基础样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    position: relative;
    margin: auto;
}

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

/* 模态框头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* 模态框主体 */
.modal-body {
    padding: 2rem;
}

/* 模态框底部 */
.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* 表单样式 */
.auth-form {
    padding: 2rem;
}

/* 确保模态框在所有浏览器中正确居中 */
.modal {
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
}

.modal.show {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-input.input-error {
    border-color: #ef4444;
    background: #fef2f2;
}

.form-submit-btn {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.form-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 错误消息样式 */
.error-message {
    color: #dc2626;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    display: none;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.4;
}

.error-message.show {
    display: flex;
}

.error-message.error-warning {
    color: #d97706;
    background: #fef3c7;
    border-color: #fde68a;
}

.error-message.error-info {
    color: #2563eb;
    background: #dbeafe;
    border-color: #bfdbfe;
}

.error-message.error-validation {
    color: #7c2d12;
    background: #fed7aa;
    border-color: #fdba74;
}

.error-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.error-message-text {
    flex: 1;
    font-weight: 500;
}

.error-suggestions {
    margin: 0.5rem 0 0 0;
    padding-left: 1rem;
    list-style: none;
    font-size: 0.8rem;
    opacity: 0.9;
}

.error-suggestions li {
    margin-bottom: 0.2rem;
    position: relative;
}

.error-suggestions li::before {
    content: "•";
    color: currentColor;
    font-weight: bold;
    position: absolute;
    left: -0.8rem;
}

/* 删除确认模态框 */
.delete-modal {
    max-width: 400px;
}

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

.delete-modal-body h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 1rem;
}

.delete-modal-body p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.delete-tool-name {
    font-weight: 600;
    color: var(--text-primary);
}

.delete-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 确认对话框 */
.confirm-dialog .modal-content {
    max-width: 400px;
}

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

.confirm-dialog .modal-body p {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.confirm-dialog .modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* 邮箱确认模态框 */
.email-confirmation-modal .modal-content {
    max-width: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.email-confirmation-modal .modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.email-confirmation-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    animation: emailBounce 2s ease-in-out infinite;
}

@keyframes emailBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.email-confirmation-modal .modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.email-confirmation-modal .modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.email-confirmation-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.email-confirmation-content {
    padding: 2rem;
}

.email-confirmation-message {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-align: center;
}

.email-display {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    text-align: center;
}

.email-label {
    font-weight: 500;
    color: #64748b;
    display: block;
    margin-bottom: 0.5rem;
}

.email-address {
    font-weight: 600;
    color: #3b82f6;
    font-size: 1.1rem;
    word-break: break-all;
}

.confirmation-steps,
.confirmation-tips {
    margin: 1.5rem 0;
}

.confirmation-steps h4,
.confirmation-tips h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.confirmation-steps ol {
    padding-left: 1.5rem;
    margin: 0;
}

.confirmation-steps li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.confirmation-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.confirmation-tips li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.5;
}

.confirmation-tips li::before {
    content: "•";
    color: #6366f1;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.email-confirmation-modal .modal-footer {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.email-confirmation-modal .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.email-confirmation-modal .btn-secondary {
    background: #e2e8f0;
    color: #64748b;
}

.email-confirmation-modal .btn-secondary:hover {
    background: #cbd5e1;
}

.email-confirmation-modal .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    color: white;
}

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

.email-confirmation-modal .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 1rem;
}

/* 按钮加载状态 */
.button-loading-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.button-loading-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.button-loading-text {
    font-size: 0.9rem;
}

/* 表单加载状态 */
.form-loading {
    pointer-events: none;
    opacity: 0.7;
}

.form-loading .form-input {
    background: #f1f5f9;
}

/* 字段错误样式 */
.field-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.field-error-icon {
    font-size: 0.9rem;
}

.field-error-text {
    flex: 1;
}

/* 动画效果 */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes inputErrorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}