/* ========== 分组管理弹窗样式 ========== */

/* 分组管理弹窗 */
#groupMgmtModal .modal-group-mgmt {
    width: 600px;
    max-width: 95%;
}

/* 分组管理区块样式 */
.group-create-section,
.group-list-section,
.random-group-section {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
}

.group-create-section:last-child,
.group-list-section:last-child,
.random-group-section:last-child {
    margin-bottom: 0;
}

.group-create-section h4,
.group-list-section h4,
.random-group-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 新建分组表单 - 一行显示 */
.group-create-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.group-create-form input[type="text"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s ease;
}

.group-create-form input[type="text"]:focus {
    outline: none;
    border-color: var(--theme-color);
    box-shadow: 0 0 0 3px rgba(var(--theme-color-rgb), 0.1);
}

/* 添加学生按钮 */
.group-create-form .btn-add-students {
    padding: 10px 15px;
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.group-create-form .btn-add-students:hover {
    background-color: #e8f5e9;
    border-color: #4caf50;
    color: #4caf50;
}

/* 创建分组按钮 */
.group-create-form .btn-primary {
    padding: 10px 20px;
    background-color: var(--theme-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.group-create-form .btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* 已选学生预览 */
.selected-students-preview {
    min-height: 50px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.selected-students-preview:empty::before {
    content: '未选择学生';
    color: #999;
    font-size: 13px;
}

.student-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: var(--theme-color);
    color: #fff;
    border-radius: 16px;
    font-size: 13px;
}

.student-tag .remove-btn {
    cursor: pointer;
    font-weight: bold;
    margin-left: 3px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.student-tag .remove-btn:hover {
    opacity: 1;
}

/* 分组列表容器 */
.group-list-container {
    max-height: 300px;
    overflow-y: auto;
}

/* 分组项样式 */
.group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.group-item:last-child {
    margin-bottom: 0;
}

.group-item:hover {
    border-color: var(--theme-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 分组左侧信息 */
.group-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.group-color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.group-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.group-count {
    font-size: 13px;
    color: #999;
}

/* 分组操作按钮区域 */
.group-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-edit {
    background-color: #e3f2fd;
    color: #1976d2;
}

.btn-edit:hover {
    background-color: #bbdefb;
}

.btn-manage {
    background-color: #e8f5e9;
    color: #388e3c;
}

.btn-manage:hover {
    background-color: #c8e6c9;
}

.btn-delete {
    background-color: #ffebee;
    color: #c62828;
}

.btn-delete:hover {
    background-color: #ffcdd2;
}

/* 分组列表空状态 */
.group-list-empty {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-size: 14px;
}

/* 随机分组区域 - 完全参考萌宠管理样式 */
.random-group-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

/* 随机分组输入区域 */
.random-group-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.random-group-inputs label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.random-group-inputs input[type="number"] {
    width: 80px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    background: #fff;
    transition: all 0.2s ease;
}

.random-group-inputs input[type="number"]:focus {
    outline: none;
    border-color: var(--theme-color);
    box-shadow: 0 0 0 3px rgba(var(--theme-color-rgb), 0.1);
}

/* 随机分组按钮 - 参考萌宠管理的大按钮样式 */
.random-group-actions .btn-lg {
    padding: 15px 50px;
    font-size: 18px;
    font-weight: 600;
    background-color: var(--theme-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.random-group-actions .btn-lg:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.random-group-actions .btn-lg:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 提示文字 */
.random-group-tip {
    font-size: 13px;
    color: #999;
    text-align: center;
    margin: 0;
}

/* ========== 学生选择弹窗样式 ========== */

#addStudentToGroupModal {
    z-index: 10001; /* 确保在管理弹窗之上 */
}

#addStudentToGroupModal .modal-student-select {
    width: 600px;
    max-width: 95%;
}

.search-box {
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.search-box input:focus {
    outline: none;
    border-color: var(--theme-color);
}

.filter-options {
    margin-bottom: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.student-select-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    background: #f9f9f9;
}

.student-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.student-select-item:last-child {
    margin-bottom: 0;
}

.student-select-item:hover {
    border-color: var(--theme-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.student-select-item.selected {
    background: #e3f2fd;
    border-color: var(--theme-color);
}

.student-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.student-info-inline {
    flex: 1;
}

.student-name-inline {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.student-meta {
    font-size: 12px;
    color: #999;
}

/* ========== 管理分组学生弹窗样式 ========== */

#manageGroupStudentsModal .modal-student-manage {
    width: 600px;
    max-width: 95%;
    max-height: 85vh;
}

.current-students-section {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 20px;
}

.current-students-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.group-students-list {
    max-height: 400px;
    overflow-y: auto;
}

.group-student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.group-student-item:last-child {
    margin-bottom: 0;
}

.group-student-item:hover {
    border-color: var(--theme-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.add-more-section {
    text-align: center;
}

.add-more-section .btn-secondary {
    padding: 10px 20px;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-more-section .btn-secondary:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}

/* 图标删除按钮 */
.btn-icon-delete {
    width: 32px;
    height: 32px;
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-icon-delete:hover {
    background-color: #ffebee;
    transform: scale(1.1);
}

.btn-icon-delete:active {
    transform: scale(0.95);
}

/* ========== 响应式设计 ========== */

@media (max-width: 768px) {
    #groupMgmtModal .modal-group-mgmt,
    #addStudentToGroupModal .modal-student-select,
    #manageGroupStudentsModal .modal-student-manage {
        width: 95%;
    }
    
    .group-create-form {
        flex-direction: column;
    }
    
    .group-create-form input[type="text"],
    .group-create-form .btn-add-students,
    .group-create-form .btn-primary {
        width: 100%;
    }
    
    .group-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .group-item-left {
        width: 100%;
    }
    
    .group-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .random-group-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .random-group-actions .btn-lg {
        width: 100%;
        padding: 12px 20px;
    }
}
