/* 学员信息表单增强样式 */

/* 模态框基础样式 */
#studentInfoModal {
    display: none;
}

#studentInfoModal.show {
    display: block;
}

#studentInfoModal .modal-dialog {
    max-width: 90%;
    width: 900px;
    max-height: 90vh;
    margin: 2rem auto;
}

#studentInfoModal .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

#studentInfoModal .modal-header {
    padding: 15px 20px;
    background: var(--main-bg-color);
    border-bottom: 1px solid var(--main-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#studentInfoModal .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--key-color);
    margin: 0;
}

#studentInfoModal .close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--muted-color);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#studentInfoModal .close:hover {
    background: var(--muted-bg-color);
    color: var(--key-color);
}

#studentInfoModal .modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    background: var(--main-bg-color);
}

#studentInfoModal .modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--main-border-color);
    background: var(--main-bg-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

/* 表单布局 */
.student-info-form {
    width: 100%;
}

/* 表单区块 */
.form-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--main-bg-color);
    border-radius: 12px;
    border: 1px solid var(--main-border-color);
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 2px 12px var(--main-shadow);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--theme-color);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--theme-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 表单网格布局 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

/* 表单组 */
.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--key-color);
    font-size: 14px;
}

.required {
    color: #e74c3c;
    margin-left: 4px;
}

/* 输入框样式 */
.line-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--main-border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--key-color);
    background: var(--main-bg-color);
    transition: all 0.3s ease;
}

.line-form-input:focus {
    outline: none;
    border-color: var(--theme-color);
    box-shadow: 0 0 0 3px rgba(240, 68, 148, 0.1);
}

.line-form-input::placeholder {
    color: var(--muted-3-color);
}

/* 禁用状态的输入框 */
.line-form-input:disabled {
    background: var(--muted-bg-color);
    color: var(--muted-color);
    cursor: not-allowed;
    opacity: 0.7;
}

/* 只读状态的输入框 */
.line-form-input[readonly] {
    background: var(--muted-bg-color);
    cursor: not-allowed;
    opacity: 0.8;
}

/* 可编辑状态的输入框 */
.line-form-input.editable {
    background: var(--main-bg-color) !important;
    border-color: var(--theme-color) !important;
    color: var(--key-color) !important;
    cursor: text !important;
    opacity: 1 !important;
    box-shadow: 0 0 0 2px rgba(240, 68, 148, 0.1) !important;
    transition: all 0.3s ease !important;
}

.line-form-input.editable:focus {
    border-color: var(--theme-color) !important;
    box-shadow: 0 0 0 3px rgba(240, 68, 148, 0.2) !important;
    background: var(--main-bg-color) !important;
}

/* 编辑状态下的复选框 */
.checkbox-item input[type="checkbox"]:not(:disabled) {
    cursor: pointer;
}

.checkbox-item:has(input[type="checkbox"]:not(:disabled)) {
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-item:has(input[type="checkbox"]:not(:disabled)):hover {
    background: var(--theme-light-color);
    border-color: var(--theme-color);
    transform: translateY(-1px);
}

/* 文本域样式 */
textarea.line-form-input {
    resize: vertical;
    min-height: 80px;
}

/* 帮助文本 */
.form-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted-color);
    line-height: 1.4;
}

/* 技能复选框 */
.skills-checkbox {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--muted-bg-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--key-color);
    border: 2px solid transparent;
}

.checkbox-item:hover {
    background: var(--theme-light-color);
    border-color: var(--theme-color);
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--theme-color);
}

.checkbox-item input[type="checkbox"]:checked + span {
    color: var(--theme-color);
    font-weight: 500;
}

.checkbox-item:has(input[type="checkbox"]:checked) {
    background: var(--theme-light-color);
    border-color: var(--theme-color);
}

/* 按钮样式 */
.but {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.but:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.but:active {
    transform: translateY(0);
}

.but.jb-green {
    background: #28a745;
    color: white;
}

.but.jb-green:hover {
    background: #218838;
}

.but.jb-blue {
    background: #007bff;
    color: white;
}

.but.jb-blue:hover {
    background: #0056b3;
}

/* 隐藏状态 */
#save-student-info {
    display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #studentInfoModal .modal-dialog {
        max-width: 95%;
        width: 100%;
        margin: 1rem auto;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .skills-checkbox {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    #studentInfoModal .modal-body {
        padding: 15px;
    }
    
    #studentInfoModal .modal-footer {
        padding: 12px 15px;
        flex-wrap: wrap;
    }
    
    .form-section {
        padding: 15px;
    }
}

/* 加载状态 */
#save-student-info.loading {
    position: relative;
    color: transparent;
}

#save-student-info.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 错误消息样式 */
.error-message {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #e74c3c;
}

.line-form-input.error {
    border-color: #e74c3c;
}

/* 通知提示样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

/* 滚动条样式 */
#studentInfoModal .modal-body::-webkit-scrollbar {
    width: 6px;
}

#studentInfoModal .modal-body::-webkit-scrollbar-track {
    background: var(--muted-bg-color);
    border-radius: 3px;
}

#studentInfoModal .modal-body::-webkit-scrollbar-thumb {
    background: var(--theme-color);
    border-radius: 3px;
}

#studentInfoModal .modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--theme-hover-color);
}