/* 用户编辑功能样式文件 */

/* 编辑用户表单样式 */
.edit-user-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.form-section h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-weight: 600;
    font-size: 16px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.field-help {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    line-height: 1.4;
}

.field-error {
    font-size: 12px;
    color: #dc3545;
    margin-top: 5px;
    padding: 5px 10px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    border-left: 3px solid #dc3545;
}

/* 角色选择区域 */
.roles-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    background: white;
}

.role-checkbox {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.role-checkbox:hover {
    background: #f8f9fa;
}

.role-checkbox input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
    margin-top: 2px;
    transform: scale(1.1);
}

.role-info {
    flex: 1;
}

.role-info strong {
    display: block;
    color: #333;
    font-size: 14px;
    margin-bottom: 2px;
}

.role-info small {
    color: #6c757d;
    font-size: 12px;
    line-height: 1.3;
    display: block;
}

.no-roles {
    text-align: center;
    color: #6c757d;
    padding: 20px;
    font-style: italic;
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.form-actions .btn {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* 模态框扩展样式 */
.modal-content {
    max-width: 900px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-body {
    padding: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .modal-content {
        width: 95vw;
        margin: 20px auto;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* 加载状态样式 */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #007bff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 表单验证状态 */
.form-group.has-success input {
    border-color: #28a745;
}

.form-group.has-error input {
    border-color: #dc3545;
}

.form-group.has-warning input {
    border-color: #ffc107;
}

/* 特殊字段样式 */
input[readonly] {
    background-color: #f8f9fa !important;
    cursor: not-allowed;
}

/* 头像预览样式 */
.avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #dee2e6;
    margin-top: 10px;
    display: none;
}

.avatar-preview.show {
    display: block;
}

/* 验证状态样式 */
.verification-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    margin-top: 5px;
}

.verification-status.verified {
    color: #28a745;
}

.verification-status.unverified {
    color: #dc3545;
}

.verification-status::before {
    content: '●';
    font-size: 8px;
}

/* 银行信息样式 */
.bank-info-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left-color: #ffc107;
}

/* 登录信息样式 */
.login-info-section {
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%);
    border-left-color: #2196f3;
}

.login-info-section input[readonly] {
    background: white !important;
    border: 1px solid #e0e0e0;
}

/* 身份证号码格式化 */
input[name="id_card_number"] {
    font-family: monospace;
    letter-spacing: 1px;
}

/* URL输入框样式 */
input[type="url"] {
    font-family: monospace;
    font-size: 13px;
}

/* 推荐码样式 */
input[name="referral_code"] {
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%) !important;
    border: 2px solid #ffc107 !important;
}

/* 高亮必填字段 */
.form-group label::after {
    content: '';
}

.form-group label[for*="edit"]:has(+ input[required])::after,
.form-group label[for*="edit"]:has(+ select[required])::after {
    content: ' *';
    color: #dc3545;
    font-weight: bold;
}

/* 密码强度指示器 */
.password-strength {
    margin-top: 5px;
    font-size: 12px;
}

.password-strength-weak {
    color: #dc3545;
}

.password-strength-medium {
    color: #ffc107;
}

.password-strength-strong {
    color: #28a745;
}

/* 等级管理样式 */
.levels-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    background: #fff;
}

.no-levels {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.level-assignment-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
    transition: all 0.2s ease;
}

.level-assignment-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.level-assignment-item.active {
    border-left: 4px solid #28a745;
    background: #f8fff9;
}

.level-assignment-item.inactive {
    border-left: 4px solid #dc3545;
    background: #fff8f8;
    opacity: 0.8;
}

.level-info {
    flex: 1;
}

.level-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.level-name {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.level-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.level-value {
    background: #007bff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.level-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.level-details small {
    color: #666;
    font-size: 12px;
}

.level-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 80px;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-outline {
    border: 1px solid #6c757d;
    color: #6c757d;
    background: transparent;
}

.btn-outline:hover {
    background: #6c757d;
    color: white;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* 分配等级表单样式 */
.assign-level-form .form-group {
    margin-bottom: 15px;
}

.assign-level-form .field-help {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
}

/* 等级分配按钮样式 */
.levels-container + .form-group .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #6c757d;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
}

.levels-container + .form-group .btn:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 响应式等级管理 */
@media (max-width: 768px) {
    .level-assignment-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .level-actions {
        flex-direction: row;
        justify-content: flex-end;
        min-width: auto;
    }
    
    .levels-container {
        max-height: 300px;
    }
}
